2017-06-26 34 views
1

我在搖籃同步:錯誤的Android應用Azure的依賴gradle這個建立

「讓在Android 2.3.3工作室以下錯誤`錯誤:模塊「com.microsoft.azure:azure-mobile-android: 3.3.0'取決於一個或多個Android庫,但是是一個罐子。「

的錯誤,如果我用

compile 'com.microsoft.azure:azure-mobile-android:3.1.0' 

,而不是

compile 'com.microsoft.azure:azure-mobile-android:3.3.0' 

,但我不希望使用過時的版本中消失。

的build.gradle文件是:

apply plugin: 'com.android.application' 
android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.3" 

    defaultConfig { 
     applicationId "com.my_software.myapp" 
     minSdkVersion 14 
     targetSdkVersion 25 
    } 

    buildTypes { 
     release { 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt' 
     } 
    } 
} 
dependencies { 
    compile 'com.android.support:support-v4:25.3.1' 
    compile 'com.google.android.gms:play-services-drive:11.0.1' 
    compile 'com.google.android.gms:play-services-plus:11.0.1' 
    //FOR microsoft Azure 
    compile 'com.microsoft.azure:azure-mobile-android:3.3.0' 
} 

臨時解決方案:

compile('com.microsoft.azure:azure-mobile-android:[email protected]'‌​) 

(在末尾添加@aar)。

回答

1

我回顧了azure-mobile-apps-android-client GitHub上的源代碼,並3.3.0build.gradle之間3.1.0不同的是,該版本3.3.0所需的依賴com.android.support:customtabs:23.0.1,但3.1.0版本沒有。所以,你需要從25compileSdkVersion & targetSdkVersion值降級到23支持所需的Android庫來解決這個問題,由於com.android.support:customtabs:23.0.1是屬於到Android API 23

+0

不幸降級到23,重建和gradle這個同步沒有做任何差異。我的結論是使用'compile('com.microsoft.azure:azure-mobile-android:[email protected]')'使錯誤消失。希望他們能在下一個版本中修復它。 –