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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

React native 0.72-rc6 android relase error What went wrong: A problem was found with the configuration of task ':app:lintVitalAnalyzeRelease' (type 'AndroidLintAnalysisTask'). #1574

Open
qnit82 opened this issue Dec 2, 2023 · 2 comments

Comments

@qnit82
Copy link

qnit82 commented Dec 2, 2023

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

Today I used patch-package to patch react-native-vector-icons@9.2.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-vector-icons/fonts.gradle b/node_modules/react-native-vector-icons/fonts.gradle
index 5485fac..bff75a2 100644
--- a/node_modules/react-native-vector-icons/fonts.gradle
+++ b/node_modules/react-native-vector-icons/fonts.gradle
@@ -25,7 +25,11 @@ afterEvaluate {
     }
 
     android.applicationVariants.all { def variant ->
-        def targetName = variant.name.capitalize()
+       def targetName = variant.name.capitalize()
+        def lintVitalAnalyzeTask = tasks.findByName("lintVitalAnalyze${targetName}")
+            if (lintVitalAnalyzeTask) {
+                lintVitalAnalyzeTask.dependsOn(fontCopyTask)
+            }
         def generateAssetsTask = tasks.findByName("generate${targetName}Assets")
         generateAssetsTask.dependsOn(fontCopyTask)
     }

This issue body was partially generated by patch-package.

@qnit82
Copy link
Author

qnit82 commented Dec 2, 2023

  • How to fix. Go to Folder /node_modules/react-native-vector-icons -> Open the fonts.gradle file and replace the code inside
    android.applicationVariants.all { def variant -> ....
    become as follows as follows.

afterEvaluate {
.
.
.
android.applicationVariants.all { def variant ->
def targetName = variant.name.capitalize()
def lintVitalAnalyzeTask = tasks.findByName("lintVitalAnalyze${targetName}")
if (lintVitalAnalyzeTask) {
lintVitalAnalyzeTask.dependsOn(fontCopyTask)
}
def generateAssetsTask = tasks.findByName("generate${targetName}Assets")
generateAssetsTask.dependsOn(fontCopyTask)
}

Once done, run the command npx patch-package react-native-vector-icons To fix this error in the package so it won't happen next time

@qnit82 qnit82 changed the title Hi admin. react native 0.72-rc6 android relase error React native 0.72-rc6 android relase error What went wrong: A problem was found with the configuration of task ':app:lintVitalAnalyzeRelease' (type 'AndroidLintAnalysisTask'). Dec 2, 2023
@Vimal1464
Copy link

@qnit82
@tri-bao
To fix this ,follow these step

  1. remove apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle") from android/app/build.gradlew
  2. go to node_modules/react-native-vector-icon/Fonts and copy all the fonts
  3. go to android/app/src/main and create a folder named assets if not exist then inside then assets create one more folder named fonts and paste all the fonts from node_modules/react-native-vector-icon/Fonts to here
  4. now you can use the vector icon as usual and also you can create a build which won't failed

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

2 participants