0
votes

Create android/app/src/main/assets/ this folder

#react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/

#cd android && ./gradlew assembleDebug

run this command but i got the error

============================================================================================= FAILURE: Build failed with an exception.

  • Where: Build file '/var/www/html/reactNative/wurthA/node_modules/react-native-reanimated/android/build.gradle' line: 89

  • What went wrong: A problem occurred configuring project ':react-native-reanimated'.

SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/var/www/html/reactNative/wurthA/android/local.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.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings =============================================================================================enter image description here

1
Have a try by opening the project in the android studio and run - Jignesh Mayani
No i am not install android studio . i am running project using expo web browser and tunnel - kshamata
if you are using expo the how can you run react native commands ? - Jignesh Mayani

1 Answers

0
votes

You need to install an Android SDK and point to it in ANDROID_SDK_ROOT environment variable. More details here https://gist.github.com/venkateshshukla/9736261

SDK - Software Development Kit
    a. Download android sdk tools from 
       http://developer.android.com/sdk/index.html
    b. Extract it to a directory say android_sdk
    c. Set the environment variable ANDROID_SDK_ROOT to point to android_sdk
    d. Add the directories android_sdk/tools and android_sdk/platform-tools
       to your path
NDK - Native Development Kit
    a. Download android ndk tools from
       http://developer.android.com/tools/sdk/ndk/index.html 
    b. Extract is to a directory say android_ndk
    c. Set the environment variable ANDROID_NDK_ROOT to point to android_ndk
    d. Add the directories android_ndk to your path

For linux systems the environment and path can be set by adding the 
following lines to ~/.bashrc file

export ANDROID_SDK_ROOT=/path/to/android_sdk
export ANDROID_NDK_ROOT=/path/to/android_ndk
export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
export PATH=$PATH:$ANDROID_SDK_ROOT/tools
export PATH=$PATH:$ANDROID_NDK