任何时候我在android studio 3中创建项目我都有与错误同步的问题。
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar]
/Applications/Desktop/AndroidProjects/RealmProject/app/build/intermediates/manifests/full/debug/AndroidManifest.xml
Error:(11) error: attribute 'android:roundIcon' not found.
Error:(11) attribute 'android:roundIcon' not found.
Error:failed processing manifest.
Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
Error:Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt
Information:BUILD FAILED in 23s
Information:7 errors
Information:0 warnings
Information:See complete output in console
app.gradle module config:
android {
compileSdkVersion 24
defaultConfig {
applicationId "com.example.mohammad.realmproject"
minSdkVersion 17
targetSdkVersion 24
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:24.0.0'
testImplementation 'junit:junit:4.12'
}
答案 0 :(得分:3)
=> roundIcon
属性为first introduced for Android O(8.0,API级别25)因此,根据您要定位的设备类型,您有两个可用选项:
minSdkVersion
中的targetSdkVersion
和build.gradle
设置为25:defaultConfig {
minSdkVersion 25
targetSdkVersion 25
}
android:roundIcon
,并仅使用android:icon
。