question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Capacitor.js does not work with Android API 21-23 (Lollipop and Marshmallow)

See original GitHub issue

Bug Report - capacitor.js does not load with Android API 21-23

npx cap add android creates

android/variables.gradle:    minSdkVersion = 21

but Android API 21-23 does not work.

Capacitor Version

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 3.2.2
  @capacitor/core: 3.2.2
  @capacitor/android: 3.2.2
  @capacitor/ios: 3.2.2

Installed Dependencies:

  @capacitor/cli: 3.2.2
  @capacitor/core: 3.2.2
  @capacitor/android: 3.2.2
  @capacitor/ios: 3.2.2

[success] iOS looking great! 👌
[success] Android looking great! 👌
### Platform(s)
    Name: Pixel_2_API_21
  Device: pixel_2 (Google)
    Path: ~/.android/avd/Pixel_2_API_21.avd
  Target: Google APIs (Google Inc.)
          Based on: Android 5.0 (Lollipop) Tag/ABI: google_apis/x86_64
  Sdcard: 512 MB
---------
    Name: Pixel_2_API_22
  Device: pixel_2 (Google)
    Path: ~/.android/avd/Pixel_2_API_22.avd
  Target: Google APIs (Google Inc.)
          Based on: Android 5.1 (Lollipop) Tag/ABI: google_apis/x86_64
  Sdcard: 512 MB
---------
    Name: Pixel_2_API_23
  Device: pixel_2 (Google)
    Path: ~/.android/avd/Pixel_2_API_23.avd
  Target: Google APIs (Google Inc.)
          Based on: Android 6.0 (Marshmallow) Tag/ABI: google_apis/x86_64
  Sdcard: 512 MB

Current Behavior

App Startup fails chrome://inspect/#devices

capacitor.js:2 Uncaught SyntaxError: Use of const in strict mode.

Expected Behavior

Expect capacitor.js to load.

Code Reproduction

https://github.com/codeconsole/exiftest/tree/capacitor

git clone https://github.com/codeconsole/exiftest
cd exiftest
git checkout capacitor
npm install
npx cap add ios
npx cap add android
cp conf/Info.plist ios/App/App/Info.plist
cp conf/AndroidManifest.xml android/app/src/main/AndroidManifest.xml
npx cap sync
sdkmanager 'system-images;android-21;google_apis;x86_64'
avdmanager create avd --name Pixel_2_API_21 --package 'system-images;android-21;google_apis;x86_64' --device 'pixel_2'
cap run android --target=Pixel_2_API_21 

Other Technical Details

npm --version output:

7.20.3

node --version output:

v16.7.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
codeconsolecommented, Sep 13, 2021

@jcesarmobile

Is there a way of gracefully handling this so that if they aren’t up to date? Maybe at least deliver a nice screen that tells them to update?

Is there a recommended way to configure an emulator to simulate these devices?

What is the highest webview android 5 can update to? According to wikipedia, it is no longer supported. https://en.wikipedia.org/wiki/Android_version_history

0reactions
ionitron-bot[bot]commented, Nov 10, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting Android Issues | Capacitor Documentation
This guide attempts to document common Android issues with possible solutions. ... This will re-sync your native Android code to include the new...
Read more >
bug: Capacitor 4.0.1 API level 26 (Oreo) not starting ... - GitHub
Completely fresh capacitor ionic project/application does not start on android emulator Oreo API 26 in Android Studio. Expected Behavior.
Read more >
Cant run project on lower api version it runs on lollipop and ...
I have downloaded android studio 2.2.1 but I can't run my project on lower API version it runs on lollipop and marshmallow. My...
Read more >
Untitled
Huboss, Gloria's austin domain menu, Corner restaurant westport, Zamrin bekas suami kuza, Not allowed to run sudo on localhost, S.s angle.
Read more >
Untitled
Cancion de rocky 4, Doctoral programs in social work, Trendnet modem 3g? ... Marlene koch sample menus, Samsung s4 naujienos, Csvde is not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found