简体   繁体   English

无法加载游戏:findLibrary返回null:使用cocos2d-x,尽管尝试了很多次但没有成功?

[英]Couldn't load game: findLibrary returned null: with cocos2d-x, no success despite many attempts?

I would like to try a simple project using Eclipse Mobile For Developers, the NDK, Android SDK, and Cocos2d-x. 我想尝试一个使用Eclipse Mobile For Developers,NDK,Android SDK和Cocos2d-x的简单项目。

I have correctly set the paths in: cocos2d-x/create-android-project.sh : 我已正确设置路径:cocos2d-x / create-android-project.sh:

NDK_ROOT_LOCAL="/Users/Empon/android-ndk-r8e"
ANDROID_SDK_ROOT_LOCAL="/Users/Empon/android"

and in the settings in Eclipse ("NDK path" from the Properties). 并在Eclipse中的设置中(“属性”中的“NDK路径”)。

I followed the topics in stackoverflow but I can't make my project work. 我遵循stackoverflow中的主题,但我无法使我的项目工作。 One thing that seems strange compared to one topic: I don't have anything below "libs". 与一个主题相比,有一点似乎很奇怪:我在“libs”下面没有任何东西。

I am on Mac Lion 10.7.4 (I downloaded the 64bit version of Eclipse), I have got no error in the project, the only errors are when I run the app on android (4.0.4, Alcatel ot 997), with these errors (here is a summary from 2 attempts): 我在Mac Lion 10.7.4(我下载了64位版本的Eclipse),我在项目中没有错误,唯一的错误是当我在android(4.0.4,Alcatel ot 997)上运行应用程序时,这些错误(这里是2次尝试的摘要):

04-22 22:19:09.079: E/AndroidRuntime(14321): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load game: findLibrary returned null
04-22 22:19:09.079: E/AndroidRuntime(14321):    at java.lang.Runtime.loadLibrary(Runtime.java:365)
04-22 22:19:09.079: E/AndroidRuntime(14321):    at java.lang.System.loadLibrary(System.java:535)
04-22 22:19:09.079: E/AndroidRuntime(14321):    at com.first.cocos2dx.samplecocos2dxandroid.<clinit>(samplecocos2dxandroid.java:37)

Would you know anything about this? 你对此有所了解吗?

Thanks a lot 非常感谢

(source: http://www.raywenderlich.com/11283/cocos2d-x-for-ios-and-android-getting-started ) (来源: http//www.raywenderlich.com/11283/cocos2d-x-for-ios-and-android-getting-started


EDIT: 编辑:

I have this issue now, after exporting correctly NDK_ROOT : ndk-build: No such file or directory ! 在正确导出NDK_ROOT后,我现在遇到了这个问题: ndk-build: No such file or directory

export NDK_ROOT=/Users/Empon/android-ndk-r8e/ndk-build: No such file or directory export NDK_ROOT = / Users / Empon / android-ndk-r8e / ndk-build:没有这样的文件或目录

But the file does exist in android-ndk-r8e ... so, I double clicked on the file, it said define the NDK_PROJECT_PATH variable : 但是文件确实存在于android-ndk-r8e ......所以,我双击了该文件,它说define the NDK_PROJECT_PATH variable

Empon$ /Users/Empon/android-ndk-r8e/ndk-build ; exit;
Android NDK: Could not find application project directory !    
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.    
/Users/Empon/android-ndk-r8e/build/core/build-local.mk:130: *** Android NDK: Aborting

I have tried this in the Terminal : 我在终端试过这个:

in the Terminal : 在终端:

Empon$ export NDK_PROJECT_PATH=/Users/Empon/cocos2d-x/Monday3/ >> .bash_profile
Empon$ ./build_native.sh
NDK_ROOT = :/Users/Empon/android-ndk-r8e >> .bash_profile
export NDK_ROOT=/Users/Empon/android-ndk-r8e
COCOS2DX_ROOT = /Users/Empon/cocos2d-x/Monday3/proj.android/../..
APP_ROOT = /Users/Empon/cocos2d-x/Monday3/proj.android/..
APP_ANDROID_ROOT = /Users/Empon/cocos2d-x/Monday3/proj.android
Using prebuilt externals
./build_native.sh: line 89: :/Users/Empon/android-ndk-r8e >> .bash_profile
export NDK_ROOT=/Users/Empon/android-ndk-r8e/ndk-build: No such file or directory

or just change the path in Android.mk : 或者只是更改Android.mk中的路径:

#LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../Classes                   
LOCAL_C_INCLUDES := $(LOCAL_PATH)/Classes

But still the same error with the Terminal... Any idea? 但终端仍然出现同样的错误......有什么想法吗?

我认为你没有运行build_native.sh脚本

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

相关问题 UnsatisfiedLinkError无法加载游戏-Android上的cocos2d-x - UnsatisfiedLinkError couldn't load game - cocos2d-x on Android UnsatisfiedLinkError:无法加载cocos2dcpp:findLibrary返回null - UnsatisfiedLinkError: Couldn't load cocos2dcpp: findLibrary returned null 工作的Eclipse Cocos2dx android项目突然给出java.lang.UnsatisfiedLinkError:无法加载游戏:findLibrary返回null - Working Eclipse Cocos2dx android project suddenly giving java.lang.UnsatisfiedLinkError: Couldn't load game: findLibrary returned null 无法加载libfoo:findLibrary返回null - Couldn't load libfoo: findLibrary returned null 无法加载GLMapCore:findLibrary返回null - Couldn't load GLMapCore: findLibrary returned null 无法加载mupdf:findLibrary返回null - Couldn't load mupdf: findLibrary returned null Android Studio 1.3 java.lang.UnsatisfiedLinkError:无法加载cocos2dcpp:findLibrary返回null - Android Studio 1.3 java.lang.UnsatisfiedLinkError: Couldn't load cocos2dcpp: findLibrary returned null Android - &#39;无法加载Foo:findLibrary返回null&#39; - Android - 'Couldn't load Foo: findLibrary returned null' 无法加载lept从loader findLibrary返回null? - Couldn't load lept from loader findLibrary returned null? 无法加载jnifftw3:findLibrary返回null - Couldn't load jnifftw3: findLibrary returned null
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM