android为IBM MF上的navigator.geolocation.getCurrentPosition抛出错误 - 7.1.0.00.20161006-0540

时间:2016-10-13 14:58:36

标签: android cordova ibm-mobilefirst

在IBM Mobilefirst修订包版本7.1.0.00.20161006-0540

navigator.geolocation.getCurrentPosition(successfulcallback,errorCallback,{timeout:15000});

在Android上调用上面的代码行会破坏应用程序,导致它崩溃并出现以下错误。但这适用于iOS。

10-13 16:00:30.477:W / System.err(12229):java.lang.ClassNotFoundException:org.apache.cordova.geolocation.GeoBroker 10-13 16:00:30.477:W / System.err(12229):at java.lang.Class.classForName(Native Method) 10-13 16:00:30.477:W / System.err(12229):at java.lang.Class.forName(Class.java:251) 10-13 16:00:30.477:W / System.err(12229):at java.lang.Class.forName(Class.java:216) 10-13 16:00:30.477:W / System.err(12229):at org.apache.cordova.PluginManager.instantiatePlugin(PluginManager.java:365) 10-13 16:00:30.477:W / System.err(12229):at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:195) 10-13 16:00:30.477:W / System.err(12229):at org.apache.cordova.CordovaChromeClient.onGeolocationPermissionsShowPrompt(CordovaChromeClient.java:275) 10-13 16:00:30.477:W / System.err(12229):at com.android.webview.chromium.WebViewContentsClientAdapter.onGeolocationPermissionsShowPrompt(WebViewContentsClientAdapter.java:547) 10-13 16:00:30.477:W / System.err(12229):at com.android.org.chromium.android_webview.AwContents.onGeolocationPermissionsShowPrompt(AwContents.java:1842) 10-13 16:00:30.477:W / System.err(12229):at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) 10-13 16:00:30.477:W / System.err(12229):at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27) 10-13 16:00:30.477:W / System.err(12229):在android.os.Handler.dispatchMessage(Handler.java:102) 10-13 16:00:30.482:W / System.err(12229):在android.os.Looper.loop(Looper.java:157) 10-13 16:00:30.482:W / System.err(12229):在android.app.ActivityThread.main(ActivityThread.java:5335) 10-13 16:00:30.482:W / System.err(12229):at java.lang.reflect.Method.invokeNative(Native Method) 10-13 16:00:30.482:W / System.err(12229):at java.lang.reflect.Method.invoke(Method.java:515) 10-13 16:00:30.482:W / System.err(12229):at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1265) 10-13 16:00:30.482:W / System.err(12229):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) 10-13 16:00:30.482:W / System.err(12229):at dalvik.system.NativeStart.main(Native Method) 10-13 16:00:30.482:W / System.err(12229):引起:java.lang.NoClassDefFoundError:org / apache / cordova / geolocation / GeoBroker 10-13 16:00:30.482:W / System.err(12229):......还有18个 10-13 16:00:30.482:W / System.err(12229):引起:java.lang.ClassNotFoundException:未找到类" org.apache.cordova.geolocation.GeoBroker" on path:DexPathList [[zip file" /data/app/com.metlifeapps.metlifeus-1.apk"],nativeLibraryDirectories = [/ data / app-lib / com.metlifeapps.metlifeus-1,/ vendor / lib,/ system / lib]] 10-13 16:00:30.482:W / System.err(12229):at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67) 10-13 16:00:30.482:W / System.err(12229):at java.lang.ClassLoader.loadClass(ClassLoader.java:497) 10-13 16:00:30.482:W / System.err(12229):at java.lang.ClassLoader.loadClass(ClassLoader.java:457) 10-13 16:00:30.487:W / System.err(12229):......还有18个 10-13 16:00:30.487:I / System.out(12229):添加插件org.apache.cordova.geolocation.GeoBroker时出错。 10-13 16:00:30.487:W / System.err(12229):java.lang.NullPointerException 10-13 16:00:30.487:W / System.err(12229):at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:197) 10-13 16:00:30.487:W / System.err(12229):at org.apache.cordova.CordovaChromeClient.onGeolocationPermissionsShowPrompt(CordovaChromeClient.java:275) 10-13 16:00:30.487:W / System.err(12229):at com.android.webview.chromium.WebViewContentsClientAdapter.onGeolocationPermissionsShowPrompt(WebViewContentsClientAdapter.java:547) 10-13 16:00:30.487:W / System.err(12229):at com.android.org.chromium.android_webview.AwContents.onGeolocationPermissionsShowPrompt(AwContents.java:1842) 10-13 16:00:30.487:W / System.err(12229):at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method) 10-13 16:00:30.487:W / System.err(12229):at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27) 10-13 16:00:30.487:W / System.err(12229):在android.os.Handler.dispatchMessage(Handler.java:102) 10-13 16:00:30.487:W / System.err(12229):在android.os.Looper.loop(Looper.java:157) 10-13 16:00:30.487:W / System.err(12229):在android.app.ActivityThread.main(ActivityThread.java:5335) 10-13 16:00:30.487:W / System.err(12229):at java.lang.reflect.Method.invokeNative(Native Method) 10-13 16:00:30.487:W / System.err(12229):at java.lang.reflect.Method.invoke(Method.java:515) 10-13 16:00:30.487:W / System.err(12229):at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1265) 10-13 16:00:30.487:W / System.err(12229):at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) 10-13 16:00:30.487:W / System.err(12229):at dalvik.system.NativeStart.main(Native Method)

1 个答案:

答案 0 :(得分:1)

这是一个影响IBM MobileFirst Platform Foundation的v7.0和v7.1的已知问题 安装IFIX 7.1.0.00.20160919-1915后,PI70478应用程序在安卓设备上失败

在通过iFix修复之前,您可以通过从Android项目中生成的config.xml中删除以下内容来解决此问题:

<feature name="Geolocation">
    <param name="android-package" value="org.apache.cordova.geolocation.GeoBroker" />
</feature>