Closed ftcaeappno closed 1 year ago
Hi, did you create your app using forcehybrid
? I just used the latest 10.1.1
version of the SDK with forcehybrid
and the hybrid_local
option to create a new app, installed it on an Android 9 emulator, and I was able to run it just fine.
Project is build with Ionic, Angular, & Cordova. Not created using forcehybrid.
Ionic:
Ionic CLI : 6.20.1 (.../@ionic/cli/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 6.0.10
@angular-devkit/build-angular : 13.2.5
@angular-devkit/schematics : 13.2.5
@angular/cli : 13.2.5
@ionic/angular-toolkit : 6.1.0
Cordova:
Cordova CLI : 10.0.0 (cordova-lib@10.1.0)
Cordova Platforms : android 9.0.0, ios 6.1.1
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 16 other plugins)
Utility:
cordova-res : 0.15.4
native-run : 1.7.0
System:
Android SDK Tools : 26.1.1 (~/Library/Android/sdk)
ios-sim : 8.0.2
NodeJS : v16.15.1 (~/node/16.15.1/bin/node)
npm : 8.11.0
OS : macOS Monterey
Xcode : Xcode 13.4.1 Build version 13F100
This issue is caused by angular build step adding type="module"
. When type="module"
is manually removed this error goes away.
This issue is only happening when Salesforce Cordova plugin is present, Without it <script type="module">
is not an issue on android 9
This project has cordova-plugin-ionic-webview
plugin installed.
After some more debugging I think the issue is in SalesforceDroidGapActivity.java L472 where startUrl is hardcoded to file:///android_asset/www/
. So even if cordova-plugin-ionic-webview
plugin is installed and https://
is available, webview gets redirected to file:///android_asset/www/
.
Then, App shows Blank screen with console error Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.", source: file:///android_asset/www/runtime.js
We are developing an app using SalesforceMobileSDK-CordovaPlugin and recently found an issue with Android 9. This is the error we are getting: `I/chromium: [INFO:CONSOLE(0)] "Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.", source: file:///android_asset/www/runtime.js (0)
I/chromium: [INFO:CONSOLE(0)] "Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.", source: file:///android_asset/www/polyfills.js (0)
I/chromium: [INFO:CONSOLE(0)] "Failed to load module script: The server responded with a non-JavaScript MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.", source: file:///android_asset/www/main.js (0)`
We did an additional testing:
The error is also in the attached file.
Is there a documented incompatibility between SalesforceMobileSDK-CordovaPlugin and Android 9?