Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error react-native-loader-kit:verifyReleaseResources #49

Closed
GonzaArts opened this issue Apr 6, 2024 · 10 comments
Closed

Error react-native-loader-kit:verifyReleaseResources #49

GonzaArts opened this issue Apr 6, 2024 · 10 comments

Comments

@GonzaArts
Copy link

I am trying to copy the APK and I get an error from your project which is as follows:

> Task :react-native-loader-kit:verifyReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-loader-kit:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
   > Android resource linking failed

I have tried to change the build.gradle configuration but it still fails

@DarkShtir
Copy link

Same issue

@maitrungduc1410
Copy link
Owner

@DarkShtir which version of RN are you using?

@DarkShtir
Copy link

RN 0.73.7, and last version of react-native-loader-kit

@maitrungduc1410
Copy link
Owner

hi @GonzaArts @DarkShtir on which command are you guys facing this issue?

Just now I tested with these commands, they're all fine:

npx react-native build-android --mode=release
npm run android -- --mode="release"

My env (MacOS M2):

"react": "18.2.0",
"react-native": "0.74.0",
"react-native-loader-kit": "^2.0.8"

@maitrungduc1410
Copy link
Owner

maybe this can help you: yamill/react-native-orientation#396 (comment)

@DarkShtir
Copy link

I'm using fastlane to create builds, and under hood fastlane is using ./gradlew assembleRelease -p command

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-loader-kit/android/build.gradle b/node_modules/react-native-loader-kit/android/build.gradle
index d94248d..fed1ef9 100644
--- a/node_modules/react-native-loader-kit/android/build.gradle
+++ b/node_modules/react-native-loader-kit/android/build.gradle
@@ -18,10 +18,10 @@ def safeExtGet(prop, fallback) {
 }
 
 android {
-    compileSdkVersion safeExtGet('LoaderKit_compileSdkVersion', 30)
+    compileSdkVersion safeExtGet('LoaderKit_compileSdkVersion', 34)
     defaultConfig {
-        minSdkVersion safeExtGet('LoaderKit_minSdkVersion', 16)
-        targetSdkVersion safeExtGet('LoaderKit_targetSdkVersion', 30)
+        minSdkVersion safeExtGet('LoaderKit_minSdkVersion', 26)
+        targetSdkVersion safeExtGet('LoaderKit_targetSdkVersion', 34)
         versionCode 1
         versionName "1.0"

Thanks maitrungduc1410 to link

@maitrungduc1410
Copy link
Owner

maitrungduc1410 commented May 2, 2024

if sdk version is the problem, you can override it in your android/build.gradle > buildscript > ext

buildscript {
    ext {
        LoaderKit_compileSdkVersion = 34
        LoaderKit_minSdkVersion = 26
        LoaderKit_targetSdkVersion = 34
    }

@DarkShtir
Copy link

DarkShtir commented May 2, 2024

Thanks, this is great solution and it's working!
Maybe be useful add this information to troubleshooting article

@maitrungduc1410
Copy link
Owner

Great, I'm gonna add a troubleshoot section in readme

@GonzaArts
Copy link
Author

Reviewing everything I have already tried it and it worked for me too.

Thanks @maitrungduc1410 @DarkShtir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants