添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

我在百度上查了一下,从inoic4以后showWhen方法就被废弃掉了,ionic官方还没有给出一个合适的解决方案,老师,有没有什么方法可以代替showWhen方法呢?
还有就是 ionic5编译Android后出现以下报错(新项目)在网页上是显示正常的。在低版本的Android系统中报net::ERR_FILE_NOT_FOUND(file:///www/index.html)
图片描述
Android Stuido 调试报错如下

01/10 11:08:58: Launching 'app' on  Samsung.
$ adb shell am start -n "io.ionic.starter/io.ionic.starter.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Waiting for process to come online...
Connected to process 3180 on device '-samsung-192.168.179.101:5555'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
I/io.ionic.starter: type=1400 audit(0.0:770): avc: denied { write } for comm=45474C20496E6974 name="property_service" dev="tmpfs" ino=8131 scontext=u:r:untrusted_app:s0:c70,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=1
    type=1400 audit(0.0:771): avc: denied { connectto } for comm=45474C20496E6974 path="/dev/socket/property_service" scontext=u:r:untrusted_app:s0:c70,c256,c512,c768 tcontext=u:r:init:s0 tclass=unix_stream_socket permissive=1
D/vndksupport: Loading /vendor/lib/egl/libGLES_emulation.so from current namespace instead of sphal namespace.
E/libEGL: load_driver(/vendor/lib/egl/libGLES_emulation.so): dlopen failed: library "/vendor/lib/egl/libGLES_emulation.so" not found
D/vndksupport: Loading /vendor/lib/egl/libEGL_emulation.so from current namespace instead of sphal namespace.
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/vndksupport: Loading /vendor/lib/egl/libGLESv1_CM_emulation.so from current namespace instead of sphal namespace.
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/vndksupport: Loading /vendor/lib/egl/libGLESv2_emulation.so from current namespace instead of sphal namespace.
I/CordovaLog: Changing log level to DEBUG(3)
I/CordovaActivity: Apache Cordova native platform version 8.1.0 is starting
D/CordovaActivity: CordovaActivity.onCreate()
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
I/WebViewFactory: Loading com.android.webview version 66.0.3359.158 (code 336015815)
I/o.ionic.starte: The ClassLoaderContext is a special shared library.
I/cr_LibraryLoader: Time to load native libraries: 3 ms (timestamps 3410-3413)
I/chromium: [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0
I/cr_LibraryLoader: Expected native library version number "66.0.3359.158", actual native library version number "66.0.3359.158"
W/cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.android.webview, sandboxed = true
I/cr_BrowserStartup: Initializing chromium process, singleProcess=false
I/cr_base: Android Locale: zh_CN_#Hans requires .pak files: []
E/chromium: [ERROR:devtools_http_handler.cc(292)] Cannot start http server for devtools. Stop devtools.
W/cr_CrashFileManager: /data/user/0/io.ionic.starter/cache/WebView/Crash Reports does not exist or is not a directory
W/o.ionic.starte: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;-><init>(Landroid/content/Context;I)V (light greylist, reflection)
    Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker;->logEvent(Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;)V (light greylist, reflection)
    Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionStarted(I)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
W/o.ionic.starte: Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(II)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
    Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
    Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionModified(IILandroid/view/textclassifier/TextSelection;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
    Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(III)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
    Accessing hidden method Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent;->selectionAction(IIILandroid/view/textclassifier/TextClassification;)Landroid/view/textclassifier/logging/SmartSelectionEventTracker$SelectionEvent; (light greylist, reflection)
D/IonicWebViewEngine: Ionic Web View Engine Starting Right Up 1...
D/SystemWebViewEngine: CordovaWebView is running on device made by: unknown
D/PluginManager: init()
D/OpenGLRenderer: Skia GL Pipeline
D/CordovaWebViewImpl: >>> loadUrl(file:///android_asset/www/index.html)
W/cr_media: Requires BLUETOOTH permission
D/: HostConnection::get() New Host Connection established 0xd6b759c0, tid 3257
I/Chrome_InProcGp: type=1400 audit(0.0:774): avc: denied { connectto } for path=006C6F63616C5F6F70656E676C scontext=u:r:untrusted_app:s0:c70,c256,c512,c768 tcontext=u:r:local_opengl:s0 tclass=unix_stream_socket permissive=1
E/AndroidProtocolHandler: Unable to open asset URL: file:///android_asset/www/index.html
D/CordovaActivity: Started the activity.
D/CordovaActivity: Resumed the activity.
W/: Unrecognized GLES max version string in extensions: 
W/: Process pipe failed
I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
    android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
E/chromium: [ERROR:gl_surface_egl.cc(320)] eglChooseConfig failed with error EGL_SUCCESS
E/EGL_emulation: tid 3257: eglChooseConfig(959): error 0x3004 (EGL_BAD_ATTRIBUTE)
E/chromium: [ERROR:gl_surface_egl.cc(320)] eglChooseConfig failed with error EGL_BAD_ATTRIBUTE
    [ERROR:gl_surface_egl.cc(472)] No suitable EGL configs found.
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 1
D/: HostConnection::get() New Host Connection established 0xd8778c80, tid 3255
W/: Unrecognized GLES max version string in extensions: 
D/EGL_emulation: eglCreateContext: 0xed007c40: maj 2 min 0 rcv 2
E/chromium: [ERROR:gl_surface_egl.cc(320)] eglChooseConfig failed with error EGL_SUCCESS
E/EGL_emulation: tid 3257: eglChooseConfig(959): error 0x3004 (EGL_BAD_ATTRIBUTE)
E/chromium: [ERROR:gl_surface_egl.cc(320)] eglChooseConfig failed with error EGL_BAD_ATTRIBUTE
    [ERROR:gl_surface_egl.cc(472)] No suitable EGL configs found.
D/EGL_emulation: eglCreateContext: 0xd6b56d20: maj 2 min 0 rcv 2
W/VideoCapabilities: Unrecognized profile 4 for video/hevc
I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device.
D/vndksupport: Loading /vendor/lib/hw/[email protected] from current namespace instead of sphal namespace.
D/vndksupport: Loading /vendor/lib/hw/gralloc.vbox86.so from current namespace instead of sphal namespace.
E/EGL_emulation: tid 3255: eglSurfaceAttrib(1354): error 0x3009 (EGL_BAD_MATCH)
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xed007a00, error=EGL_BAD_MATCH
E/EGL_emulation: tid 3255: eglSurfaceAttrib(1354): error 0x3009 (EGL_BAD_MATCH)
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xd6b57bc0, error=EGL_BAD_MATCH
E/EGL_emulation: tid 3255: eglSurfaceAttrib(1354): error 0x3009 (EGL_BAD_MATCH)
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xd6b57c20, error=EGL_BAD_MATCH
D/CordovaWebViewImpl: onPageDidNavigate(file:///android_asset/www/index.html)
I/Choreographer: Skipped 42 frames!  The application may be doing too much work on its main thread.
E/chromium: [ERROR:gl_surface_egl.cc(320)] eglChooseConfig failed with error EGL_SUCCESS
E/EGL_emulation: tid 3257: eglChooseConfig(959): error 0x3004 (EGL_BAD_ATTRIBUTE)
E/chromium: [ERROR:gl_surface_egl.cc(320)] eglChooseConfig failed with error EGL_BAD_ATTRIBUTE
    [ERROR:gl_surface_egl.cc(472)] No suitable EGL configs found.
E/chromium: [ERROR:gl_surface_egl.cc(320)] eglChooseConfig failed with error EGL_SUCCESS
E/EGL_emulation: tid 3257: eglChooseConfig(959): error 0x3004 (EGL_BAD_ATTRIBUTE)
E/chromium: [ERROR:gl_surface_egl.cc(320)] eglChooseConfig failed with error EGL_BAD_ATTRIBUTE
    [ERROR:gl_surface_egl.cc(472)] No suitable EGL configs found.
D/EGL_emulation: eglCreateContext: 0xd527f640: maj 2 min 0 rcv 2
I/OpenGLRenderer: Davey! duration=965ms; Flags=0, IntendedVsync=1523994815414, Vsync=1524694815386, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=1524706170318, AnimationStart=1524706214484, PerformTraversalsStart=1524706255905, DrawStart=1524706604518, SyncQueued=1524707336808, SyncStart=1524768684311, IssueDrawCommandsStart=1524768709960, SwapBuffers=1524925581816, FrameCompleted=1525021599222, DequeueBufferDuration=109000, QueueBufferDuration=254000, 
I/OpenGLRenderer: Davey! duration=1069ms; Flags=0, IntendedVsync=1523994815414, Vsync=1524694815386, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=1524706170318, AnimationStart=1524706214484, PerformTraversalsStart=1524706255905, DrawStart=1525022129178, SyncQueued=1525024846598, SyncStart=1525031017913, IssueDrawCommandsStart=1525031258234, SwapBuffers=1525056655904, FrameCompleted=1525070134207, DequeueBufferDuration=113000, QueueBufferDuration=240000, 
I/OpenGLRenderer: Davey! duration=1138ms; Flags=0, IntendedVsync=1523994815414, Vsync=1524694815386, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=1524706170318, AnimationStart=1524706214484, PerformTraversalsStart=1524706255905, DrawStart=1525070837070, SyncQueued=1525071372434, SyncStart=1525076245809, IssueDrawCommandsStart=1525076358444, SwapBuffers=1525076490770, FrameCompleted=1525137781258, DequeueBufferDuration=145000, QueueBufferDuration=189000, 
D/SystemWebViewClient: CordovaWebViewClient.onReceivedError: Error code=-1 Description=net::ERR_FILE_NOT_FOUND URL=file:///android_asset/www/index.html
D/CordovaWebViewImpl: onPageFinished(file:///android_asset/www/index.html)
E/cr_ApiBridge: Failed to init handler: Attempt to invoke virtual method 'java.lang.reflect.Constructor java.lang.Class.getDeclaredConstructor(java.lang.Class[])' on a null object reference
D/SERVER: Handling local request: http://localhost/
E/WebViewAssetServer: Unable to open index.html
    java.io.FileNotFoundException: www/index.html
        at android.content.res.AssetManager.nativeOpenAsset(Native Method)
        at android.content.res.AssetManager.open(AssetManager.java:744)
        at com.ionicframework.cordova.webview.AndroidProtocolHandler.openAsset(AndroidProtocolHandler.java:30)
        at com.ionicframework.cordova.webview.WebViewLocalServer.handleLocalRequest(WebViewLocalServer.java:282)
        at com.ionicframework.cordova.webview.WebViewLocalServer.shouldInterceptRequest(WebViewLocalServer.java:228)
        at com.ionicframework.cordova.webview.IonicWebViewEngine$ServerClient.shouldInterceptRequest(IonicWebViewEngine.java:125)
        at com.android.webview.chromium.WebViewContentsClientAdapter.shouldInterceptRequest(WebViewContentsClientAdapter.java:54)
        at org.chromium.android_webview.AwContents$BackgroundThreadClientImpl.shouldInterceptRequest(AwContents.java:9)
        at org.chromium.android_webview.AwContentsBackgroundThreadClient.shouldInterceptRequestFromNative(AwContentsBackgroundThreadClient.java:11)
D/NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: true
E/EGL_emulation: tid 3255: eglSurfaceAttrib(1354): error 0x3009 (EGL_BAD_MATCH)
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xd6b57bc0, error=EGL_BAD_MATCH
D/CordovaWebViewImpl: onPageDidNavigate(http://localhost/)
D/SystemWebViewClient: CordovaWebViewClient.onReceivedError: Error code=-6 Description=net::ERR_CONNECTION_REFUSED URL=http://localhost/
D/CordovaWebViewImpl: onPageFinished(http://localhost/)
E/EGL_emulation: tid 3255: eglSurfaceAttrib(1354): error 0x3009 (EGL_BAD_MATCH)
W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xd6b585e0, error=EGL_BAD_MATCH