2017-03-28 53 views
3

我的android studio今天從版本2.2.3到2.3後,我得到了這個錯誤build.gradle' com.android.support:appcompat-v7:25.2.0'依賴關係。 但該項目仍然可以運行。 我運行一個Gradle依賴關係報告來查看我的完整依賴關係樹。顯示如下。但我仍然不知道如何解決這個錯誤。所有的com.android.support庫必須使用完全相同的版本規範發現版本25.2.0,25.0.0

的依賴關係樹

------------------------------------------------------------ 
 
Project :app 
 
------------------------------------------------------------ 
 

 
compile - Classpath for compiling the main sources. 
 
+--- com.github.bumptech.glide:glide:3.7.0 
 
+--- project :mylibrary 
 
| +--- com.android.support:appcompat-v7:22.0.0 -> 25.2.0 
 
| | +--- com.android.support:support-annotations:25.2.0 
 
| | +--- com.android.support:support-v4:25.2.0 
 
| | | +--- com.android.support:support-compat:25.2.0 
 
| | | | \--- com.android.support:support-annotations:25.2.0 
 
| | | +--- com.android.support:support-media-compat:25.2.0 
 
| | | | +--- com.android.support:support-annotations:25.2.0 
 
| | | | \--- com.android.support:support-compat:25.2.0 (*) 
 
| | | +--- com.android.support:support-core-utils:25.2.0 
 
| | | | +--- com.android.support:support-annotations:25.2.0 
 
| | | | \--- com.android.support:support-compat:25.2.0 (*) 
 
| | | +--- com.android.support:support-core-ui:25.2.0 
 
| | | | +--- com.android.support:support-annotations:25.2.0 
 
| | | | \--- com.android.support:support-compat:25.2.0 (*) 
 
| | | \--- com.android.support:support-fragment:25.2.0 
 
| | |   +--- com.android.support:support-compat:25.2.0 (*) 
 
| | |   +--- com.android.support:support-media-compat:25.2.0 (*) 
 
| | |   +--- com.android.support:support-core-ui:25.2.0 (*) 
 
| | |   \--- com.android.support:support-core-utils:25.2.0 (*) 
 
| | +--- com.android.support:support-vector-drawable:25.2.0 
 
| | | +--- com.android.support:support-annotations:25.2.0 
 
| | | \--- com.android.support:support-compat:25.2.0 (*) 
 
| | \--- com.android.support:animated-vector-drawable:25.2.0 
 
| |   \--- com.android.support:support-vector-drawable:25.2.0 (*) 
 
| \--- com.nineoldandroids:library:2.4.0 
 
+--- project :tastytoast 
 
| +--- com.android.support:appcompat-v7:25.0.1 -> 25.2.0 (*) 
 
| \--- com.facebook.rebound:rebound:0.3.8 
 
+--- com.android.support:appcompat-v7:25.2.0 (*) 
 
+--- com.android.support:cardview-v7:25.2.0 
 
| \--- com.android.support:support-annotations:25.2.0 
 
+--- com.android.support:design:25.2.0 
 
| +--- com.android.support:support-v4:25.2.0 (*) 
 
| +--- com.android.support:appcompat-v7:25.2.0 (*) 
 
| +--- com.android.support:recyclerview-v7:25.2.0 
 
| | +--- com.android.support:support-annotations:25.2.0 
 
| | +--- com.android.support:support-compat:25.2.0 (*) 
 
| | \--- com.android.support:support-core-ui:25.2.0 (*) 
 
| \--- com.android.support:transition:25.2.0 
 
|   +--- com.android.support:support-annotations:25.2.0 
 
|   \--- com.android.support:support-v4:25.2.0 (*) 
 
+--- com.aurelhubert:ahbottomnavigation:1.2.3 
 
| \--- com.android.support:design:23.2.1 -> 25.2.0 (*) 
 
+--- com.android.support:support-v4:25.2.0 (*) 
 
+--- com.squareup.retrofit2:retrofit:2.0.0 
 
| \--- com.squareup.okhttp3:okhttp:3.2.0 -> 3.3.1 
 
|   \--- com.squareup.okio:okio:1.8.0 
 
+--- com.squareup.retrofit2:converter-gson:2.0.0 
 
| +--- com.squareup.retrofit2:retrofit:2.0.0 (*) 
 
| \--- com.google.code.gson:gson:2.6.1 
 
+--- com.squareup.picasso:picasso:2.5.2 
 
+--- com.github.lovetuzitong:MultiImageSelector:1.2 
 
| +--- com.squareup.picasso:picasso:2.4.0 -> 2.5.2 
 
| \--- com.android.support:appcompat-v7:23.4.0 -> 25.2.0 (*) 
 
+--- com.facebook.android:facebook-android-sdk:4.20.0 
 
| +--- com.android.support:support-v4:25.0.0 -> 25.2.0 (*) 
 
| +--- com.android.support:appcompat-v7:25.0.0 -> 25.2.0 (*) 
 
| +--- com.android.support:cardview-v7:25.0.0 -> 25.2.0 (*) 
 
| +--- com.android.support:customtabs:25.0.0 
 
| | +--- com.android.support:support-compat:25.0.0 -> 25.2.0 (*) 
 
| | \--- com.android.support:support-annotations:25.0.0 -> 25.2.0 
 
| \--- com.parse.bolts:bolts-android:1.4.0 
 
|   +--- com.parse.bolts:bolts-tasks:1.4.0 
 
|   \--- com.parse.bolts:bolts-applinks:1.4.0 
 
|    \--- com.parse.bolts:bolts-tasks:1.4.0 
 
+--- com.weiwangcn.betterspinner:library:1.1.0 
 
| \--- com.android.support:appcompat-v7:22.1.1 -> 25.2.0 (*) 
 
+--- com.weiwangcn.betterspinner:library-material:1.1.0 
 
| +--- com.android.support:appcompat-v7:22.1.1 -> 25.2.0 (*) 
 
| \--- com.rengwuxian.materialedittext:library:2.0.3 
 
|   +--- com.android.support:support-annotations:21.0.3 -> 25.2.0 
 
|   +--- com.nineoldandroids:library:2.4.0 
 
|   \--- com.android.support:appcompat-v7:21.0.3 -> 25.2.0 (*) 
 
+--- com.squareup.okhttp3:logging-interceptor:3.3.1 
 
| \--- com.squareup.okhttp3:okhttp:3.3.1 (*) 
 
+--- com.pkmmte.view:circularimageview:1.1 
 
+--- com.jeremyfeinstein.slidingmenu:library:1.3 
 
+--- org.jsoup:jsoup:1.9.1 
 
+--- com.foursquare:placepicker:0.5.7 
 
| +--- io.reactivex:rxandroid:1.0.1 
 
| | \--- io.reactivex:rxjava:1.0.13 
 
| +--- com.google.android.gms:play-services-base:8.3.0 
 
| | \--- com.google.android.gms:play-services-basement:8.3.0 
 
| |   \--- com.android.support:support-v4:22.2.0 -> 25.2.0 (*) 
 
| +--- com.android.support:appcompat-v7:23.1.0 -> 25.2.0 (*) 
 
| +--- com.google.code.gson:gson:2.5 -> 2.6.1 
 
| +--- com.jakewharton.rxbinding:rxbinding:0.1.0 
 
| | +--- com.android.support:support-annotations:22.2.0 -> 25.2.0 
 
| | \--- io.reactivex:rxjava:1.0.12 -> 1.0.13 
 
| +--- com.android.support:recyclerview-v7:23.1.0 -> 25.2.0 (*) 
 
| +--- com.squareup.okhttp:okhttp:2.7.0 
 
| | \--- com.squareup.okio:okio:1.6.0 -> 1.8.0 
 
| \--- com.google.android.gms:play-services-location:8.3.0 
 
|   +--- com.google.android.gms:play-services-base:8.3.0 (*) 
 
|   \--- com.google.android.gms:play-services-maps:8.3.0 
 
|    \--- com.google.android.gms:play-services-base:8.3.0 (*) 
 
+--- com.facebook.fresco:fresco:0.12.0 
 
| +--- com.facebook.fresco:drawee:0.12.0 
 
| | +--- com.android.support:support-v4:23.2.1 -> 25.2.0 (*) 
 
| | \--- com.facebook.fresco:fbcore:0.12.0 
 
| +--- com.facebook.fresco:fbcore:0.12.0 
 
| \--- com.facebook.fresco:imagepipeline:0.12.0 
 
|   +--- com.android.support:support-v4:23.2.1 -> 25.2.0 (*) 
 
|   +--- com.facebook.fresco:imagepipeline-base:0.12.0 
 
|   | +--- com.android.support:support-v4:23.2.1 -> 25.2.0 (*) 
 
|   | +--- com.parse.bolts:bolts-tasks:1.4.0 
 
|   | +--- com.nineoldandroids:library:2.4.0 
 
|   | \--- com.facebook.fresco:fbcore:0.12.0 
 
|   +--- com.parse.bolts:bolts-tasks:1.4.0 
 
|   +--- com.nineoldandroids:library:2.4.0 
 
|   \--- com.facebook.fresco:fbcore:0.12.0 
 
+--- com.android.support:multidex:1.0.1 
 
+--- me.villani.lorenzo.android:android-cropimage:1.1.2 
 
\--- com.android.support.constraint:constraint-layout:1.0.0-alpha8 
 
    \--- com.android.support.constraint:constraint-layout-solver:1.0.0-alpha8 
 

 
(*) - dependencies omitted (listed previously)

我gradle這個:

dependencies { 
 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
 
    testCompile 'junit:junit:4.12' 
 
    compile 'com.github.bumptech.glide:glide:3.7.0' 
 
    compile project(':mylibrary') 
 
    compile project(":tastytoast") 
 
    compile files('libs/BaiduLBS_Android.jar') 
 
    compile files('libs/IndoorscapeAlbumPlugin.jar') 
 
    compile 'com.android.support:appcompat-v7:25.2.0' 
 
    compile 'com.android.support:cardview-v7:25.2.0' 
 
    compile 'com.android.support:design:25.2.0' 
 
    compile 'com.aurelhubert:ahbottomnavigation:1.2.3' 
 
    compile 'com.android.support:support-v4:25.2.0' 
 
    compile 'com.squareup.retrofit2:retrofit:2.0.0' 
 
    compile 'com.squareup.retrofit2:converter-gson:2.0.0' 
 
    compile 'com.squareup.picasso:picasso:2.5.2' 
 
    compile 'com.github.lovetuzitong:MultiImageSelector:1.2' 
 
    compile 'com.facebook.android:facebook-android-sdk:4.20.0' 
 
    compile 'com.weiwangcn.betterspinner:library:1.1.0' 
 
    compile 'com.weiwangcn.betterspinner:library-material:1.1.0' 
 
    compile 'com.squareup.okhttp3:logging-interceptor:3.3.1' 
 
    compile 'com.pkmmte.view:circularimageview:1.1' 
 
    compile 'com.jeremyfeinstein.slidingmenu:library:[email protected]ar' 
 
    compile 'org.jsoup:jsoup:1.9.1' 
 
    compile 'com.foursquare:placepicker:0.5.7' 
 
    compile 'com.facebook.fresco:fresco:0.12.0' 
 
    compile 'com.github.bumptech.glide:glide:3.7.0' 
 
    compile 'com.android.support:multidex:1.0.1' 
 
    compile 'me.villani.lorenzo.android:android-cropimage:1.1.2' 
 
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8' 
 

 
}

回答

5

的一個支持庫的依賴並不具有-> 25.2.0後是com.android.support:customtabs:25.0.0,這是從com.facebook.android:facebook-android-sdk:4.20.0

包含於是用25.2.0依賴添加一行到您的build.gradle

compile 'com.android.support:customtabs:25.2.0' 
+0

感謝您的命令。當我添加編譯'com.android.support:customtabs:25.2.0'和'編譯'com.android.support:cardview-v7:25.2.0',但所有佈局得到像這樣的錯誤java.lang.NoSuchFieldError:Toolbar_buttonGravity \t at android.support.v7.widget.Toolbar。 (Toolbar.java:244) \t at android.support.v7.widget.Toolbar。 (Toolbar.java:231) \t在sun.reflect.NativeConstructorAccessorImpl.newInstance0(本機方法) \t在sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) –

+0

你看到這些錯誤,當你把你的應用程序在設備上還是僅在佈局預覽中?如果它只是在佈局預覽中,您將需要確保您已更新到最新的穩定Android Studio,清理和重建等。 – ianhanniballake

+0

是的,它只在佈局預覽中顯示。我已經安裝了最新版本的android工作室,但它是沒用的我的所有佈局仍然顯示錯誤消息如下,我升級後的Android工作室2.3。渲染錯誤:1.無法實例化或更多的類2.不能使裝飾工具欄出MockView 3.渲染問題4.錯過樣式 –

相關問題