- What went wrong:
A problem was found with the configuration of task ‘:app:lintVitalAnalyzeRelease’ (type ‘AndroidLintAnalysisTask’).-
Gradle detected a problem with the following location: ‘C:React-ProjectsEnglish-MuniandroidappbuildintermediatesReactNativeVectorIcons’.
Reason: Task ‘:app:lintVitalAnalyzeRelease’ uses this output
of task ‘:app:copyReactNativeVectorIconFonts’ without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.Possible solutions:
- Declare task ‘:app:copyReactNativeVectorIconFonts’ as an input of ‘:app:lintVitalAnalyzeRelease’.
- Declare an explicit dependency on ‘:app:copyReactNativeVectorIconFonts’ from ‘:app:lintVitalAnalyzeRelease’ using Task#dependsOn.
- Declare an explicit dependency on ‘:app:copyReactNativeVectorIconFonts’ from ‘:app:lintVitalAnalyzeRelease’ using Task#mustRunAfter.
Please refer to https://docs.gradle.org/8.0.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
-
Here is the app/build.gradle file
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
import com.android.build.OutputFile
android {
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion
namespace "com.englishmuni"
defaultConfig {
applicationId "com.englishmuni"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 36
versionName "1.0.32"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED",
isNewArchitectureEnabled().toString()
multiDexEnabled true
}
}
}
dependencies {
implementation project(':react-native-vector-icons')
}
apply from: file("../../node_modules/@react-native-community/cli-platform-
android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
2
Answers
Here is the simpler patch that works for variants on RN 0.72,for vector icons. You have to replace these lines in
/node_modules/react-native-vector-icons/fonts.gradle
then patch the package.
npx patch-package react-native-vector-icons
The solution provided above worked for me after looking for possible solution and spending hours.
I added below lines in /node_modules/react-native-vector-icons/fonts.gradle:
and then I tried npx patch-package react-native-vector-icons in terminal:
and cd android
./gradlew assembleRelease
and Boom! it worked!