-
Notifications
You must be signed in to change notification settings - Fork 23
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
native-run
can't find my installed SDK Platforms
#244
Comments
is anybody able to shed some light on this one..? I've also just updated to I have checked the Android Errors wiki page, and I do indeed have the necessary SDK Platforms installed (matching both "target" and "minimum" SDK API values), along with numerous others in between. I've also tried with only a small subset of SDK Platforms, keeping only the "target" API level, but that still made no difference. so I'm currently stuck with what on earth is broken here...? I'm so confused. |
native-run
can't find my installed API levelsnative-run
can't find my installed SDK Platforms
I think I've worked out what's going wrong here.. this is failing because I confirmed this by cloning this project, linking it globally in my dev environment, and replacing the native-run/src/android/utils/sdk/index.ts Line 77 in 664726d
scoop installed my Android SDK to. this worked exactly as expected:
❯ npx native-run android --sdk-info --verbose
native-run:android:utils:sdk:resolveSDKRoot Looking for $ANDROID_HOME +0ms
native-run:android:utils:sdk:resolveSDKRoot Using $ANDROID_HOME at C:\Users\agreeff.NORTECHZA\scoop\apps\android-sdk\current +5ms
native-run:android:utils:sdk:resolveEmulatorHome Looking for $ANDROID_EMULATOR_HOME +0ms
native-run:android:utils:sdk:resolveEmulatorHome Looking at $HOME/.android +1ms
native-run:android:utils:sdk:resolveEmulatorHome Using $HOME/.android/ at C:\Users\agreeff.NORTECHZA\.android +0ms
native-run:android:utils:sdk:resolveAVDHome Looking for $ANDROID_AVD_HOME +0ms
native-run:android:utils:sdk:resolveAVDHome Looking at $HOME/.android/avd +0ms
native-run:android:utils:sdk:resolveAVDHome Using $HOME/.android/avd/ at C:\Users\agreeff.NORTECHZA\.android\avd +0ms
native-run:android:utils:sdk:findAllSDKPackages Walking C:\Users\agreeff.NORTECHZA\scoop\apps\android-sdk\current to discover SDK packages +0ms
native-run:android:utils:sdk:findAllSDKPackages [HACK]: ignoring "sdk.root" in favour of non-symlinked path of "C:\Users\agreeff.NORTECHZA\scoop\apps\android-sdk\4333796" +0ms
native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\agreeff.NORTECHZA\scoop\apps\android-sdk\4333796\emulator\package.xml +0ms
native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\agreeff.NORTECHZA\scoop\apps\android-sdk\4333796\platform-tools\package.xml +0ms
native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\agreeff.NORTECHZA\scoop\apps\android-sdk\4333796\tools\package.xml +0ms
native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\agreeff.NORTECHZA\scoop\apps\android-sdk\4333796\add-ons\addon-google_apis-google-22\package.xml +0ms
native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\agreeff.NORTECHZA\scoop\apps\android-sdk\4333796\add-ons\addon-google_apis-google-23\package.xml +0ms
native-run:android:utils:sdk:getSDKPackage Parsing C:\Users\agreeff.NORTECHZA\scoop\apps\android-sdk\4333796\add-ons\addon-google_apis-google-24\package.xml +0ms
native-run:android:utils:sdk:api:getAPILevels Discovered installed API Levels: [
native-run:android:utils:sdk:api:getAPILevels {
native-run:android:utils:sdk:api:getAPILevels apiLevel: '24',
native-run:android:utils:sdk:api:getAPILevels packages: [ 'add-ons;addon-google_apis-google-24' ]
native-run:android:utils:sdk:api:getAPILevels },
native-run:android:utils:sdk:api:getAPILevels {
native-run:android:utils:sdk:api:getAPILevels apiLevel: '23',
native-run:android:utils:sdk:api:getAPILevels packages: [ 'add-ons;addon-google_apis-google-23' ]
native-run:android:utils:sdk:api:getAPILevels },
native-run:android:utils:sdk:api:getAPILevels {
native-run:android:utils:sdk:api:getAPILevels apiLevel: '22',
native-run:android:utils:sdk:api:getAPILevels packages: [ 'add-ons;addon-google_apis-google-22' ]
native-run:android:utils:sdk:api:getAPILevels }
native-run:android:utils:sdk:api:getAPILevels ] +0ms
SDK Location: C:\Users\agreeff.NORTECHZA\scoop\apps\android-sdk\current
AVD Home: C:\Users\agreeff.NORTECHZA\.android\avd
API Level: 24
Packages: Google APIs add-ons;addon-google_apis-google-24 1
(!) Missing Packages: Android SDK Platform 24 platforms;android-24
Google Play Intel x86 Atom System Image system-images;android-24;google_apis_playstore;x86 /.+/
API Level: 23
Packages: Google APIs add-ons;addon-google_apis-google-23 1
API Level: 22
Packages: Google APIs add-ons;addon-google_apis-google-22 1
Tools:
Android Emulator emulator 31.3.10
Android SDK Platform-Tools platform-tools 33.0.3
Android SDK Tools 26.1.1 tools 26.1.1 pretty sure I can fix this one, so I'll get it working on my side and send a PR shortly. |
…path` this closes ionic-team#244, as it allows `native-run` to function as designed when various aspects of the Android SDK installation are referenced by symbolic links instead of real folder paths.
so here's an interesting one, although the PR I sent for this does work, it seems there are some other problems cropping up.. I'm not sure if this is also related to the use of symlinks though. I highly doubt my changes here would have affected this. could I ask someone who doesn't have my "environment symlink" issues to perhaps try this one? reading my environment SDK installation details, I only see the following output:
meanwhile...
|
NOTE: I've opted to simply replace my Scoop-based installations of Android Studio and the Android SDK with those from the official installer.. I have project deadlines coming up and I don't have time right now to dig too much further into this one. I would like to come back to this when I can, because I believe it is something worth catering for. with that said, if anybody in "Team Ionic" feel like closing this off, or taking over what I started, feel free to do so.. I'll leave this issue open for the moment. edit: just had another thought.. perhaps I should rather close this issue in favour of a new one, collating relevant information from my investigations into the symlink handling issue, titled and structured appropriately for that task. open to suggestions. |
I'm trying to get started with Ionic, but so far I had no luck at all. I'm trying to get it working in WSL Ubuntu. To get the SDK, I installed Android Studio. It obviously has installed all the latest stuff by default, but I haven't read anything regarding incompatibilities of ionic with the latest SDK. Yet I'm running into
This is my output of
I can't get any meaningful information out of anything that would indicate what is missing. One thing I had to do previously, as Ionic is not compatible with Yarn Berry was patching the cli ionic-team/ionic-cli#4483 but otherwise it's a fresh installation. I'd appreciate any help |
@mklueh FWIW, my particular problem was caused by the symbolic links created by the Scoop installer. switching over to the "standard" ways of installing the relevant tools resolved the issue for me. going by the SDK and AVD paths in your environment, I would hazard a guess and say that you're not using any fancy third-party installers like Scoop? could you perhaps share the output from running the also, I highly doublt the patch you mentioned for Yarn v2 would have any influence here, that relates to installing Node packages, whereas the issue you're running into here is related to locating Android SDK resources. take note: the "Missing Packages" CLI output for API level 28 is not an error here, it's just telling you that there are no AVD images available for that Android version, so you won't be able to create and run an Android 9 (API 28) emulator. the what "target API" is your project set to use? and are you certain that you have the "Android SDK Platform " and "Sources for Android " packages installed for that version? if you are targeting the latest API, is your current environment using JDK 11? this is required to build the Android Gradle project for anything higher than API 31 (IIRC, this changed when the "Android Gradle" plugin in the native project updated from |
@ZaLiTHkA thanks for your help! I'm not using scoop or anything. Not sure what the default jdk is that comes with Android Studio, will look that up in the evening and run the ionic info command. But I was just trying to get the Nuxt 3 Ionic boilerplate working https://github.com/Dawntraoz/nuxt3-ionic-boilerplate One thing I remember was, the |
ionic info
ionic doctor
"git not installed" is a false flag and the missing index.html will be generated in the dist directory during build. The ionic/cli is installed locally, otherwise I can't use the patch to make it working with yarn berry. I also doubt it has any impact, other than the latest CLI version is not used :) |
if you have a current release, that should be JDK 11.. but keep in mind that won't become your "system default" by itself, that part depends on your current environment variables. I would suggest you verify the current version with FWIW, if you're not already using one, perhaps a Java "version manager" might be helpful? SDKMAN!, Jabba, and jenv are all pretty good. they do make JDK management a little less tedious.
Capacitor CLI only checks for the existence of the
I don't see any of that being an issue.. that message regarding Git usage is more likely because the current project (being a "test") might not be initialised as a Git repo. the message regarding a local Ionic CLI installation is also not as uncommon as you would think, I need to do that to use Ionic in Nx workspaces. installed package versions also look fine, not the latest latest, but sometimes that's a little safer anyway (at your own discretion, Ionic's changelogs are your best friend here). I must say that I haven't made the jump to Yarn v2 yet, not sure if there is anything there that may be affecting this... with all that said, I'm still not unsure of what the issue is in your environment.. 🤔 but I do know that the majority of these CLI tools depend heavily on environment variables, so just to confirm, do the following variables exist in your environment at runtime when you execute your CLI commands?
lastly, ensure the following paths exist in your current environment's
I suspect you might find something missing or misconfigured in this area somewhere.. please let me know if that helps at all? |
I'm currently going with OpenJDK 16, so that should not be the problem.
Thank you, I didn't know that and will check it out.
Got it. I've also deleted it and re-created it with no impact.
I'm also running that project in an Nx workspace btw ;) But does that really mean you can't use a global installation?
Not sure either. Would
ANDROID_HOME did not exist, but I've created it and tested it again with no impact.
I'm missing this one indeed:
https://ionicframework.com/docs/developing/android I wish ionic/cli would just give some more details on what is missing |
I could solve it 😊 the reason was a missing emulator, or in my case a not startable emulator. I had to give user permissions to /dev/kvm. Had I tried the build command instead of the run command, it probably would have worked the whole time. |
@ZaLiTHkA is this still an issue - I know you moved off scoop - but it's not handling symlinks correctly on windows? Is that the issue? Or is it symlinks in general? |
native-run just can't detect installed API levels when I can easily run and compile in Android Studio and also checked and installed SDK properly. This is definitely a bug.
|
Please check if the
it seems that native-run did not find these files so discovered none installed API Levels. |
I experienced the same result in a Nix shell environment that symlinks to system images.
It suggests to me that the code to walk the tree to find |
Hello I get error without ERR_* or description:
It is Ubuntu 22.04.4 LTS I have tried install with But it does not work. And I don't have idea what to do |
by this do you mean you can't get the Android SDK configured? that's what the SO question you linked to is trying to solve. with that said, you might want to just install Android Studio and let that configure the SDK and your environment for you. if you do already have Android Studio (or just the SDK) correctly configured, do you also have the NPM if that doesn't help, then I would suggest you create a new issue and describe what you've tried so far.. |
Version:
1.6.0
, installed globally from NPMDescription:
native-run
never manages to locate my installed API levels, failing withERR_UNSUITABLE_API_INSTALLATION
every time.I install both Android Studio and Android SDK using Scoop (https://github.com/ScoopInstaller/Scoop), but I've beeing doing it this way for ages and never had issues like this before.
the latest Android SDK tools are starting to require Java 11, so I install and switch JDK versions using Jabba (https://github.com/shyiko/jabba, also installed using Scoop) and I've already updated my environment variable to include the new
cmdline-tools
folder (with the updatedsdkmanager
andavdmanager
tools) in myPATH
variable.I don't think I've done anything funky in my system configuration here, so is this a bug in
native-run
? perhaps as a result of something changing from Google's side of things?Command Output:
running the command
npx native-run android --list --verbose
presents the following:meanwhile, the command
avdmanager list target
presents the following:ans lastly, the command
sdkmanager --list_installed
presents the following:SDK Info:
output of the command
npx native-run --sdk-info --verbose
:..and no, that's not a bad copy/paste here, the
Tools:
section at the end is indeed completely empty.The text was updated successfully, but these errors were encountered: