Open harshOnAndroid opened 5 years ago
No clue - did you figure it out?
I have the same issue:
Task :react-native-shared-group-preferences:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade 1 exception was raised by workers: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed C:\Users\user.gradle\caches\transforms-2\files-2.1\ce0c402438ea724ce7f42dbc3d780e69\appcompat-1.0.2\res\values-v26\values-v26.xml:5:5-8:13: AAPT: error: resource android:attr/colorError not found. C:\Users\user.gradle\caches\transforms-2\files-2.1\ce0c402438ea724ce7f42dbc3d780e69\appcompat-1.0.2\res\values-v26\values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.
I have the same issue too. Any idea?
Not sure. It's working for me on the latest version of RN. Btw, I need to update this library in the next few days. I just realized from some of my users that data isn't being saved to external storage. It was on my test device. Since API 29 (30 is the latest), one of the methods used is deprecated, which is why I am guessing it isn't working on some users' devices.
Ok, I did a bit of research, and I think it has to do with your project using an older build which does not contain some properties. If you're on the latest version of react-native
, then this shouldn't be a problem. But if you're using a significantly older version, this becomes more likely based on using older buildTools, targetSdkVersions, etc... Not quite sure the combination myself, but thats what I got from this thread:
https://github.com/luggit/react-native-config/issues/299
TLDR: Update android build tools/sdk/etc.
I get the same error now when upgrading from RN 0.68 to 0.69. Probably the reverse problem perhaps? That the package needs an update to keep up?
Heading into react-native-shared-group-preferences node_modules folder, updating gradle and minSdkVersion to the same as in my main android project files solved the issue for me!
Here is the new full build.gradle file:
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:7.0.4")
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 31
buildToolsVersion "31.0.0"
defaultConfig {
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
}
lintOptions {
abortOnError false
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.facebook.react:react-native:+'
}
Hope it can help someone else in need
I can confirm DigohD solution works
I am getting no idea at all why release build is failing.
i think something is wrong with this folder-
a lot of files under this folder gets printed in the console. The log doens't even fit in the console.
stacktrace -