2017-10-01 11 views
2

こんにちは私はドライバー(?)androidthingsためmpu6050のを作り、bintray https://dl.bintray.com/mechasolution/androidthings/Jcenterにリンクする前にBintrayにアップロードしたモジュールはどのようにすることができますか?

にアップロードされた私は正常にダウンロードおよび* .aarライブラリを再利用cuzをうまくアップロードされたように思え。

Jcenterにリンクするのに約1日かかると聞いたので、リンクする前にテストするために追加コードが必要です。以下

プロジェクトの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' 
    } 
} 
アプリのbuild.gradleで

dependencies { 
    ... 
    compile 'org.mechasolution:mpu6050:[email protected]' 
} 

それは正しいコードが、アンドロイドスタジオ・キープが好きなのを思え

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ですエラーが発生する

エラー:(31,13)解決に失敗しました:org.mechasolution:mpu6050:0.1

誰かが私が逃したか間違っていたことを知っていますか?

+0

を。私の運転手を歓迎してみてください。 https://github.com/mechasolution/mpu6050テストマニュアルの準備。すぐにjcenterにリンクされます。 –

答えて

2

あなたのルートbuild.gradle(ないbuildscript)にallprojectsの下であなたのレポを置く必要があります。

allprojects { 
    repositories { 
     jcenter() 
     maven { url "https://dl.bintray.com/mechasolution/AndroidThings/" } 
    } 
} 

Android Studio guideから:AndroidThingsのcontribのドライバmpu6050を探している人のために

The allprojects block is where you configure the repositories and dependencies used by all modules in your project, such as third-party plugins or libraries. Dependencies that are not required by all the modules in the project should be configured in module-level build.gradle files

+0

うわー、それは動作します。どうもありがとう。私はこれのために約1日を過ごしました。私が読んだ記事が古いか、作者が誤った情報を与えたようです。再度、感謝します。 –

関連する問題