Java 使用compile时提高Android中的API级别(';com.google.Android.gms:play services:+;';)
我正在使用这些依赖项,无法将API级别从14降低到13或更低:Java 使用compile时提高Android中的API级别(';com.google.Android.gms:play services:+;';),java,android,Java,Android,我正在使用这些依赖项,无法将API级别从14降低到13或更低: dependencies { compile ('com.google.android.gms:play-services:+') compile files('libs/dagger-1.2.2.jar') compile files('libs/javax.inject-1.jar') compile files('libs/nineoldandroids-2.4.0.jar') comp
dependencies {
compile ('com.google.android.gms:play-services:+')
compile files('libs/dagger-1.2.2.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/support-v4-19.0.1.jar')
compile 'com.android.support:multidex:1.0.1'
当使用
compile('com.google.Android.gms:play services:+')时,您如何提高Android中的API级别?我将参考我在另一篇文章中对类似问题的回答:
基本上使用“+”,你说你总是想要最新的版本,不管是什么。你不应该这样做,因为这会导致不可预见的问题,就像你现在遇到的问题一样
如果您想支持低于14的版本,您必须使用所有Google库的旧版本
因此,您必须将“+”替换为“10.0.1”,因为这是仍然支持API 9的最新版本
使用“+”时,您将获得“10.2”(或更高版本)的版本,并且这些版本只支持API 14。允许的较低API是所有依赖项中最高的。如果您有一个需要API 14的库,您将无法将最小API设置为13。检查您的库的要求您应该做的第一件事是用实际的版本号替换+
。Play Services的版本将决定它需要什么minSdkVersion
,并通过使用+
,你是说你不关心Play Services的版本。如果我使用的是像10.2.1
这样的版本,问题是你应该使用Play Services库的特定部分,而不是全部。它是巨大的,你肯定不需要全部