-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERR_SDK_NOT_FOUND: No valid Android SDK root found. #235
Comments
Did you try using the link from the error? https://github.com/ionic-team/native-run/wiki/Android-Errors |
Yes I did, I have my SDK installed at C:\Program Files (x86)\Android\android-sdk set ANDROID_SDK_ROOT=D:\Android\sdk But any of these are working as expected. |
What worked for me: Reboot. I just set the env variables shortly before. Seems like even after restarting the terminal NodeJs still applies new scripts with the old env variables. |
I am facing the same problem. Do you have the solution right now? |
I also try "npx cap open android" But I set the JAVA_HOME correctly (edit .bashrc file, adding PATH JAVA_HOME="thepathtotheJavaJRE". But still, the problem persist. Anyone got the solution? Many thanks |
I think this is not a bug but a configuration issue. Make sure that Java Home is actually set where you run the command. If you are on windows, make sure to reboot after setting the environment variable. Last one was the reason I had trouble. I think this issue needs to be closed. |
My issues was that native-run expect SDK to live in a very specific place, eg on linux it has to be |
Actually native-run/src/android/utils/sdk/index.ts Line 161 in c6303f2
if your installed Android SDK in folder other than $HOME/Android/sdk, you should set either ANDROID_HOME or ANDROID_SDK_ROOT environment variables to point to your Android SDK folder. try run |
Version:
1.6.0
Description:
I have defined my sdk location using this command on the cmd
set ANDROID_SDK_ROOT=D:\Android\sdk
set ANDROID_HOME=D:\Android\sdk
But any of these are working as expected.
Command Output:
npx capacitor run android --verbose
√ Copying web assets from www to android\app\src\main\assets\public in 1.96s
√ Creating capacitor.config.json in android\app\src\main\assets in 1.53ms
copy android [info] Found 8 Cordova plugins for android:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
√ copy android in 2.09s
√ Updating Android plugins in 7.77ms
[info] Found 5 Capacitor plugins for android:
@capacitor/[email protected]
@capacitor/[email protected]
@capacitor/[email protected]
@capacitor/[email protected]
@capacitor/[email protected]
/ update android [info] Found 8 Cordova plugins for android:
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
√ update android in 240.14ms
[error] native-run failed with error
SDK Info:
ERR_SDK_NOT_FOUND: No valid Android SDK root found.
More details for this error may be available online:
https://github.com/ionic-team/native-run/wiki/Android-Errors
The text was updated successfully, but these errors were encountered: