npx expo run:android not wokring on m1 mac - android

So I have ejected an expo app to a normal react native app. The IOS version of the app is working fine. But I can't seem to start the android version.
I am getting this error log:
› Skipping dev server
› Building app...
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':react-native-gradle-plugin'.
> Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository().
> Failed to create parent directory '/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/react-native-gradle-plugin/.gradle' when creating directory '/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/react-native-gradle-plugin/.gradle/buildOutputCleanup'
* 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: /Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/android/gradlew exited with non-zero code: 1
Error: /Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/android/gradlew exited with non-zero code: 1
at ChildProcess.completionListener (/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/#expo/spawn-async/build/spawnAsync.js:52:23)
at Object.onceWrapper (node:events:642:26)
at ChildProcess.emit (node:events:527:28)
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
...
at Object.spawnAsync [as default] (/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/#expo/spawn-async/build/spawnAsync.js:17:21)
at spawnGradleAsync (/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/#expo/cli/build/src/start/platforms/android/gradle.js:72:46)
at Object.assembleAsync (/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/#expo/cli/build/src/start/platforms/android/gradle.js:52:18)
at runAndroidAsync (/Users/moemenhussein/Documents/Projects/ahmo/restart-lifestyle/restart-lifestyle/node_modules/#expo/cli/build/src/run/android/runAndroidAsync.js:31:24)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
I have already removed my package-lock.json, node_module etc. I really do not know what to do.

Related

React Native android emulator doesn't working

`> helloworld#1.0.0 android
expo run:android
› Opening emulator Pixel_4_XL
› Building app...
Picked up _JAVA_OPTIONS: -Xmx512M
Configuration on demand is an incubating feature.
FAILURE: Build failed with an exception.
Where:
Settings file 'C:\Users\oktay\OneDrive\Masa³st³\React-Native\HelloWorld\android\settings.gradle' line: 3
What went wrong:
A problem occurred evaluating settings 'HelloWorld'.
Could not read script 'C:\Users\oktay\OneDrive\Masa├â•st├â•\React-Native\HelloWorld\node_modules\expo\scripts\autolinking.gradle' 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
BU¦LD FAILED in 2s
Error: C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\android\gradlew.bat exited with non-zero code: 1
Error: C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\android\gradlew.bat exited with non-zero code: 1
at ChildProcess.completionListener (C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\node_modules\#expo\spawn-async\build\spawnAsync.js:52:23)
at Object.onceWrapper (node:events:628:26)
at ChildProcess.emit (node:events:513:28)
at ChildProcess.cp.emit (C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (node:internal/child_process:1100:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
...
at Object.spawnAsync [as default] (C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\node_modules\#expo\spawn-async\build\spawnAsync.js:17:21)
at spawnGradleAsync (C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\node_modules\#expo\cli\build\src\start\platforms\android\gradle.js:72:46)
at Object.assembleAsync (C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\node_modules\#expo\cli\build\src\start\platforms\android\gradle.js:52:18)
at runAndroidAsync (C:\Users\oktay\OneDrive\Masaüstü\React-Native\HelloWorld\node_modules\#expo\cli\build\src\run\android\runAndroidAsync.js:31:24)
at processTicksAndRejections (node:internal/process/task_queues:96:5)`
I'm running it, but the android emulator is causing problems. I am using mobile phone this post sorry for mistakes.

Ionic pending apk building

The project is made with ionic 3, when I try to generate the apk I get this error, I don't know what approach to use to deal with this problem please I need your help. Here is the error I get, I tried several alternatives but no success, the version of graddle is there 7.1
> Task :app:checkReleaseAarMetadata FAILED
> Task :app:bundleReleaseResources FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkReleaseAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
> The minCompileSdk (33) specified in a
dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
is greater than this module's compileSdkVersion (android-28).
Dependency: androidx.appcompat:appcompat-resources:1.6.0-rc01.
AAR metadata file: /home/roosvelt/.gradle/caches/transforms-3/2166b563575881abf26d682bf5e7b40b/transformed/jetified-appcompat-resources-1.6.0-rc01/META-INF/com/android/build/gradle/aar-metadata.properties.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:bundleReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.Aapt2ProcessResourcesRunnable
> Android resource linking failed
ERROR:/home/roosvelt/.gradle/caches/transforms-3/8e2876a9a5ebb578738285d001baa267/transformed/core-1.9.0/res/values/values.xml:104:5-113:25: AAPT: error: resource android:attr/lStar not found.
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 41s
25 actionable tasks: 25 executed
Command failed with exit code 1: /home/roosvelt/Documents/Dev/Perso/freevigile-master/platforms/android/gradlew :app:bundleRelease -b /home/roosvelt/Documents/Dev/Perso/freevigile-master/platforms/android/build.gradle
Error: Command failed with exit code 1: /home/roosvelt/Documents/Dev/Perso/freevigile-master/platforms/android/gradlew :app:bundleRelease -b /home/roosvelt/Documents/Dev/Perso/freevigile-master/platforms/android/build.gradle
at makeError (/home/roosvelt/Documents/Dev/Perso/freevigile-master/node_modules/cordova-android/node_modules/execa/lib/error.js:60:11)
at handlePromise (/home/roosvelt/Documents/Dev/Perso/freevigile-master/node_modules/cordova-android/node_modules/execa/index.js:118:26)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async ProjectBuilder.build (/home/roosvelt/Documents/Dev/Perso/freevigile-master/node_modules/cordova-android/lib/builders/ProjectBuilder.js:316:20)
[ERROR] An error occurred while running subprocess cordova.
cordova build android --release --verbose exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms
ionic:utils-process onBeforeExit handler: running 2 functions +0ms
ionic:utils-process processExit: exiting (exit code: 1) +268ms

Can't start react-native as app:processDebugMainManifest FAILED

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.

ReactNative error: Execution failed for task ':react-native-reanimated:checkDebugManifest'

I started to work on a react native project. But I have a problem now. I built a simple project and execute react-native run-android. But error occurred.
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 954 file(s) to forward-jetify. Using 6 workers...
info Starting JS server...
info Installing the app...
> Task :app:createDebugCompatibleScreenManifests FAILED
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings
40 actionable tasks: 12 executed, 28 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:createDebugCompatibleScreenManifests'.
> Failed to create directory 'E:\web_project\fcManager\app\svn_prj\02_source\fcmanager\android\app\build\intermediates\compatible_screen_manifest\debug\createDebugCompatibleScreenManifests\out'
* 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
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run
CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:createDebugCompatibleScreenManifests'.
> Failed to create directory 'E:\web_project\fcManager\app\svn_prj\02_source\fcmanager\android\app\build\intermediates\compatible_screen_manifest\debug\createDebugCompatibleScreenManifests\out'
* 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
And then I cleared the cache by yarn start --reset-cache, and execute again react-native run-android. Error again. But the latter errors are different from the former errors.
What could be a problem?
Wow. I solve the problem.
>cd android
android>./gradlew clean
And then apk is successfully installed on the emulator.

Cordova build android error: Could not resolve com.github.scottyab:rootbeer:0.0.7 on vs 2017 azure devops agent

​Hi,
On azure devops vs2017 agent, since 26th september 2019, my cordova build android command in the build pipeline is failing with error
Task :app:preReleaseBuild FAILED
Task :CordovaLib:generateReleaseRFile
10 actionable tasks: 10 executed FAILURE: Build failed with an
exception.
What went wrong: Could not resolve all files for configuration ':app:releaseCompileClasspath'.
Could not resolve com.github.scottyab:rootbeer:0.0.7. Required by:
project :app
Skipped due to earlier error
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 2m 26s { Error:
d:\a\1\s\p\src\phone\platforms\android\gradlew: Command failed with
exit code 1 Error output: Removing ant.properties update hook FAILURE:
Build failed with an exception.
What went wrong: Could not resolve all files for configuration ':app:releaseCompileClasspath'.
Could not resolve com.github.scottyab:rootbeer:0.0.7. Required by:
project :app
Skipped due to earlier error
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 2m 26s
at ChildProcess.whenDone (d:\a\1\s\p\src\phone\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:135:23)
at ChildProcess.emit (events.js:198:13)
at ChildProcess.cp.emit (d:\a\1\s\p\src\phone\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
The latest version uses gradle 5.6.2 but my last successful build used gradle 5.6. I even uninstalled gradle 5.6.2 from build agent and installed 5.6 using chocolatey task but its still failing with the same error. Not sure what else has changed on the build agent. Code is the same. Anyone has seen a similar issue?
Temporary workaround was to remove cordova-plugin-iroot plugin which was using rootbeer packages. This did resolve the build errors. We still need to find a permanent solution for this or unless cordova upgrades their azure devops tasks version and uses an updated version of gradle. currently its using gradle 4.10.3

Categories

Resources