Compiling cocos2d cannot find module with tag 'libjpeg'
Asked Answered
A

2

6

I have installed correctly the Android SDK, Android NDK, eclipse, and I have the last repository's cocos2d from git.

I have followed the steps in the wiki to generate a project and I have done correctly.

The problem comes when I run ./build_native.sh, I get this error:

 Cannot find module with tag 'libjpeg' in import path

I have checked the Android.mk, and I suppose that the error is in the final zone:

LOCAL_WHOLE_STATIC_LIBRARIES := cocos_libpng_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_jpeg_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libxml2_static

# define the macro to compile through support/zip_support/ioapi.c                
LOCAL_CFLAGS := -DUSE_FILE32API

include $(BUILD_SHARED_LIBRARY)

$(call import-module,libjpeg)
$(call import-module,libpng)
$(call import-module,libxml2)

I have read the steps several times, and I didn't forget (I think) anything. Could someone who have been compiled the code help me please?

The complete error is:

Android NDK: jni/../../../cocos2dx/Android.mk: Cannot find module with tag 'libjpeg' in import path    
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?    
Android NDK: The following directories were searched:    
Android NDK:         
make: Entering directory `/home/pipero/git_checkout/cocos2d-x/PiperoStest/android'

Thanks in advance.

EXTRA: I have created the project using the: $COCOS2D>create-linux-eclipse-project.sh and i can't open the project in eclipse neither to compile using ndk from eclipse directly.

EXTRA2: The steps are from HERE

EXTRA3: I already changed the NDK_ROOT_LOCAL="$LIBS/android-ndk-r7b" ANDROID_SDK_ROOT_LOCAL="$LIBS/android-sdk-linux"

Apus answered 26/3, 2012 at 21:58 Comment(2)
You can try to add manualy cocos2dx/platform/third_party/android/prebuilt to your NDK_MODULE_PATH environment variable.Ruder
Thanks for the comment, i have try to put it on cocos2d-x, but no in NDK_MODULE_PATH, trying...Apus
C
5

I followed steps below with version 0.12.0 (2012-03-05) and it worked:

1º Install NDK Android

2º Install SDK Android

3º Instal Android plug-in on Eclipse.

4º Download ./create-android-project.sh with NDK and SDK paths.

5º Compile a new project with ./create-linux-eclipse-project.sh

  • Choose ID (android). If you get a warning that means it cannot find NDK.
  • Name of the project
  • It'll be create on current folder.

6º Compile Cocos2d libs inside project folder with ./build_native.sh.

7º Create new Android project from source code in project's folder > android.

8º Run the project and it should appear Cocos2d wallpaper.

Clemmieclemmons answered 28/3, 2012 at 7:11 Comment(0)
R
2

I fixed this by adding the following to Android.mk in the cocos2d directory:

$(call import-add-path, $(LOCAL_PATH)/platform/third_party/android/prebuilt)

This was added just before this section, which is at the bottom of the file:

$(call import-module,libjpeg)
$(call import-module,libpng)
$(call import-module,libtiff)
$(call import-module,libwebp)
Ratafia answered 4/3, 2014 at 17:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.