Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not build the project after upgrading to android - P

Below are the errors which I am getting

C:\Users\Dell\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\51cd62c84e9404bd66ab4daf252c48a1\res\values-v28\values-v28.xml
Error:(9, 5) error: resource android:attr/dialogCornerRadius not found.
C:\Users\Dell\.gradle\caches\transforms-1\files-1.1\appcompat-v7-28.0.0-alpha1.aar\51cd62c84e9404bd66ab4daf252c48a1\res\values\values.xml
Error:(252, 5) error: resource android:attr/fontVariationSettings not found.
Error:(252, 5) error: resource android:attr/ttcIndex not found.
E:\20thJune2017_7PM\trunk\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml
Error:(11) error: resource android:attr/dialogCornerRadius not found.
Error:(7) resource android:attr/dialogCornerRadius not found.
Error:(11) resource android:attr/dialogCornerRadius not found.
E:\20thJune2017_7PM\trunk\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml
Error:(486) resource android:attr/fontVariationSettings not found.
Error:(486) resource android:attr/ttcIndex not found.
Error:failed linking references.
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

Below is my build.gradle(app level)

   dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:+'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha3'
    compile 'com.android.support:design:+'
    compile 'com.android.support:support-v4:+'
    testCompile 'junit:junit:4.12'
    compile 'com.squareup.retrofit2:retrofit:2.1.0'
    compile 'com.squareup.retrofit2:converter-gson:2.1.0'
    compile 'com.google.code.gson:gson:2.7'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.github.fiskurgit:ChipCloud:2.1.1'
    compile 'com.google.android.gms:play-services-maps:11.4.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.3.0'
    compile 'commons-codec:commons-codec:1.10'
    compile 'com.crittercism:crittercism-android-agent:+'
    compile 'ch.hsr:geohash:1.3.0'
    compile 'com.google.firebase:firebase-messaging:11.4.0'
    compile 'com.google.firebase:firebase-core:11.4.0'
    compile 'com.google.android.gms:play-services-analytics:11.4.0'
    compile 'com.ahmedjazzar.rosetta:rosetta:1.0.1'
}

I have tried different solutions from stackoverflow but none worked.Can you please help me on this.Thanks in advance.

like image 916
Naveen Avatar asked Mar 13 '18 06:03

Naveen


People also ask

How to enable build variant in Android Studio?

To change the build variant Android Studio uses, select Build > Select Build Variant in the menu bar. For projects without native/C++ code, the Build Variants panel has two columns: Module and Active Build Variant.

How to build the project in Android Studio?

Launch Android Studio, and click File > New > Import Project. Locate your project directory, click the build. gradle file you created above to select it, and then click OK to import your project. Click Build > Make Project to test your build file by building your project and address any errors you find.

How to create build variants Android Studio?

You can change the build variant to whichever one you want to build and run—just go to Build > Select Build Variant and select one from the drop-down menu. To start customizing each build variant with its own features and resources, however, you'll need to know how to create and manage source sets.

What is the build system used for Android projects?

Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app.


1 Answers

I already answered a similar question here.

Try changing the compileSdkVersion to:

compileSdkVersion 28

These attributes were added in this version. Check here, here and here

like image 120
kike Avatar answered Oct 21 '22 10:10

kike