Gradle issue building Android app: AAPT: Error retrieving parent for item

Viewed 242

I'm having an issue building my app for Android with React-Native. I haven't changed much things on my app recently but something seem to have changed suddenly, certainly due to one of my dependency.

When I try to run assembleRelease I get the following error:

/root/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/9dc7663ea18f37ca9d48501ef1071cf3/res/values-v24/values-v24.xml:3:5-157: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.

/root/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/9dc7663ea18f37ca9d48501ef1071cf3/res/values-v24/values-v24.xml:4:5-135: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.

/root/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/9dc7663ea18f37ca9d48501ef1071cf3/res/values-v26/values-v26.xml:13:5-16:13: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jail-monkey:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

However when I run assembleDebug everything is going well so I'm not sure what is the issue.

The build runs on a linux Docker image with no cache and which has the latest version of sdk-tools 26.1.1.

From what I've read online, this issue seems to come from appcompat which is not the right version. And the dependency having issue seems to be jail-monkey which hasn't received an update for a few months now.

In my build.gradle, this is some of my dependencies:

implementation project(':react-native-svg')
implementation project(':react-native-config')
implementation project(':jail-monkey')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.android.gms:play-services-base:15.0.0'
implementation 'com.google.android.gms:play-services-base:15.0.0'
implementation 'com.android.support:appcompat-v7:23.0.0'
implementation 'com.facebook.react:react-native:+'

I've tried to set appcompact-v7 with 23, 26, 27 and 28 in my gradle file, none of them worked. Though during the build it seems to use 26.1 from the dependency.

compileSdkVersion 27
buildToolsVersion '27.0.3'

Do you have any idea how I can resolve this issue?

0 Answers
Related