cocos2d-x 3.0 android/asset_manager.h

hi,

I followed the instructions in the readme. (android eclipse)
then created the multi plattform project.

But if i build it, i get following error:
fatal error: android/asset_manager.h: No such file or directory CCFileUtilsAndroid.h /test/cocos2dx/platform/android line 34 C/C++ Problem

How to fix this?

greets

I was able to fix this by raplcing it with:

#include “…/…/…/CocosDenshion/android/opensl/android/asset_manager.h”
#include “…/…/…/CocosDenshion/android/opensl/android/asset_manager_jni.h”

Now I have a new error:
undefined reference to ‘AAsset_*’

I tried to add following to the makefile (from google)
LOCAL_LDLIBS += landroid
But it can not find
landroid

Here is the actual console output from the makefile.
I am not able to fix it myself :confused:

./build_native.sh 
The Selected NDK toolchain version was 4.8 !
NDK_ROOT = /home/user/coding/sdk/android-ndk
COCOS2DX_ROOT = /home/user/coding/cocos2d-x/projects/MyApp/proj.android/../../..
APP_ROOT = /home/user/coding/cocos2d-x/projects/MyApp/proj.android/..
APP_ANDROID_ROOT = /home/user/coding/cocos2d-x/projects/MyApp/proj.android
Using prebuilt externals
Android NDK: WARNING:/home/user/coding/cocos2d-x/projects/MyApp/proj.android/../../../cocos2dx/Android.mk:cocos2dx_static: LOCAL_LDLIBS is always ignored for static libraries    
make: Entering directory `/home/user/coding/cocos2d-x/projects/MyApp/proj.android'
SharedLibrary  : libcocos2dcpp.so
/home/user/coding/sdk/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -landroid
/home/user/coding/sdk/android-ndk/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: cannot find -landroid
/home/user/coding/cocos2d-x/projects/MyApp/proj.android/../../../cocos2dx/platform/android/CCFileUtilsAndroid.cpp:104: error: undefined reference to 'AAssetManager_open'
/home/user/coding/cocos2d-x/projects/MyApp/proj.android/../../../cocos2dx/platform/android/CCFileUtilsAndroid.cpp:108: error: undefined reference to 'AAsset_close'
/home/user/coding/cocos2d-x/projects/MyApp/proj.android/../../../cocos2dx/platform/android/CCFileUtilsAndroid.cpp:45: error: undefined reference to 'AAssetManager_fromJava'
/home/user/coding/cocos2d-x/projects/MyApp/proj.android/../../../cocos2dx/platform/android/CCFileUtilsAndroid.cpp:185: error: undefined reference to 'AAssetManager_open'
/home/user/coding/cocos2d-x/projects/MyApp/proj.android/../../../cocos2dx/platform/android/CCFileUtilsAndroid.cpp:191: error: undefined reference to 'AAsset_getLength'
/home/user/coding/cocos2d-x/projects/MyApp/proj.android/../../../cocos2dx/platform/android/CCFileUtilsAndroid.cpp:195: error: undefined reference to 'AAsset_read'
/home/user/coding/cocos2d-x/projects/MyApp/proj.android/../../../cocos2dx/platform/android/CCFileUtilsAndroid.cpp:201: error: undefined reference to 'AAsset_close'
collect2: error: ld returned 1 exit status
make: *** [obj/local/armeabi/libcocos2dcpp.so] Error 1
make: Leaving directory `/home/user/coding/cocos2d-x/projects/MyApp/proj.android'

Same output if I try to build the TestCpp sample project.

make sure you are targeting android api 2.3+

open local.properties and see if target equals android-9 or above. You probably don’t have android-9 download since i don’t think its available anymore, so change it to android-10

sorry it project.properties not local.properties