Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/69.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在链接到Jcenter之前上传到Bintray上的模块?_Android_Android Things_Bintray_Jcenter - Fatal编程技术网

Android 如何在链接到Jcenter之前上传到Bintray上的模块?

Android 如何在链接到Jcenter之前上传到Bintray上的模块?,android,android-things,bintray,jcenter,Android,Android Things,Bintray,Jcenter,你好,我为androidthings制作了一个mpu6050驱动程序(?)并上传到bintray上 似乎上传得很好,因为我成功下载并重新使用了*.aar库 我听说链接到Jcenter大约需要一天的时间,所以在链接之前我需要额外的代码进行测试 在项目的build.gradle中 buildscript { repositories { mavenCentral() jcenter() maven { url "https://dl.bint

你好,我为androidthings制作了一个mpu6050驱动程序(?)并上传到bintray上

似乎上传得很好,因为我成功下载并重新使用了*.aar库

我听说链接到Jcenter大约需要一天的时间,所以在链接之前我需要额外的代码进行测试

在项目的build.gradle中

buildscript {
    repositories {
        mavenCentral()
        jcenter()
        maven { url "https://dl.bintray.com/mechasolution/AndroidThings/" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.novoda:bintray-release:0.3.4'
    }
}
dependencies {
    ...
    compile 'org.mechasolution:mpu6050:0.1@aar'
}
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

publish {
    repoName  = 'AndroidThings'
    userOrg = 'mechasolution'
    groupId = 'org.mechasolution'
    artifactId = 'mpu6050'
    publishVersion = '0.1'
    desc = 'mpu6050 driver for AndroidThings provided by mechasolution'
    website = 'https://github.com/mechasolution/mpu6050test'
    issueTracker = "https://github.com/mechasolution/mpu6050test/issues"
    repository = "https://github.com/mechasolution/mpu6050test.git"
}
应用程序内的build.gradle

buildscript {
    repositories {
        mavenCentral()
        jcenter()
        maven { url "https://dl.bintray.com/mechasolution/AndroidThings/" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.novoda:bintray-release:0.3.4'
    }
}
dependencies {
    ...
    compile 'org.mechasolution:mpu6050:0.1@aar'
}
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

publish {
    repoName  = 'AndroidThings'
    userOrg = 'mechasolution'
    groupId = 'org.mechasolution'
    artifactId = 'mpu6050'
    publishVersion = '0.1'
    desc = 'mpu6050 driver for AndroidThings provided by mechasolution'
    website = 'https://github.com/mechasolution/mpu6050test'
    issueTracker = "https://github.com/mechasolution/mpu6050test/issues"
    repository = "https://github.com/mechasolution/mpu6050test.git"
}
下面是模块的build.gradle

buildscript {
    repositories {
        mavenCentral()
        jcenter()
        maven { url "https://dl.bintray.com/mechasolution/AndroidThings/" }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.novoda:bintray-release:0.3.4'
    }
}
dependencies {
    ...
    compile 'org.mechasolution:mpu6050:0.1@aar'
}
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

publish {
    repoName  = 'AndroidThings'
    userOrg = 'mechasolution'
    groupId = 'org.mechasolution'
    artifactId = 'mpu6050'
    publishVersion = '0.1'
    desc = 'mpu6050 driver for AndroidThings provided by mechasolution'
    website = 'https://github.com/mechasolution/mpu6050test'
    issueTracker = "https://github.com/mechasolution/mpu6050test/issues"
    repository = "https://github.com/mechasolution/mpu6050test.git"
}
这似乎是正确的代码,但android studio keep给出了错误

错误:(31,13)未能解析:org.mechanasolution:mpu6050:0.1


有人知道我错过了什么或出了什么问题吗?

你应该将回购放在根
build.gradle中的
所有项目下(而不是
buildscript
):

发件人:

allprojects块是配置存储库和 项目中所有模块(如第三方模块)使用的依赖项 插件或库。并非所有应用程序都需要的依赖项 项目中的模块应在模块级进行配置 build.gradle文件


哇,真管用。谢谢。我为此花了大约一天的时间。好像我读过的帖子都是旧的或者作者提供了错误的信息。再次感谢。对于那些谁寻找AndroidThings贡献驱动程序mpu6050。欢迎试试我的司机。手册准备好了。很快它就会链接到jcenter。