Java.lang.UnsatisfiedLinkError nativeSetApkPath (version 3.1.1)

I am sorry if you look this post and could not see the XML the display was somewhat broken.

Please answer these questions to help fix this issue:
What’s the issue?
java.lang.UnsatisfiedLinkError: Native method not found: org.cocos2dx.lib.Cocos2dxHelper.nativeSetApkPath

when testing
What’s the engine version? version 3.1.1, using eclipse, android

Activity has been modified and cause the problem. By the way if you look in the log you will notice an exception and this is the real cause. But the colour of the font might make you ignore it.

Problem: your manifest has to be modified. meta-data has to be move out of activity
because in this version the meta data are retrieved from application instead of the activity. Not to sure why this was changed but here is the fix.

Instead of:

    <activity android:name=".AppActivity"
              android:label="@string/app_name"
              android:screenOrientation="landscape"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
              android:configChanges="orientation">
        <meta-data android:name="android.app.lib_name"
                   android:value="testlua" />
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

Use:

        <meta-data android:name="android.app.lib_name"
                   android:value="testlua" />
    <activity android:name=".AppActivity"
              android:label="@string/app_name"
              android:screenOrientation="landscape"
              android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
              android:configChanges="orientation">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
1 Like

cocos2dx 3.2 我也遇到了这个问题,为什么按你的方法改了,不出错了,但是黑屏

@Tesla So what you did for it ?