Build Failed
Run android failed to build with the following error:
Execution failed for task ':react-native-location-enabler:compileDebugKotlin'.
last time i tried to build my project was Thursday and everything was normal.
same for me
Same for me unable to build the project
I'm facing the same issue
Hey guys,
@wcosmas, @abtomar7788 , @shakawy, @wahidshadab
I had the same issue. It appears that everyone has been experiencing build failures while trying to build Android apps starting from November 4th, 2022.
The solution to this failure is to update your react-native version to the latest released patch. React-native has released a new patch from React-native 0.63 and above.
Patches for >= 0.63
Incase you are using any version below 0.63 there is no patch available. But there is a work around.
Fix for older react-native (< 0.63)
You may determine your gradle version by looking in your /android/gradle/wrapper/gradle-wrapper.properties file.
If you are on an older version of react-native (for example 0.63 or earlier) that uses gradle version 6.1 or below, you must use a different workaround as gradle 6.1 does not support exclusiveContent.
Add this in the allprojects area of your android/build.gradle file.
def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
allprojects {
configurations.all {
resolutionStrategy {
// Remove this override in 0.65+, as a proper fix is included in react-native itself.
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}
I hope it works for you too.
@shadabwahidullah worked. Thanks! btw im using RN 0.67
@shakawy as I mentioned above if you are using RN 0.63 or above you should use the latest patch released for that version. In your case, Its more convenient to update your RN version to 0.67.5.
Hello!
Thanks @shadabwahidullah for your solution, unfortunately it didn't work for me, I've already faced this issue with another lib and patched RN before this issue happened.
Any other suggestion?
EDIT
adding:
buildscript {
ext {
kotlinVersion = '1.6.21'
...
solved my problem
@JohnBerd Hello Unfortunately, I have no other suggestions.
I am having the same error. I also followed the Patches link since my RN is 0.70.6 (which I reverted to 0.70.5). But I am still getting issue while build. Any insight?
I am having the same error. I also followed the Patches link since my RN is 0.70.6 (which I reverted to 0.70.5). But I am still getting issue while build. Any insight?
Try this: https://github.com/sashko9807/react-native-location-enabler/commit/65edcb1045672684b07481c3f5b397d52e3a9aa0
I am having the same error. I also followed the Patches link since my RN is 0.70.6 (which I reverted to 0.70.5). But I am still getting issue while build. Any insight?
Didn't work for me .. I tried setting RN version to both 0.70.6 and 0.70.5.
- Keeping RN version to 0.70.6 and applying the patch, I am getting build failed.
- With RN version 0.70.5 and applying the patch, I am getting some version React Native version mismatch error.
Didn't work for me .. I tried setting RN version to both 0.70.6 and 0.70.5.
- Keeping RN version to 0.70.6 and applying the patch, I am getting build failed.
- With RN version 0.70.5 and applying the patch, I am getting some version React Native version mismatch error.
With the change I posted above, I successfully compiled a project using this library on react native versions 0.71.0 and 0.70.6. What is the exact error you receive?
Hello!
Thanks @shadabwahidullah for your solution, unfortunately it didn't work for me, I've already faced this issue with another lib and patched RN before this issue happened.
Any other suggestion?
EDIT
adding:
buildscript { ext { kotlinVersion = '1.6.21' ...solved my problem
Thank you so much for this answer.. I worked perfectly