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.

JIT compiler unavailable with target es2015 (Android)

See original GitHub issue

First let me thank you for this plugin, it works really well. I’ve been using it for some time and I really like it.

I have an issue on Android when I try to use "target": "es2015" in my tsconfig.json: I get a white screen when I start the Android app and if I inspect the webview I see the error message “JIT compiler unavailable”.

If I set "target": "es5" in tsconfig.json, then everything works correctly!

Do you have any idea how to fix this issue?

I have created a small repo to reproduce the issue: https://github.com/francoisduchemin/ionic-admob-plus

I can reproduce this issue with the following steps:

  • Create starter ionic app: ionic start ionic-admob-plus tabs --type=angular --cordova
  • Add npm package for admob-plus: npm install @admob-plus/ionic
  • Add cordova plugin for admob-plus: ionic cordova plugin add admob-plus-cordova --variable APP_ID_ANDROID=ca-app-pub-3940256099942544~3347511713
  • Add <preference name="AndroidXEnabled" value="true" /> in config.xml
  • Add cordova plugin androidx-adapter: ionic cordova plugin add cordova-plugin-androidx-adapter
  • Build: ionic cordova build android --prod --release
  • Run: ionic cordova run android --prod

If I start the app in Android Studio, the app opens correctly in the emulator.

Now as soon as I add AdMob to the providers in app.module.ts, I get a white screen and the error JIT compiler unavailable:

import { AdMob } from '@admob-plus/ionic/ngx';

...

  providers: [
    AdMob, // <--- here
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],

The Chrome inspector then shows the following error message:

Could not find cordova.js script tag. Plugin loading may fail.
main.37aa675c04a56933b306.js:1 Error: JIT compiler unavailable
    at hn (main.37aa675c04a56933b306.js:1)
    at Function.get (main.37aa675c04a56933b306.js:1)
    at wt (main.37aa675c04a56933b306.js:1)
    at Ii (main.37aa675c04a56933b306.js:1)
    at main.37aa675c04a56933b306.js:1
    at ki.processProvider (main.37aa675c04a56933b306.js:1)
    at main.37aa675c04a56933b306.js:1
    at main.37aa675c04a56933b306.js:1
    at Array.forEach (<anonymous>)
    at gn (main.37aa675c04a56933b306.js:1)
main.37aa675c04a56933b306.js:1 Ionic Native: deviceready event fired after

If I modify the target in tsconfig.json to es5 and build, then the app opens correctly! (no white screen)

Do you know if there is a way to target es2015? What am I doing wrong?

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:33

github_iconTop GitHub Comments

5reactions
francoisduchemincommented, Dec 31, 2021

Two remarks:

I’m still looking for a solution, this issue prevents me from updating my apps. If anyone has a solution, please share!

4reactions
georgettelsfcommented, Sep 28, 2022

@itsLucario’s solution worked for me but the zip is old and the NativeAd is not included. I tried to build the lib using ngc without luck. @admob-plus/ionic is just a wrapper around the cordova version. I managed to resolve the JIT compiler issues by copying this file https://github.com/admob-plus/admob-plus/blob/master/packages/ionic/src/ngx/index.ts inside my project in a file named admob.module.ts (the name is not important). Then I changed the imports from @admob-plus/ionic/ngx to ./admob.module.ts and it seems to be ok.

Read more comments on GitHub >

github_iconTop Results From Across the Web

JIT compiler unavailable after angular update - Stack Overflow
The JIT compiler unavailable error can occur when using an outdated plugin (i.e. one that still the uses View Engine instead of Ivy)....
Read more >
Implementing ART just-In-time (JIT) Compiler
JIT is enabled for any application that is not compiled according to the speed compilation filter (which says "compile as much as you...
Read more >
JavaScript Environment - React Native
Note that on iOS, JavaScriptCore does not use JIT due to the absence of writable ... React Native ships with the Babel JavaScript...
Read more >
Ionic/Angular13 with aot: true cause JIT compiler unavailable
Hi, We are facing compiling issue on ionic6 and seem no support from the github issue yet.
Read more >
Ahead-of-Time Compilation - ts - COOKBOOK - Angular
You can compile the app in the browser, at runtime, as the application loads, using the just-in-time (JIT) compiler. This is the standard...
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