11

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.

Ewoks
  • 12,285
  • 8
  • 58
  • 67
Naveen
  • 481
  • 2
  • 6
  • 23
  • Have you tried the solution given [here](https://stackoverflow.com/questions/49171300/no-resource-found-that-matches-the-given-name-at-dialogcornerradius-with-valu) – Jordan Mar 13 '18 at 06:47
  • Not sure if Android P has a pre-release already? But I saw that you are compiling and targeting both SDK 26. If you are truly trying to build on Android P, you should use 28 for both values. – Sira Lam Mar 13 '18 at 06:49
  • https://developer.android.com/preview/setup-sdk.html – Sira Lam Mar 13 '18 at 06:50
  • Hi Jirdan, Yes, by the mentioned solution apk is building but it is showing "App not installed" both(debug and release). After building apk with given link which you have specified, https://stackoverflow.com/questions/49233866/app-not-installed-after-upgrading-to-android-p – Naveen Mar 13 '18 at 06:51
  • Hi Sira Lam, can you please look into this, https://stackoverflow.com/questions/49233866/app-not-installed-after-upgrading-to-android-p. I have tried solutions in the link but none worked me.Please help me on this – Naveen Mar 13 '18 at 06:54
  • please include your dependencies block from the gradle file – laalto Mar 13 '18 at 06:54
  • I cannot able to add dependencies, – Naveen Mar 13 '18 at 07:03
  • Added Dependencies.Can you please look into this. – Naveen Mar 13 '18 at 07:07

8 Answers8

20

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

kike
  • 4,255
  • 5
  • 23
  • 41
  • i have changes to 28 but still not working ERROR: 1. error: resource android:attr/dialogCornerRadius not found. 2. error: resource android:attr/dialogCornerRadius not found. 3. AAPT: error: resource android:attr/fontVariationSettings not found. 4. AAPT: error: resource android:attr/ttcIndex not found. – Sathvik Nasani May 21 '19 at 09:13
  • did you find a solution? – pinturic Jun 13 '19 at 22:51
  • My complieSdkVersion is already 28 but still I am facing the issue. What i did is migrated AndroidX (Recator -> Migrate to AndroidX). Can you please suggest what is the issue and how to fix that. Linking error: \app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml – sssvrock Aug 29 '19 at 05:11
3

Delete these lines and sync:

compile 'com.android.support:appcompat-v7:+'
compile 'com.android.support:design:+'
compile 'com.android.support:support-v4:+'

then goto File -> Project Structure then goto Dependencies and click + button on top right

select library dependencies From the list. Select the above 3 dependencies and click OK

Make sure that compileSdkVerison and targetSdkVersion are same as that in these dependencies.

  • Hi Nitesh, I have tried above specified solution but didn't worked out."App Not Installed" error.Can you please help me on this. – Naveen Mar 14 '18 at 06:13
  • yes, I cannot able to get this Issue. Im trying from 2 days. – Naveen Mar 14 '18 at 08:31
  • Add this line before these dependencies and try: //noinspection GradleCompatible – Nitesh Lekhi Mar 19 '18 at 15:10
  • @NiteshLekhi never add dependencies with "+", but use specific/exact dependency version. That way your build will be reproducible and when your code, for whatever reason not works with the newest version you would still be able to build and use the last working. It will help you avoid nasty issues and lose a lot of time. You will thank me later ;) – Ewoks Nov 15 '18 at 07:51
2

You need to use more specific versions of your dependencies

compile 'com.android.support:design:+'

selects the newest design support library (28.0.0-alpha) which is not compatible with your compile SDK <28. Change to

compile 'com.android.support:design:27.+'

or preferably a specific version such as

compile 'com.android.support:design:27.1.0'

Similarly for your other dynamic dependencies with + in their version.

laalto
  • 150,114
  • 66
  • 286
  • 303
2

I had a similar problem and the solution was to migrate to AndroidX.

With Android Studio 3.2 and higher, you can quickly migrate an existing project to use AndroidX by selecting Refactor > Migrate to AndroidX from the menu bar.

If you have any Maven dependencies that have not been migrated to the AndroidX namespace, the Android Studio build system also migrates those dependencies for you when you set the following two flags to true in your gradle.properties file:

android.useAndroidX=true
android.enableJetifier=true

To migrate an existing project that does not use any third-party libraries with dependencies that need converting, you can set the android.useAndroidX flag to true and the android.enableJetifier flag to false.

Source.

hvar90
  • 213
  • 2
  • 9
  • My complieSdkVersion is already 28 but still I am facing the issue. What i did is migrated AndroidX (Recator -> Migrate to AndroidX). Can you please suggest what is the issue and how to fix that. Linking error: \app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml – sssvrock Aug 29 '19 at 05:12
1

If you are still facing this problem, try to debug in terminal.There are many reasons for occurrence of this error, but one cannot pin point exact reason unless you debug in detail. Run this command in terminal , you may get to know where exactly you are getting this bug:

./gradlew installDebug

Veeresh P
  • 436
  • 3
  • 15
0

look @ your Compile SDK Version and (mine whas API: 26: Android 8.0)

and change in your Build.gradle Module:app the next thing:

->>>form: implementation 'com.android.support:design:28.0.0-beta1'

implementation 'com.android.support:cardview-v7:28.0.0-beta1'
implementation 'com.android.support:recyclerview-v7:28.0.0-beta1'
implementation 'com.android.support:appcompat-v7:28.0.0-beta1'

->>>to: implementation 'com.android.support:design:26.0.0-beta1'

implementation 'com.android.support:cardview-v7:26.0.0-beta1'
implementation 'com.android.support:recyclerview-v7:26.0.0-beta1'
implementation 'com.android.support:appcompat-v7:26.0.0-beta1'

have a nice day...

hrish
  • 1
  • 2
0

Try this:

Go to dependencies at gradle (module) and replace all the dependencies with the following:

dependencies {
  debugImplementation 'com.android.support.constraint:constraint-layout:1.1.2'
  implementation fileTree(include: ['*.jar'], dir: 'libs')
  androidTestImplementation 'junit:junit:4.12'
  implementation 'com.android.support:appcompat-v7:26.1.0'
  implementation 'com.android.support:support-v4:26.1.0'
  implementation 'com.android.support:design:26.1.0'
}

Change all SdkVersion to 26

Then under compileSdkVersion add the following:

buildToolsVersion '27.0.3'
trevorp
  • 1,161
  • 1
  • 14
  • 19
0

For me, just going to app level build.gradle and changing targetsdk level to the recommended level fixed the issue

Dred95
  • 1