簡體   English   中英

使用編譯時提高Android中的API級別('com.google.android.gms:play-services:+')

[英]Increase API level in Android when using compile ('com.google.android.gms:play-services:+')

我正在使用這些依賴項,無法將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')
    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級別?

我將參考我對另一篇類似問題的回答:

https://stackoverflow.com/a/42315590/2877453

基本上,您使用“ +”表示您無論如何都想要最新版本。 您永遠都不要這樣做,因為它會導致無法預料的問題,就像您現在遇到的那樣。

如果您希望支持低於14的版本,則必須使用所有Google庫的舊版本。

因此,您必須將“ +”替換為“ 10.0.1”,因為這是仍支持API 9的最新版本。

使用“ +”時,將獲得“ 10.2”(或更高版本)版本,並且僅支持低至API 14的版本。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM