Rahul Kumar Choudhary
Rahul Kumar Choudhary

Reputation: 41

React-native npm run android fails with following command on Mac m1

React-native npm run android fails with following command on Mac m1

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.

**.zshrc

export ANDROID_HOME=$HOME/Library/Android/sdk  
export PATH=$PATH:$ANDROID_HOME/emulator  
export PATH=$PATH:$ANDROID_HOME/tools  
export PATH=$PATH:$ANDROID_HOME/tools/bin   
export PATH=$PATH:$ANDROID_HOME/platform-tools  
export PATH=/opt/homebrew/bin:$PATH  
export JAVA_HOME="/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home"**

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Multiple task action failures occurred:
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.1.0-6503028-osx Daemon #1: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.1.0-6503028-osx Daemon #0: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.1.0-6503028-osx Daemon #2: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.1.0-6503028-osx Daemon #4: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.1.0-6503028-osx Daemon #3: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.1.0-6503028-osx Daemon #5: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.1.0-6503028-osx Daemon #6: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.
   > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
      > AAPT2 aapt2-4.1.0-6503028-osx Daemon #7: Daemon startup failed
        This should not happen under normal circumstances, please file an issue if it does.

Upvotes: 1

Views: 1145

Answers (1)

After installing emulator and setting up development environment, Run this command before Creating new project on m1 chip MacBook sudo arch -x86_64 gem install ffi

I had same problem in my macbook air M1 and this command solved it thanks

Upvotes: 2

Related Questions