当我尝试点击像
这样的简单链接时,我的Ionic v1应用在Android设备(6.0.1,5.1.1和4.4.2)上崩溃了a href="https://www.google.com" target="_blank">Google
相同的链接在IOS设备上运行良好(9.3,10)。我尝试了_parent
,_self
,_system
和_blank
目标,但结果都相同。
我的开发人员太忙了,无法帮助解决这个错误,所以我试图看看它是否能解决。
我在Android设备上使用了一个logcat,并在发生错误时分享了以下结果。但是,我不知道接下来该做什么。任何帮助或指示将不胜感激。
02-19 18:14:52.765 12520 12609 E PushPlugin:执行:获得JSON 例外没有值为senderID 02-19 18:14:53.735 1476 3033 E. 看门狗:!@Sync 3699 [02-19 18:14:53.748] 02-19 18:14:54.895 12520 12520 E AndroidRuntime:FATAL EXCEPTION:main 02-19 18:14:54.895 12520 12520 E AndroidRuntime:流程: com.completevirtualsolutions.eKnowtify,PID:12520 02-19 18:14:54.895 12520 12520 E AndroidRuntime: android.content.res.Resources $ NotFoundException:资源ID#0x0 02-19 18:14:54.895 12520 12520 E AndroidRuntime:at android.content.res.Resources.getValue(Resources.java:2558)02-19 18:14:54.895 12520 12520 E AndroidRuntime:at android.content.res.Resources.getDrawable(Resources.java:2001)02-19 18:14:54.895 12520 12520 E AndroidRuntime:at android.content.res.Resources.getDrawable(Resources.java:1987)02-19 18:14:54.895 12520 12520 E AndroidRuntime:at android.content.res.Resources.getDrawable(Resources.java:1961)02-19 18:14:54.895 12520 12520 E AndroidRuntime:at org.apache.cordova.inappbrowser.InAppBrowser $ 5.run(InAppBrowser.java:606) 02-19 18:14:54.895 12520 12520 E AndroidRuntime:at android.app.Activity.runOnUiThread(Activity.java:6035)02-19 18:14:54.895 12520 12520 E AndroidRuntime:at org.apache.cordova.inappbrowser.InAppBrowser.showWebPage(InAppBrowser.java:779) 02-19 18:14:54.895 12520 12520 E AndroidRuntime:at org.apache.cordova.inappbrowser.InAppBrowser $ 1.run(InAppBrowser.java:198) 02-19 18:14:54.895 12520 12520 E AndroidRuntime:at android.os.Handler.handleCallback(Handler.java:739)02-19 18:14:54.895 12520 12520 E AndroidRuntime:at android.os.Handler.dispatchMessage(Handler.java:95)02-19 18:14:54.895 12520 12520 E AndroidRuntime:at android.os.Looper.loop(Looper.java:158)02-19 18:14:54.895 12520 12520 E AndroidRuntime:at android.app.ActivityThread.main(ActivityThread.java:7225)02-19 18:14:54.895 12520 12520 E AndroidRuntime:at java.lang.reflect.Method.invoke(Native Method)02-19 18:14:54.895 12520 12520 E AndroidRuntime:at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1230) 02-19 18:14:54.895 12520 12520 E AndroidRuntime:at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)02-19 18:14:54.975 1476 12638 E android.os.Debug:ro.product_ship = true 02-19 18:14:54.975 1476 12638 E android.os.Debug:ro.debug_level = 0x4f4c 02-19 18:14:54.975 1476 12638 E android.os.Debug: sys.mobilecare.preload = false
答案 0 :(得分:0)
尝试重新安装 cordova-plugin-inappbrowser 插件:
cordova plugin rm cordova-plugin-inappbrowser
cordova plugin add cordova-plugin-inappbrowser
在HTML中我更喜欢:
<a class="item item-icon-left" href="javascript:window.open('https://www.facebook.com/pimpolhoprodutos', '_system');">
<i class="icon ion-social-facebook"></i>
Facebook
</a>
答案 1 :(得分:0)
我希望能帮助您解决以下问题:
<a href="https://www.google.com" onclick="window.open(this.href, '_blank'); return false;">Google</a>