我只能使用 compileSdkVersion 22 buildToolsVersion" 22.0.1" minSdkVersion 11 targetSdkVersion 15
我的项目在gradle版本上运行良好:2.1.3并具有以下依赖性:
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:cardview-v7:22.2.1'
compile 'com.prolificinteractive:material-calendarview:1.2.0'
compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
compile 'commons-codec:commons-codec:1.10'
compile 'commons-io:commons-io:2.4'
而且,我更新了我的Android studio gradle最新版本,而不是在我项目的很多地方发现依赖问题:
java.lang.NoSuchMethodError:没有静态方法 getMatrix(Landroid /视图/视图;)Landroid /图形/矩阵;在班上 Landroid /支撑/ V4 /视图/ ViewCompat;或其超级类(声明 of' android.support.v4.view.ViewCompat'出现在 /data/data/demo.com.android/files/instant-run/dex/slice-com.android.support-support-v4-23.1.1_b118207f54cef84c624be0e78fdf67db32a9749a-classes.dex) 在android.support.v7.widget.RecyclerView $ LayoutManager.getTransformedBoundingBox(RecyclerView.java:8097) 在android.support.v7.widget.OrientationHelper $ 2.getTransformedEndWithDecoration(OrientationHelper.java:402) 在android.support.v7.widget.LinearLayoutManager.recycleViewsFromStart(LinearLayoutManager.java:1275) 在android.support.v7.widget.LinearLayoutManager.recycleByLayoutState(LinearLayoutManager.java:1347) 在android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1371) 在android.support.v7.widget.LinearLayoutManager.scrollBy(LinearLayoutManager.java:1193) 在android.support.v7.widget.LinearLayoutManager.scrollVerticallyBy(LinearLayoutManager.java:1043) 在android.support.v7.widget.RecyclerView.scrollByInternal(RecyclerView.java:1596) 在android.support.v7.widget.RecyclerView.onTouchEvent(RecyclerView.java:2704)
比我用旧版本(2.1.3)降级我的Gradle版本。但是我的项目仍然存在相同的依赖性问题。依赖树显示在我的项目下面:
+--- com.android.support:appcompat-v7:22.2.1
| \--- com.android.support:support-v4:22.2.1 -> 23.1.1
| \--- com.android.support:support-annotations:23.1.1 -> 24.2.0
+--- com.android.support:design:22.2.1
| +--- com.android.support:appcompat-v7:22.2.1 (*)
| \--- com.android.support:support-v4:22.2.1 -> 23.1.1 (*)
+--- com.android.support:recyclerview-v7:+ -> 24.2.0
| +--- com.android.support:support-compat:24.2.0
| | \--- com.android.support:support-annotations:24.2.0
| +--- com.android.support:support-annotations:24.2.0
| \--- com.android.support:support-core-ui:24.2.0
| \--- com.android.support:support-compat:24.2.0 (*)
+--- com.android.support:cardview-v7:22.2.1
+--- com.prolificinteractive:material-calendarview:1.2.0
| \--- com.android.support:support-v4:23.1.1 (*)
+--- com.weiwangcn.betterspinner:library-material:1.1.0
| +--- com.android.support:appcompat-v7:22.1.1 -> 22.2.1 (*)
| \--- com.rengwuxian.materialedittext:library:2.0.3
| +--- com.android.support:support-annotations:21.0.3 -> 24.2.0
| +--- com.nineoldandroids:library:2.4.0
| \--- com.android.support:appcompat-v7:21.0.3 -> 22.2.1 (*)
+--- com.google.android.gms:play-services-appindexing:8.4.0
| \--- com.google.android.gms:play-services-base:8.4.0
| \--- com.google.android.gms:play-services-basement:8.4.0
| \--- com.android.support:support-v4:23.0.0 -> 23.1.1 (*)
+--- commons-codec:commons-codec:1.10
\--- commons-io:commons-io:2.4
请帮我解决这个问题
答案 0 :(得分:1)
为什么使用RecyclerView的最新版本?
也许您应该指出版本22.2.1
。
compile 'com.android.support:recyclerview-v7:22.2.1'