4
votes

I build a project in react-native and it works fine on my computer, but after change its location the problem starts to happen. I installed the package using "yarn add @react-native-community/async-storage"

I tried to npm install, re-install the component with yarm, and others.

"dependencies": {
    "@react-native-community/async-storage": "^1.4.2",
    "react": "16.8.3",
    "react-native": "0.59.9",
    "react-native-vector-icons": "^6.5.0",
    "react-redux": "^7.1.0",
    "redux": "^4.0.1"
},

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring project ':@react-native-community_async-storage'.

    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 '/Users/matheus/Desktop/TicTaeToe/android/local.properties'.

2
stackoverflow.com/a/37002256/5027899. Have you tried this answer?Fatih Aktaş

2 Answers

1
votes

create a file in the android folder called local.properties

In this file write the path to your sdk, example: sdk.dir=C:\Users\ialluego\AppData\Local\Android\Sdk

0
votes

Basically its like You are building an apk without sdk , android sdk is required to build an app in react native and sdk`s path is located inside your system somewhere like

C:\Users\NameOFYourSystem\AppData\Local\Android\Sdk

So to do this you can create local.properties file in android folder of your app and map the sdk.dir= above path

thats it all it needs one line in locaal.properties