Cocos2d compilation cannot find module with tag libjpeg '

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

I followed the steps on the wiki to create a project, and I did the right thing.

The problem occurs when I run. / build _native.sh, I get this error:

Cannot find module with tag 'libjpeg' in import path 

I checked Android.mk and I believe the error is in the last 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 read these steps several times, and I did not forget (I think) anything. Can anyone who compiled the code help me?

Full error:

  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 created the project using: $ COCOS2D> create-linux-eclipse-project.sh, and I cannot open the project in eclipse so as not to compile directly using ndk from eclipse.

EXTRA2: Steps from HERE

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

+6
source share
2 answers

I followed the following steps with version 0.12.0 (2012-03-05) and worked:

1º Install Android NDK

2º Install the Android SDK

3º Android Instal Plugin for Android on Eclipse.

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

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

  • Select ID (android). If you receive a warning, it means that he cannot find the NDK.
  • the name of the project
  • It will be created in the current folder.

6º Compile the Cocos2d libraries inside the project folder using ./build_native.sh .

7º Create a new Android project from the source code in the project folder> android.

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

+5
source

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

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

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

 $(call import-module,libjpeg) $(call import-module,libpng) $(call import-module,libtiff) $(call import-module,libwebp) 
+2
source

Source: https://habr.com/ru/post/911702/


All Articles