今天,我在这个问题上争论了太久了,似乎无法弄清楚此设置有什么问题。我已经按照本教程进行了操作,以便能够将Android库上载到Bintray(然后将其添加到jcenter)。以下是相关文件:
项目级别build.gradle:
buildscript {
ext.kotlin_version = '1.3.20'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath "com.github.dcendents:android-maven-gradle-plugin:2.1"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
库级别build.gradle:
apply plugin: 'com.android.library'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
ext{
bintrayRepo = "FlexibleRecyclerView"
bintrayName = "com.tornelas.flexiblerecyclerview"
libraryName = "flexiblerecyclerview"
//artifact
publishedGroupId = 'com.tornelas.flexiblerecyclerview'
artifact = 'flexiblerecyclerview'
libraryVersion = '0.1'
libraryDescription = 'A recycler view where you can set the number of columns/rows and orientation on the .xml file instead of setting it on the layout manager.'
siteUrl = ''
gitUrl = ''
developerId = 'tornelas'
developerName = 'Tiago Ornelas'
developerEmail = ''
licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.text'
allLicenses = ['Apache-2.0']
}
android {
compileSdkVersion 28
defaultConfig {
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "0.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
}
if(project.rootProject.file('local.properties').exists()){
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle'
apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle'
}
(出于隐私原因,我省略了siteUrl,gitUrl和developerEmail)
在双托盘仪表板上:http://snpy.in/UwPAv5
当我运行“ bintrayUpload”时,我得到以下信息:
1: Task failed with an exception.
Execution failed for task ':flexiblerecyclerview:bintrayUpload'.
> Could not create package 'tornelas/FlexibleRecyclerView/com.tornelas.flexiblerecyclerview': HTTP/1.1 404 Not Found [message:Repo 'FlexibleRecyclerView' was not found]
2: Task failed with an exception.
Execution failed for task ':bintrayPublish'.
> Could not sign version '0.1': HTTP/1.1 404 Not Found [message:Repo 'FlexibleRecyclerView' was not found]
我想知道是否发生此问题,因为该库“ FlexibleRecyclerView”是组织(称为“ Frontkom”)的一部分。但是我无法解决这个问题。
我确定local.properties上的凭据是正确的,因为我已经使用它们的REST API对其进行了身份验证。
非常感谢!
答案 0 :(得分:0)
因此,问题是我试图发布到属于我的组织的存储库(即使我是该组织的所有者),但无法在该组织之外创建存储库。因此,只需添加
onClick
在import React, { Component } from 'react';
import Lightbox from 'react-lightbox-component';
class LightBoxTest extends Component {
constructor(props) {
super(props);
this.state = {
images: [
{
src: '../images/pic_01.jpg'
},
{
src: '../images/pic_02.jpg'
},
{
src: '../images/pic_03.jpg'
}
]
}
}
render() {
const { images } = this.state;
return (
<div style={{ display: 'flex', flexDirection:'row' }}>
<div>
<Lightbox
images={images}
thumbnailWidth='150px'
thumbnailHeight='150px'
/>
</div>
<div>
<img src="../images/decorative_pic.jpg" style={{ width: '150px', height: '150px' }} />
<img src="../images/decorative_pic.jpg" style={{ width: '150px', height: '150px' }} />
<img src="../images/decorative_pic.jpg" style={{ width: '150px', height: '150px' }} />
</div>
</div>
)
}
}
export default LightBoxTest;
之后,我就可以成功上传到模块的build.gradle。