由于缺少64位库,因此无法构建64位版本的Ionic Android应用

时间:2019-11-27 22:07:36

标签: android cordova ionic-framework 64-bit

我们正尝试更新我们的Android应用程序,以满足Google在八月份提出的最新64位要求。我们的应用程序是使用Ionic创建的,我们正在使用

在gradle中设置ABI过滤器
process_start()

当我们尝试使用此配置运行项目时,出现以下错误:

defaultConfig {
        multiDexEnabled true
        ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
    }

我们认为我们已经将问题归结为libnative.so,因此没有64位兼容版本,但我们不确定。仅当我们使用ndk.abiFilters指定64位ABI时,才会出现该错误。尝试在其Ionic应用程序中建立64位兼容性时,是否还有其他人遇到此问题?

不确定是否需要它,但这是我们在应用程序中安装的插件列表:

2019-11-27 15:01:19.802 12444-12444/com.example.app D/AndroidRuntime: Shutting down VM 
2019-11-27 15:01:19.803 12444-12444/com.example.app E/AndroidRuntime: FATAL EXCEPTION: main 
    Process: com.example.app, PID: 12444 
    java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/base.apk", zip file "/data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/lib/arm64, /data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/base.apk!/lib/arm64-v8a, /data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_dependencies_apk.apk!/lib/arm64-v8a, /data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_0_apk.apk!/lib/arm64-v8a, /data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_1_apk.apk!/lib/arm64-v8a, /data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_2_apk.apk!/lib/arm64-v8a, /data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_3_apk.apk!/lib/arm64-v8a, /data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_4_apk.apk!/lib/arm64-v8a, /data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_5_apk.apk!/lib/arm64-v8a, /data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_6_apk.apk!/lib/arm64-v8a, /data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_7_apk.apk!/lib/arm64-v8a, /data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_8_apk.apk!/lib/arm64-v8a, /data/app/com.example.app-j3ujXrVqbu_q18iwpcdzrw==/split_lib_slice_9_apk.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find "libnative.so" 
        at java.lang.Runtime.loadLibrary0(Runtime.java:1011) 
        at java.lang.System.loadLibrary(System.java:1657) 
        at com.audiofetch.afaudiolib.bll.colleagues.NativeController.<clinit>(NativeController.java:471) 
        at com.audiofetch.afaudiolib.bll.colleagues.NativeController.get(NativeController.java:68) 
        at com.audiofetch.afaudiolib.bll.colleagues.AudioController.initAudioSubsystem(AudioController.java:326) 
        at com.audiofetch.afaudiolib.bll.colleagues.AudioController.initAudioSubsystem(AudioController.java:303) 
        at com.audiofetch.afaudiolib.bll.colleagues.AudioController.<init>(AudioController.java:142) 
        at com.audiofetch.afaudiolib.bll.colleagues.AudioController.get(AudioController.java:129) 
        at com.android.audiofetchapp.AudioFetch.initialize(AudioFetch.java:46) 
        at org.apache.cordova.CordovaPlugin.privateInitialize(CordovaPlugin.java:57) 
        at org.apache.cordova.PluginManager.getPlugin(PluginManager.java:171) 
        at org.apache.cordova.PluginManager.startupPlugins(PluginManager.java:97) 
        at org.apache.cordova.PluginManager.init(PluginManager.java:86) 
        at org.apache.cordova.CordovaWebViewImpl.init(CordovaWebViewImpl.java:115) 
        at org.apache.cordova.CordovaActivity.init(CordovaActivity.java:149) 
        at org.apache.cordova.CordovaActivity.loadUrl(CordovaActivity.java:224) 
        at com.example.app.MainActivity.onCreate(MainActivity.java:39) 
        at android.app.Activity.performCreate(Activity.java:7174) 
2019-11-27 15:01:19.803 12444-12444/com.example.app E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030) 
        at android.app.ActivityThread.-wrap11(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696) 
        at android.os.Handler.dispatchMessage(Handler.java:105) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6938) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374) 
2019-11-27 15:01:19.804 12444-12444/com.example.app E/ApplicationBase: =================================== 
2019-11-27 15:01:19.804 12444-12444/com.example.app E/ApplicationBase: An uncaught exception has occurred! 
2019-11-27 15:01:19.804 12444-12444/com.example.app E/ApplicationBase: ===================================

1 个答案:

答案 0 :(得分:0)

找出其中一个我们使用的插件,其中包含一个非64位兼容的库。一旦我们禁用了该插件,该应用便开始成功构建。