I'm doing crossplatform app for mobile devices in react-native. And when I try to create release APK it fails with error:
> Task :app:prepareLintJar UP-TO-DATE
> Task :app:mainApkListPersistenceRelease UP-TO-DATE
> Task :app:bundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Failed to capture snapshot of input files for task
':app:bundleReleaseJsAndAssets' property '$1' during up-to-date check.
> Failed to create MD5 hash for file
'/Users/developer/dummy_app/.buckd/sock' as it does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
24 actionable tasks: 1 executed, 23 up-to-date
2:16:52 AM: Task execution finished 'assembleRelease'.
I consider solving a similar problem, like, deleting .buckd/sock file from root folder and invalidatecache/restart, but didn't help!
I had the exact same issue here with Buck
After deleting the whole .buckd folder, the Task :app:bundleReleaseJsAndAssets passed successfully after !
Hope this could help someone !
Related
i got my react native app error after i installed react-navigation-drawer. please help
comand: npm run android
> Task :app:checkDebugAarMetadata FAILED
7 actionable tasks: 2 executed, 5 up-to-date
[..................] / : timing config:load:flatten Completed in 3ms
FAILURE: Build failed with an exception.
[..................] / : timing config:load:flatten Completed in 3ms
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform react-native-reanimated-65-jsc.aar (project :react-native-reanimated) to match attributes {artifactType=android-aar-metadata}.
> Execution failed for JetifyTransform: /home/risman/drive/android/project/POS/node_modules/react-native-reanimated/android/react-native-reanimated-65-jsc.aar.
> Transform's input file does not exist: /home/risman/drive/android/project/POS/node_modules/react-native-reanimated/android/react-native-reanimated-65-jsc.aar. (See https://issuetracker.google.com/issues/158753935)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform react-native-reanimated-65-jsc.aar (project :react-native-reanimated) to match attributes {artifactType=android-aar-metadata}.
> Execution failed for JetifyTransform: /home/risman/drive/android/project/POS/node_modules/react-native-reanimated/android/react-native-reanimated-65-jsc.aar.
> Transform's input file does not exist: /home/risman/drive/android/project/POS/node_modules/react-native-reanimated/android/react-native-reanimated-65-jsc.aar. (See https://issuetracker.google.com/issues/158753935)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
at makeError (/home/risman/drive/android/project/POS/node_modules/#react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
at /home/risman/drive/android/project/POS/node_modules/#react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (/home/risman/drive/android/project/POS/node_modules/#react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:106:5)
at async Command.handleAction (/home/risman/drive/android/project/POS/node_modules/#react-native-community/cli/build/index.js:186:9)
I followed how to install react-navigation-drawer on the official documentation on installation guide
I was following the tutorial from Setting up the development environment configuring the React Native CLI Quickstart of Windows and Android.
Whenever I run the command react-native run-android Metro starts in another CMD and Android Studios opens up, but this error appears in the original CMD.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
(node:12644) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
Jetifier found 896 file(s) to forward-jetify. Using 12 workers...
info Starting JS server...
info Launching emulator...
info Successfully launched emulator.
info Installing the app...
> Task :app:processDebugMainManifest FAILED
Error 'C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\outputs\logs\manifest-merger-debug-report.txt (Access is denied)' while writing the merger report file, build can continue but merging activities will not be documented
11 actionable tasks: 2 executed, 9 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> java.io.FileNotFoundException: C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\intermediates\manifest_merge_blame_file\debug\manifest-merger-blame-debug-report.txt (Access is denied)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> java.io.FileNotFoundException: C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\intermediates\manifest_merge_blame_file\debug\manifest-merger-blame-debug-report.txt (Access is denied)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
at makeError (C:\Users\xrafa\Documents\Android\AwesomeProject\node_modules\execa\index.js:174:9)
at C:\Users\xrafa\Documents\Android\AwesomeProject\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (C:\Users\xrafa\Documents\Android\AwesomeProject\node_modules\#react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:5)
at async Command.handleAction (C:\Users\xrafa\Documents\Android\AwesomeProject\node_modules\#react-native-community\cli\build\index.js:186:9)
info Run CLI with --verbose flag for more details.
I used this post and the answer as a reference because I thought it was similar, but I got a similar error from what I got before.
> Task :app:processDebugMainManifest FAILED
Error 'C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\outputs\logs\manifest-merger-debug-report.txt (Access is denied)' while writing the merger report file, build can continue but merging activities will not be documented
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> java.io.FileNotFoundException: C:\Users\xrafa\Documents\Android\AwesomeProject\android\app\build\intermediates\manifest_merge_blame_file\debug\manifest-merger-blame-debug-report.txt (Access is denied)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
11 actionable tasks: 2 executed, 9 up-to-date
I also want to say that I already ran the command gradlew clean and same error.
Is there something wrong with the gradlew.bat?
It's mentioning as access denied, try to change permission to android folder and see.
Whenever I run it it get stuck in android. This happened to me locally and I solve it doing flutter clean, which I don't know how to do in codemagic. The problem is that is nos building, heres the log.
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> java.net.URISyntaxException: Illegal character in opaque part at index 2: C:\\Users\\thech\\Downloads\\nueva_temporada-20210514T040146Z-001\\nueva_temporada\\build\\app\\intermediates\\flutter\\debug\\flutter_assets\\AssetManifest.json
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 30s
Running Gradle task 'assembleDebug'... 31.3s
Gradle task assembleDebug failed with exit code 1
Build failed :|
Failed to build for Android
any chance you have hardcoded path in your build.gradle or somewhere else? C:\\Users is not a valid path on Codemagic builder machines because it uses macOS or Linux
> Task :app:bundleReleaseJsAndAssets FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'npx.cmd'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 33s
1 actionable task: 1 executed
It seems it's a problem with your build.gradle version at root :
1-Open Android Studio
2-Open the android folder of you project
3-android studio will upgrade the gradle version automatically (make sure it does)
4-try again to generate apk
What I do:
> export FIREBASE_TOKEN=***
> export GOOGLE_APPLICATION_CREDENTIALS=/home/MyProject/app/serviceCredentialsFile.json
> ./gradlew --stop
> ./gradlew assembleDebug appDistributionUploadDebug
Result:
> Task :app:appDistributionUploadDebug FAILED
Found APK at /home/MyProject/app/build/outputs/apk/debug/debug.apk.
Uploading APK to Firebase App Distribution...
Getting appId from output of google services plugin
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:appDistributionUploadDebug'.
> App Distribution failed to fetch app information: [403] The caller does not have permission
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
190 actionable tasks: 2 executed, 188 up-to-date
How to resolve it