简体   繁体   English

Phonegap使用Crosswalk在Android上崩溃构建应用程序

[英]Phonegap Build app using Crosswalk crashing on Android

My app built with Phonegap Build and using the Crosswalk plugin is crashing after a little bit of use on Android. 使用Phonegap Build构建并使用Crosswalk插件构建的应用程序在Android上稍微使用后会崩溃。 I have absolutely no idea why this is happening after constant Googling and debugging attempts. 在完全不断的谷歌搜索和调试尝试后,我完全不知道为什么会这样。 Any help is appreciated. 任何帮助表示赞赏。

My logcat output right before and after the crash: 崩溃之前和之后我的logcat输出:

D/XWalkLib(26498): Pre init xwalk core in com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve class class org.xwalk.core.XWalkPreferences to com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve method setValue to com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve class class org.xwalk.core.XWalkPreferences to com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve method setValue to com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve class class org.xwalk.core.XWalkPreferences to com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve method setValue to com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve class class org.xwalk.core.XWalkPreferences to com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve method setValue to com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve object class org.crosswalk.engine.XWalkCordovaView to com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve object class org.crosswalk.engine.XWalkCordovaResourceClient to com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve method setResourceClient to com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve object class org.crosswalk.engine.XWalkCordovaUiClient to com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve method setUIClient to com.foo.bar.fooBAR
W/ContextImpl(26498): Failed to ensure directory: /storage/extSdCard/Android/data/com.foo.bar/files
W/ContextImpl(26498): Failed to ensure directory: /storage/extSdCard/Android/data/com.foo.bar/cache
D/XWalkLib(26498): Reserve method setXWalkViewInternalVisibility to com.foo.bar.fooBAR
D/XWalkLib(26498): Reserve method setSurfaceViewVisibility to com.foo.bar.fooBAR
D/dalvikvm(26498): Trying to load lib /data/app-lib/com.foo.bar-1/libxwalkcore.so 0x42865d60
D/dalvikvm(26498): Added shared lib /data/app-lib/com.foo.bar-1/libxwalkcore.so 0x42865d60
D/dalvikvm(26498): Trying to load lib /data/app-lib/com.foo.bar-1/libxwalkdummy.so 0x42865d60
D/dalvikvm(26498): Added shared lib /data/app-lib/com.foo.bar-1/libxwalkdummy.so 0x42865d60
D/dalvikvm(26498): No JNI_OnLoad found in /data/app-lib/com.foo.bar-1/libxwalkdummy.so 0x42865d60, skipping init
D/XWalkLib(26498): Post init xwalk core in com.foo.bar.fooBAR
W/ContextImpl(26498): Failed to ensure directory: /storage/extSdCard/Android/data/com.foo.bar/cache
W/chromium(26498): [WARNING:xwalk_external_extension.cc(58)] Error loading extension '/data/app-lib/com.foo.bar-1/libxwalkcore.so': couldn't get XW_Initialize function.
W/chromium(26498): [WARNING:xwalk_extension_server.cc(412)] Failed to initialize extension: /data/app-lib/com.foo.bar-1/libxwalkcore.so
W/chromium(26498): [WARNING:xwalk_external_extension.cc(58)] Error loading extension '/data/app-lib/com.foo.bar-1/libxwalkdummy.so': couldn't get XW_Initialize function.
W/chromium(26498): [WARNING:xwalk_extension_server.cc(412)] Failed to initialize extension: /data/app-lib/com.foo.bar-1/libxwalkdummy.so

And the preferences and plugins in my config.xml file: 以及config.xml文件中的首选项和插件:

<gap:config-file platform="android" parent="/manifest/application">
    <activity android:launchMode="standard" />
  </gap:config-file>

  <preference name="permissions" value="none"/>
  <preference name="orientation" value="portrait"/>
  <preference name="target-device" value="handset"/>
  <preference name="fullscreen" value="false"/>
  <preference name="webviewbounce" value="true"/>
  <preference name="prerendered-icon" value="true"/>
  <preference name="stay-in-webview" value="false"/>
  <preference name="detect-data-types" value="true"/>
  <preference name="exit-on-suspend" value="false"/>

  <preference name="AutoHideSplashScreen" value="true"/>
  <preference name="ShowSplashScreenSpinner" value="false"/>
  <preference name="FadeSplashScreen" value="false"/>
  <preference name="SplashScreen" value="screen" />

  <preference name="disable-cursor" value="false"/>
  <preference name="android-minSdkVersion" value="14"/>
  <preference name="android-installLocation" value="auto"/>

  <preference name="StatusBarStyle" value="blacktranslucent" />
  <preference name="StatusBarOverlaysWebView" value="false" />
  <preference name="StatusBarBackgroundColor" value="#008b95" />

  <preference name="DisallowOverscroll" value="true" />
  <preference name="android-build-tool" value="gradle" />
  <preference name="UIWebViewBounce" value="false" />

  <preference name="phonegap-version" value="cli-6.1.0" />

  <platform name="android">  
    <preference name="android-versionCode" value="1" />

    <plugin name="cordova-build-architecture"      spec="https://github.com/MBuchalik/cordova-build-architecture.git#v1.0.1"     source="git" />

    <plugin name="cordova-plugin-crosswalk-webview" spec="https://github.com/crosswalk-project/cordova-plugin-crosswalk-webview.git" source="git" />
    <preference name="xwalkMode" value="embedded" />
    <preference name="xwalkVersion" value="org.xwalk:xwalk_core_library_beta:19+" />
  </platform>

  <gap:plugin name="cordova-plugin-inappbrowser" source="npm"/>
  <gap:plugin name="org.apache.cordova.console"/>
  <gap:plugin name="org.apache.cordova.device"/>
  <gap:plugin name="org.apache.cordova.dialogs" />
  <gap:plugin name="cordova-plugin-statusbar" source="npm"/>
  <gap:plugin name="cordova-plugin-splashscreen" source="npm"/>
  <gap:plugin name="pushwoosh-cordova-plugin" source="npm" />
  <gap:plugin name="nl.x-services.plugins.launchmyapp" spec="3.0" source="pgb">
    <param name="URL_SCHEME" value="mosaicties" />
  </gap:plugin>
  <plugin name="com.sharinglabs.cordova.plugin.cache" spec="1.0.0" source="pgb" />
  <plugin name="org.apache.cordova.file-transfer" spec="0.5.0" source="pgb" />
  <plugin name="com.virtualartifacts.webintent" spec="1.0.0" source="pgb" />

Any insight or help that anyone can provide would be great. 任何人都能提供的任何见解或帮助都会很棒。

the stacktrace reads: stacktrace读取:

D/dalvikvm(26498): No JNI_OnLoad found in /data/app-lib/com.foo.bar-1/libxwalkdummy.so 0x42865d60, skipping init

this either means, that the JNI Specification within the Java source is absent and subsequently leads to the Error loading extension and Failed to initialize extension errors - or it might read Failed to load native library elsewhere (probably the root cause, as the error tells). 这或者意味着Java源代码中的JNI规范不存在并且随后导致Error loading extension并且Failed to initialize extension错误 - 或者它可能读取Failed to load native library其他地方Failed to load native library (可能是根本原因,如错误所示) 。

make sure that a) native assembly gets loaded with System.loadLibrary() and b) that the JNI native interface functions have been defined. 确保a)本机程序集加载System.loadLibrary()和b)已定义JNI本机接口函数。

@see Android JNI Tips or Crosswalk's Jira . @see Android JNI TipsCrosswalk的Jira

i sugest you remove the android platform then add again. 我sugest你删除Android平台然后再添加。 Then build again. 然后重新建立。 This helped me a while ago. 这帮了我一会儿。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM