I'm trying to build a release version of my app but I'm getting this error:
* What went wrong:
Execution failed for task ':react-native-i18n:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
I already checked the linked libraries, sdk version etc. Did anyone get this error before?
SDK version: 26
Build tools: 26.0.2
same issue I found.
Same issue:
.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/82c908860ce996c856d955d03372efa8/res/values-v26/values-v26.xml:13:5-16:13: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-i18n:verifyReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
Any solution or workaround?
This fix it for me
This usually happen when you are using different compileSDKVersion and BuildToolsVersion in my case i have to change it in the react-native-i18n folder inside the node-modules
Go to node_modules/react-native-i18n/android/build.gradle
Edit the compileSDKVersion and BuildToolsVersion to merge yours in /android/build.gradle
And to @author it will be good to use the constant value in the project like its been done in android/app/build.gradle
for example
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
if possible
Another workaround is to add this in your root build.grade file:
subprojects { subproject ->
afterEvaluate{
if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
}
}
}
}
@gianpaj Thanks , That work better and also prevent touching the library files
Should be fixed in the last version (allowing android SDK versions customization)
@zoontek I upgraded to 2.0.14 and removed the code above (subprojects...), but got the same error message.
I had to add it again to make a build. Note debug builds don't have this issue, only release builds.
Most helpful comment
Another workaround is to add this in your root
build.gradefile: