skip to Main Content

cant create app successful

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’.

Could not determine the dependencies of null.
SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project’s local properties file at ‘C:UsersHPAndroidStudioProjectsnewappandroidlocal.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.

BUILD FAILED in 8s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ‘:app:compileDebugJavaWithJavac’. > Could not determine the dependencies of null. > SDK location not found. Define a valid SDK location with an ANDROID_HOME environment variable or by setting the sdk.dir path in your project’s local properties file at ‘C:UsersHPAndroidStudioProjectsnewappandroidlocal.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. BUILD FAILED in 8s.
info Run CLI with –verbose flag for more details.

2

Answers


  1. your config ins’t good, you should follow this => https://reactnative.dev/docs/environment-setup?os=windows&platform=android

    Hope this help.

    Login or Signup to reply.
  2.     Step 1. Go to the top of File Explorer and open drop-down
        Step 2. Now go to View > Hidden Items
        
        Add ANDROID_HOME to the Environment Variables if this doesn't work. Select Environment Variables -> System Properties -> Add Variable -> Enter Variable Name and Value.
        Step 1. Open System Properties
        Step 2. Select New and Insert Variable and Location
        Step 3. Add Variable name: ANDROID_HOME and value: as your SDK path.
        If your path is something else not in C Drive you have to add that. Make sure you enter the correct path UserName below is the name of your PC. and press OK.
        
        Now check the SDK location in your Android Studio and follow these steps.
        
        Step 1. Go to the FILE > SETTINGS
        Step 2. Search for SDK and place your SDK LOCATION.
    
    Please take the actions listed below:
    
    Navigate first to the android directory and then to your react-native project. Make a file called something like this:
    local.real estate
    
    Launch the file and enter the path to your Android SDK as shown below:
    For those who utilise Windows:
    
    sdk.dir=C:\Users\UserName\AppData\Local\Android\sdk or (in IntelliJ IDEA/Android Studio versions more recent than a certain one):
    
    Where USERNAME is your PC user name, and sdk.dir=C:\Users\USERNAME\AppData\Local\Android\sdk. Verify that the folder is sdk or Sdk as well.
    
    For instance:
    
    The path to the SDK is C:\Users\USERNAME\AppData\Local\Android\sdk.
    
    C:\Users\USERNAME\AppData\Local\Android\sdk.dir=CSdk for Mac users:
    
    /Users/USERNAME/Library/Android/sdk as sdk.dir
    where your OSX username is USERNAME.
    
    For users of Linux (Ubuntu):
    
    = /home/USERNAME/Android/Sdk; sdk.dir
    where USERNAME is your Linux username (note that S in Sdk must match in case because Linux paths are case-sensitive).
    
    Add the ANDROID_HOME variable to "Environment Variables" with the path C:UsersUSERAppDataLocalAndroidSdk if this doesn't work.
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search