[英]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.