Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

cocos2d-xのAndroidNdkのバージョンについて

More than 3 years have passed since last update.

Env

  • cocos2d-x 3.14.1

Probrem

新しい環境を作成してビルドしたら以下のようなエラーで
アプリがクラッシュした

03-22 17:05:29.447 8837-8837/org.cocos2dx.hellolua E/AndroidRuntime: FATAL EXCEPTION: main
                                                                     Process: org.cocos2dx.hellolua, PID: 8837
                                                                     java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.cocos2dx.hellolua-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libcocos2dlua.so"
                                                                         at java.lang.Runtime.loadLibrary(Runtime.java:366)
                                                                         at java.lang.System.loadLibrary(System.java:989)
                                                                         at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:248)
                                                                         at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:264)
                                                                         at android.app.Activity.performCreate(Activity.java:5933)
                                                                         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
                                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
                                                                         at android.app.ActivityThread.access$800(ActivityThread.java:144)
                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
                                                                         at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                         at android.os.Looper.loop(Looper.java:135)
                                                                         at android.app.ActivityThread.main(ActivityThread.java:5221)
                                                                         at java.lang.reflect.Method.invoke(Native Method)
                                                                         at java.lang.reflect.Method.invoke(Method.java:372)
                                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

原因はAndroidStudioが最新のndk(android-ndk-r14)を
ダウンロードして適用していたためだった。

わかっていたけど、やっぱり最新のcocosでも
ndkは古いやつを使わないとダメみたい

参照しているndkをr14からr9にすることでビルドが成功した

tani-shi
フリーのソシャゲ開発のエンジニアです。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away