![](/img/trans.png)
[英]Android compileSdkVersion 23, minSdkVersion 15, targetSdkVersion 23
[英]Why does Android Studio throw errors in the manifest file when we change the compileSdkVersion and targetSdkVersion from 26 to 23?
我已經進行了徹底的搜索,找不到我所遇到的錯誤的原因。
我所做的事情:
片段:
apply plugin: 'com.android.application' android { compileSdkVersion 26 defaultConfig { applicationId "com.airtelanalytics" minSdkVersion 14 targetSdkVersion 26 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:26.1.0' compile 'com.android.support:recyclerview-v7:26.1.+' compile 'com.jaredrummler:android-processes:1.1.1' implementation 'com.android.support.constraint:constraint-layout:1.0.2' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' }
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="23" /> <application android:allowBackup="true" android:debuggable="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" > <activity android:name="com.analyticsdemo.MainActivity" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application>
如何解決呢?
我將應用程序gradle文件中的compileSdkVersion和targetSdkVersions從26更改為23。
這不是一個好計划,尤其是如果您打算通過Play商店發貨時,因為您很快就會再次提高這些值 。
如何解決呢?
最好的解決方案是將您的compileSdkVersion
和targetSdkVersion
回26。
否則,請修復編譯器報告的錯誤。
在這種情況下,您的清單在<application>
上具有android:roundIcon
,而android:roundIcon
在API級別23下不存在。您是說通過compileSdkVersion 23
,要使用針對API級別23的規則進行編譯。 ,其中包括不使用當時不存在的東西。 因此,從您的實際清單中擺脫android:roundIcon
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.