简体   繁体   English

PID:15208 java.lang.UnsatisfiedLinkError:dalvik.system.PathClassLoader

[英]PID: 15208 java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader

I have just started learning cocos2d-x-3.11.1 in android studio (trying to compile with native C++ language) and I am getting this following error and a message on my phone "Unfortunately libcocos2dx has stopped" 我刚刚开始在android studio中学习cocos2d-x-3.11.1(尝试用本机C ++语言编译),我收到以下错误并在手机上显示一条消息"Unfortunately libcocos2dx has stopped"

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.granjur.org-1/base.apk"],nativeLibraryDirectories=[/data/app/com.granjur.org-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libMyGame.so"

I have configured NDK , SDK and the ANT folders correctly from command line. 我从命令行正确配置了NDKSDKANT文件夹。 I've been stuck with this from last two days! 过去两天我一直坚持这个!

AndroidManifest.xml AndroidManifest.xml中

<uses-feature android:glEsVersion="0x00020000" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher">

        <!-- Tell Cocos2dxActivity the name of our .so -->
        <meta-data android:name="android.app.lib_name"
                   android:value="MyGame" />

        <activity
            android:name="org.cocos2dx.cpp.AppActivity"
            android:screenOrientation="landscape"
            android:configChanges="orientation|keyboardHidden|screenSize"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

    <uses-permission android:name="android.permission.INTERNET"/>

</manifest>

logcat: logcat的:

06-20 10:58:32.922 15649-15649/com.granjur.org E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.granjur.org, PID: 15649
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.granjur.org-1/base.apk"],nativeLibraryDirectories=[/data/app/com.granjur.org-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libMyGame.so"
at java.lang.Runtime.loadLibrary(Runtime.java:367)
at java.lang.System.loadLibrary(System.java:1076)
at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:246)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:260)
at android.app.Activity.performCreate(Activity.java:6251)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5422)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
    06-20 10:59:39.226 15649-15649/com.granjur.org I/Process: Sending signal. PID: 15649 SIG: 9

Any help would be highly appreciated! 任何帮助将非常感谢! Thank you! 谢谢!

在游戏目录中运行此命令以编译源一次:

cocos compile -p android --android-studio

Finally I have a genuine solution to the above problem for users working on android studio project of cocos2dx 3.8.1 above. 最后,对于上面cocos2dx 3.8.1的android studio项目的用户,我有一个真正的解决方案。

Just add this line in Application.mk :) 只需在Application.mk中添加此行:)

 APP_ABI := armeabi-v7a

Sample Application.mk file : 示例Application.mk文件:

APP_STL := gnustl_static

APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -std=c++11 -fsigned-char
APP_LDFLAGS := -latomic


ifeq ($(NDK_DEBUG),1)
  APP_CPPFLAGS += -DCOCOS2D_DEBUG=1
  APP_OPTIM := debug
  APP_ABI := armeabi-v7a
else
  APP_CPPFLAGS += -DNDEBUG
  APP_OPTIM := release
  APP_ABI := armeabi-v7a

endif

The main problem was the device architecture compatibility with your application. 主要问题是设备架构与您的应用程序的兼容性。 We need to give exclusive support to devices with ARM architecture armeabi-v7a when running proj.android-studio. 运行proj.android-studio时,我们需要为ARM架构armeabi-v7a的设备提供独家支持。

Hope this will help many other like me. 希望这会帮助像我这样的许多其他人。

暂无
暂无

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

相关问题 java.lang.UnsatisfiedLinkError:dalvik.system.PathClassLoader - java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader java.lang.UnsatisfiedLinkError:dalvik.system.PathClassLoader [DexPathList - java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList Android java.lang.UnsatisfiedLinkError dalvik.system.PathClassLoader - Android java.lang.UnsatisfiedLinkError dalvik.system.PathClassLoader 启用proguard功能后,崩溃:java.lang.UnsatisfiedLinkError:dalvik.system.PathClassLoader - after enable proguard feature, crash: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader java.lang.UnsatisfiedLinkError:无法从加载程序dalvik.system.PathClassLoader加载echoprint-jni - java.lang.UnsatisfiedLinkError: Couldn't load echoprint-jni from loader dalvik.system.PathClassLoader java.lang.UnsatisfiedLinkError:dalvik.system.PathClassLoader [DexPathList ...]找不到“libdetection_based_tracker.so” - java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList…] couldn't find “libdetection_based_tracker.so” 由以下原因引起:java.lang.UnsatisfiedLinkError:无法从加载器dalvik.system.PathClassLoader findLibrary加载gnustl_shared返回null - Caused by: java.lang.UnsatisfiedLinkError: Couldn't load gnustl_shared from loader dalvik.system.PathClassLoader findLibrary returned null java.lang.UnsatisfiedLinkError:无法从加载程序dalvik.system.PathClassLoader加载NativeMorphoSmartSDK_6.13.2.0-4.1 - java.lang.UnsatisfiedLinkError: Couldn't load NativeMorphoSmartSDK_6.13.2.0-4.1 from loader dalvik.system.PathClassLoader java.lang.UnsatisfiedLinkError:无法从加载程序dalvik.system.PathClassLoader加载和enginephysicsbox2dextension…findLibrary返回null - java.lang.UnsatisfiedLinkError: Couldn't load andenginephysicsbox2dextension from loader dalvik.system.PathClassLoader… findLibrary returned null 无法加载vlcjni库:java.lang.UnsatisfiedLinkError:dalvik.system.PathClassLoader [DexPathList找不到“ libvlcjni.so” - Can't load vlcjni library: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList couldn't find “libvlcjni.so”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM