1
votes

My React-Native application suddenly stopped working when I installed and tried to import react-native-vector-icons module (even though I do not make any connection with the problem).

It seems that my AVD failed miserably. I had problems with ADB seemingly not working anymore but I guess I solved them. Afterwards, I started getting errors from SDK licenses, being informed that I did not accept them. I used sdkmanager.bat, and accepted all of them. On running npm run android I was receiving the same error. Seemingly, even though the licenses were accepted, the folder containing them was not where it was searched for (Android\Sdk\platform-tools\licenses). So I copied it there.

Next time, the licenses were accepted, but I get this error that says the SDKs cannot be downloaded because the folders already exist (I do not understand why I have to download the SDK AGAIN, anyway). I go on and delete all conflicting folders just to run the command again, the CLI starts downloading (I guess) and making the folders I have deleted just so that immediately after I am again informed that the folders exist.

My best guess (and I'm probably wrong) is that while resolving ADB / license conflicts, somehow I messed up the Path Variables. I changed them 100 times anyway, one step away from backtracking the shit out of them.

I deleted all Android folders, Android Studio, SDK's, started everything all over again just to get back to this point. I've wasted 8 hours. Please, give me a hand.

Running on Marshmallow 23.0.1 ofc.

Thank you in advance!

npm run android

[email protected] android D:\Work\reactn-naturist react-native
run-android

Scanning folders for symlinks in D:\Work\reactn-naturist\node_modules
(20ms) JS server already running. Building and installing the app on
the device (cd android && gradlew.bat installDebug)... Observed
package id 'platform-tools' in inconsistent location
'C:\Users\alexandru.andronache\AppData\Local\Android\Sdk\platform-tools'
(Expected
'C:\Users\alexandru.andronache\AppData\Local\Android\Sdk\platform-tools\platform-tools')
Observed package id 'platform-tools' in inconsistent location
'C:\Users\alexandru.andronache\AppData\Local\Android\Sdk\platform-tools'
(Expected
'C:\Users\alexandru.andronache\AppData\Local\Android\Sdk\platform-tools\platform-tools')
Observed package id 'platform-tools' in inconsistent location
'C:\Users\alexandru.andronache\AppData\Local\Android\Sdk\platform-tools'
(Expected
'C:\Users\alexandru.andronache\AppData\Local\Android\Sdk\platform-tools\platform-tools')
File C:\Users\alexandru.andronache\.android\repositories.cfg could not
be loaded. Checking the license for package Android SDK Build-Tools
23.0.1 in C:\Users\alexandru.andronache\AppData\Local\Android\Sdk\platform-tools\licenses
License for package Android SDK Build-Tools 23.0.1 accepted. Preparing
"Install Android SDK Build-Tools 23.0.1". Warning: Trying to install
into
C:\Users\alexandru.andronache\AppData\Local\Android\sdk\platform-tools\build-tools\23.0.1\
but package "Android SDK Platform-Tools" already exists at
C:\Users\alexandru.andronache\AppData\Local\Android\sdk\platform-tools\.
It must be deleted or moved away before installing into a child
directory. Checking the license for package Android SDK Platform 23 in
C:\Users\alexandru.andronache\AppData\Local\Android\Sdk\platform-tools\licenses
License for package Android SDK Platform 23 accepted. Preparing
"Install Android SDK Platform 23". Warning: Trying to install into
C:\Users\alexandru.andronache\AppData\Local\Android\sdk\platform-tools\platforms\android-23\
but package "Android SDK Platform-Tools" already exists at
C:\Users\alexandru.andronache\AppData\Local\Android\sdk\platform-tools\.
It must be deleted or moved away before installing into a child
directory.

FAILURE: Build failed with an exception.

* What went wrong: A problem occurred configuring project ':app'.
Failed to install the following SDK components:   [Android SDK Platform 23, Android SDK Build-Tools 23.0.1]   Please install the
missing components using the SDK manager in Android Studio.

* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.505 secs Could not install the app on the device, read
the error above for details. Make sure you have an Android emulator
running or a device connected and have set up your Android development
environment:
https://facebook.github.io/react-native/docs/android-setup.html

My PATH variables:

enter image description here

P.S. I read all other similar posts and couldn't manage anything. Just getting from error to error.

1
Did you ever figure out a solution to this? I am having the exact same problem and have done the exact same troubleshooting steps as you did - Russ Wilkie
nope. i just let it go. - Andu
Thanks for the response. I found my issue had something to do with my Path and Android_Home variables not being set correctly. It was not pointing to my \sdk path, rather a directory inside the \sdk path. Guess doing that was causing it to not point to the licenses - Russ Wilkie

1 Answers

0
votes

in your Android Studio go to the SDK manager and then click the Show Package Details.

Try to install these sdk packages:

enter image description here

These worked for me.

If still not work add to the path variable the /platform-tools (same path as /tools)