Android &引用;TypeError:无法获取“文件”;导致Ionic 5应用程序卡在屏幕上
我的Ionic 5 Android应用程序在网络上(Ionic serve)以及通过“Ionic cordova run Android”在模拟器上运行良好,但在构建APK并安装到设备上(甚至在模拟器上)后,它不会超出初始屏幕。查看chrome开发工具错误日志显示以下内容Android &引用;TypeError:无法获取“文件”;导致Ionic 5应用程序卡在屏幕上,android,ionic-framework,polyfills,Android,Ionic Framework,Polyfills,我的Ionic 5 Android应用程序在网络上(Ionic serve)以及通过“Ionic cordova run Android”在模拟器上运行良好,但在构建APK并安装到设备上(甚至在模拟器上)后,它不会超出初始屏幕。查看chrome开发工具错误日志显示以下内容 Angular is running in development mode. Call enableProdMode() to enable production mode. addthis_widget.js:70
Angular is running in development mode. Call enableProdMode() to enable production mode.
addthis_widget.js:70
Uncaught TypeError: Cannot read property 'split' of null
at r (addthis_widget.js:70)
at e.exports (addthis_widget.js:70)
at addthis_widget.js:70
at addthis_widget.js:70
at i (addthis_widget.js:70)
at addthis_widget.js:70
at HTMLDocument.onReady (addthis_widget.js:70)
polyfills-es2015.js:4284
Fetch API cannot load app://localhost/svg/wifi.svg. URL scheme "app" is not supported.
(anonymous) @ polyfills-es2015.js:4284
app://localhost/polyfills-es2015.js:3882
Unhandled Promise rejection: Failed to fetch ; Zone: <root> ; Task: Promise.then ; Value: TypeError: Failed to fetch
at app://localhost/polyfills-es2015.js:4284
at proto.(app://localhost/anonymous function) (app://localhost/polyfills-es2015.js:3794:24)
at getSvgContent (app://localhost/6-es2015.js:277)
at Icon.loadIcon (app://localhost/6-es2015.js:366)
at waitUntilVisible (app://localhost/6-es2015.js:330)
at Icon.waitUntilVisible (app://localhost/6-es2015.js:353)
at Icon.connectedCallback (app://localhost/6-es2015.js:328)
at safeCall (app://localhost/vendor-es2015.js:185404)
at fireConnectedCallback (app://localhost/vendor-es2015.js:185830)
at initializeComponent (app://localhost/vendor-es2015.js:185793) TypeError: Failed to fetch
at app://localhost/polyfills-es2015.js:4284:36
at proto.(anonymous function) (app://localhost/polyfills-es2015.js:3794:24)
at getSvgContent (app://localhost/6-es2015.js:277:13)
at Icon.loadIcon (app://localhost/6-es2015.js:366:11)
at waitUntilVisible (app://localhost/6-es2015.js:330:12)
at Icon.waitUntilVisible (app://localhost/6-es2015.js:353:7)
at Icon.connectedCallback (app://localhost/6-es2015.js:328:10)
at safeCall (app://localhost/vendor-es2015.js:185404:36)
at fireConnectedCallback (app://localhost/vendor-es2015.js:185830:9)
at initializeComponent (app://localhost/vendor-es2015.js:185793:13)
api.onUnhandledError @ app://localhost/polyfills-es2015.js:3882
2assets.kochava.com/kochava.js/v2.2/kochava.min.js?c=0.08378216348533063:1 event sent successfully
app://localhost/plugins/cordova-plugin-fcm-with-dependecy-updated/www/FCMPlugin.js:46 FCM: has been created
cordova.js:1237 deviceready has not fired after 5 seconds.
cordova.js:1230 Channel not fired: onCordovaInfoReady
cordova.js:1230 Channel not fired: onFileSystemPathsReady
cordova.js:1230 Channel not fired: onCordovaConnectionReady
app://localhost/vendor-es2015.js:97655 Ionic Native: deviceready did not fire within 5000ms.
This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them.
还有“离子信息”
如果您使用--prod构建应用程序,则需要启用生产情绪, 在main.ts文件中添加以下内容
enableProdMode();
第二个错误未捕获TypeError:无法读取null的属性“split”
似乎您正在调用函数need变量未初始化或未返回值实际上我不是使用--prod构建它。此外,我更关心/困惑的是未处理的承诺拒绝错误。您能将代码发布到使用“拆分”的地方吗?它在“addthis”小部件中,如果你用这个小部件面对这个问题,我想Answer就在这里
Ionic:
Ionic CLI : 6.14.1 (/Users/blingbling/.nvm/versions/node/v10.23.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/angular 5.6.6
@angular-devkit/build-angular : 0.1102.12
@angular-devkit/schematics : 11.2.12
@angular/cli : 11.2.12
@ionic/angular-toolkit : 3.1.1
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 9.0.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 24 other plugins)
Utility:
cordova-res (update available: 0.15.3) : 0.10.0
native-run : 1.3.0
System:
Android SDK Tools : 26.1.1 (/Users/blingbling/Library/Android/sdk)
ios-deploy : 1.11.4
ios-sim : 8.0.2
NodeJS : v10.23.0 (/Users/blingbling/.nvm/versions/node/v10.23.0/bin/node)
npm : 7.11.1
OS : macOS Big Sur
Xcode : Xcode 12.5 Build version 12E262
enableProdMode();