2016-06-08 23 views
0

我已經在文檔中使用它們的白插件(使用它們的插件)部署了工件到bintray。一切都很美好。它在瀏覽器中打開,結構看起來很好:https://dl.bintray.com/flymob/maven/通過gradle(非jcenter)解決bintray中的文物

現在我想在發佈到jcenter()之前通過Android Studio中的gradle使用它。我看過他們的文檔https://bintray.com/docs/usermanual/formats/formats_mavenrepositories.html#_working_with_gradle

我已經試過:

buildscript { 
    repositories { 
     jcenter() 
     maven { 
      url "https://dl.bintray.com/flymob/maven" 
     } 
    } 
} 

compile 'flymob-sdk-sample:FlyMobSdk:1.3.0' 

compile 'flymob-sdk-sample:FlyMobSdk:[email protected]' 

我收到提示: 無法解析: flymob-sdk-sample:FlyMobSdk:1.3.0

我在做什麼錯?

回答

2

您在buildscript部分中添加了"https://dl.bintray.com/flymob/maven"部分。這些是buildscript(又名gradle腳本)使用的回購站。這些都是系統將從apply plugin

找到插件的回購,以解決它很容易。只需將其移動到腳本「根目錄」上的repositories即可。例如:

buildscript { 
    repositories { 
     // repos for the build script 
     jcenter() 
     ... etc 
    } 

    dependencies { 
     // dependencies from the plugins from the build script 
     classpath 'com.android.tools.build:gradle:2.1.2' 
     ... etc 
    } 
} 

apply plugin: 'android-sdk-manager' 
apply plugin: ... etc 

repositories { 
    jcenter() 
    maven { url "https://dl.bintray.com/flymob/maven" } <<<<< HERE 
} 

dependencies { 
    compile ... etc 
+0

非常感謝! 所有作品! – user2247864

相關問題