-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Android: Release build fails with React Native 0.72.6 #1564
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
Comments
I found this possible solution on https://stackoverflow.com/a/76658738 |
Thanks for @VincentSastra providing the solution here: #1508 (comment) And I created a post-install script to automate this, here is my code /* package.json */
...
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest",
+ "postinstall": "node scripts/react-native-vector-icons.mjs"
},
... /* scripts/react-native-vector-icons.mjs */
import { readFileSync, writeFileSync } from 'node:fs'
import { resolve } from 'node:path'
const fontGradlePath = resolve('node_modules/react-native-vector-icons/fonts.gradle')
const fontGradle = readFileSync(fontGradlePath, { encoding: 'utf-8' })
const appendTask = `
def lintAnalyzeTask = tasks.findByName("lintAnalyze\${targetName}")
lintAnalyzeTask?.dependsOn(fontCopyTask)
`
const dependsOnStr = '.dependsOn(fontCopyTask)'
const firstLine = appendTask.split('\n').filter((it) => it)[0]
if (!fontGradle.includes(firstLine)) {
const insertPosition =
fontGradle.lastIndexOf(dependsOnStr) + dependsOnStr.length
const newfontGradle = [
fontGradle.slice(0, insertPosition),
appendTask,
fontGradle.slice(insertPosition)
].join('\n')
writeFileSync(fontGradlePath, newfontGradle, { encoding: 'utf-8' })
} |
I suspect this is related to #1534 I'd like to put this to bed once and for all, but I'm not experiencing this my project using RNVI on android. Is someone able to provide a reproducible example repository? |
Do you found any solution? |
Closing as this should be fixed in the latest release |
Environment
Android
react-native: 0.72.6
react-native-vector-icons: ^10.0.1
Description
While building the app in AppCenter, the build fails with the following message:
FAILURE: Build failed with an exception.
What went wrong:
A problem was found with the configuration of task ':app:lintAnalyzeRelease' (type 'AndroidLintAnalysisTask').
Gradle detected a problem with the following location: '/Users/runner/work/1/s/android/app/build/intermediates/ReactNativeVectorIcons'.
Reason: Task ':app:lintAnalyzeRelease' 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:
Please refer to https://docs.gradle.org/8.0.1/***guide/validation_problems.html#implicit_dependency for more details about this problem.
Try:
BUILD FAILED in 23m 57s
Any idea why is this happening?
The text was updated successfully, but these errors were encountered: