Skip to content
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

API Level 34 #322

Closed
haytham918 opened this issue Jun 13, 2023 · 14 comments · Fixed by #349
Closed

API Level 34 #322

haytham918 opened this issue Jun 13, 2023 · 14 comments · Fixed by #349
Labels

Comments

@haytham918
Copy link

Version: 34

native-run failed with error

ERR_UNSUPPORTED_API_LEVEL: Unsupported API level: 34

Description:

Can't Build Android App

Command Output:

SDK Info:

SDK 34

@suiciniv87
Copy link

same problem

@Sebastiangperez
Copy link

Same here

@haytham918
Copy link
Author

I solved this issue by downgrading to API level 33

@Sebastiangperez
Copy link

Yes , me too , thanks , weird.
Question @haytham918 , do you have issues when you try to install an apk file while you have active Google Play Protect , even if you give the authorization that says install anyway ? i'm getting app not installed , if i disable Play Protect , works.

@warenix
Copy link

warenix commented Jul 4, 2023

I found sometimes the error message ERR_UNSUPPORTED_API_LEVEL: Unsupported API level: 34 is misleading.

Below error is shown when I unplug my android phone:

-> % npx cap run android
✔ Copying web assets from dist_android to android/app/src/main/assets/public in 20.70ms
✔ Creating capacitor.config.json in android/app/src/main/assets in 925.08μs
[info] Inlining sourcemaps
✔ copy android in 46.28ms
✔ Updating Android plugins in 3.80ms
✔ update android in 34.54ms
[error] native-run failed with error
        
        ERR_UNSUPPORTED_API_LEVEL: Unsupported API level: 34
        
        More details for this error may be available online:
        https://github.com/ionic-team/native-run/wiki/Android-Errors

After plugging in and making sure adb devices shows my phone, the app is then installed successfully:

-> % npx cap run android
✔ Copying web assets from dist_android to android/app/src/main/assets/public in 19.12ms
✔ Creating capacitor.config.json in android/app/src/main/assets in 857.67μs
[info] Inlining sourcemaps
✔ copy android in 40.55ms
✔ Updating Android plugins in 3.92ms
✔ update android in 27.36ms
✔ Running Gradle build in 1.32s
✔ Deploying app-debug.apk to *************  in 2.36s

@benhidi
Copy link

benhidi commented Aug 12, 2023

I solved this issue by downgrading to API level 33

can you show me how

@haytham918
Copy link
Author

In your Android Studio, download target SDK and image that is 33

@pablopereira27
Copy link

This problem happens because "Run Android" is trying to run the application on an AVD (Android Virtual Device) API 34, if you remove or edit this AVD to API 33 or run the app on a non-virtual device through the cable connected to the computer (adb devices), this problem ends.

Obviously you need:

  • Have SDK 33 and the System Image (Google APIs Intel x86_64 Atom System Image), both of which can be acquired through the SDK Manager contained in Android Studio.
  • Create the AVD with API 33.

@9705409705
Copy link

Unable to find any devices: [fatal] native-run failed with error ERR_UNSUPPORTED_API_LEVEL: Unsupported API level: 34

@gkpo
Copy link

gkpo commented Nov 9, 2023

@haytham918

In your Android Studio, download target SDK and image that is 33

In my SDK Manager, the version that has API Level 33 is Android 13.0 ("Tiramisu"). Is this the right one ?
I then pick the 2 sub items:

  • Android SDK Platform 33
  • Sources for Android 33

And I download them. But then when I run npx cap run android I get this error:

ERR_UNSUITABLE_API_INSTALLATION: No suitable API installation found. Use --sdk-info to reveal missing packages and other issues.

Any ideas ?

@jcesarmobile
Copy link
Member

You also need to download an emulator image, but it's better if you just update native-run to version 2.0.0 as it no longer requires an emulator image

@gkpo
Copy link

gkpo commented Nov 9, 2023

@jcesarmobile thanks for your help, I also just figured that out.
It solved this issue but now I have another one...

Could not open settings generic class cache for settings file
'/Users/...path-to-app.../android/settings.gradle'

So I guess my search continues on different forums.... I wonder when developers will finally be freed from dependency hell and will be able to focus on building apps... Setting up a working environment from the first go almost seems like utopia.

@lefa01
Copy link

lefa01 commented Nov 27, 2023

Uploading Screenshot 2023-11-27 at 11.24.39 AM.png…

@GamerQuanTuM
Copy link

GamerQuanTuM commented Mar 24, 2024

√ update android in 81.49ms
[error] native-run failed with error
More details for this error may be available online:
https://github.com/ionic-team/native-run/wiki/Android-Errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.