Prebuild for android not working on mac machine

Prebuild for android not working on mac machine
0

#1

hi i am using android studio 3.2 and lastest ndk and when i am trying to generate prebuild cocos2d-x libs from my mac i am unable to generate prebuild libs for android but its working fine for ios can someone please tell me whats wrong in my setup.

  1. android studio 3.2
    2, gradle 3.1
  2. latest ndk version

getting the below error using command cocos gen-libs -p android -m release

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘proj.android’.

Could not resolve all artifacts for configuration ‘:classpath’.
Could not resolve org.apache.httpcomponents:httpmime:4.1.
Required by:
project : > com.android.tools.build:gradle:3.1.0 > com.android.tools.build:gradle-core:3.1.0 > com.android.tools.build:builder:3.1.0 > com.android.tools:sdklib:26.1.0
Could not resolve org.apache.httpcomponents:httpmime:4.1.
Could not get resource ‘https://jcenter.bintray.com/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.pom’.
Could not HEAD ‘https://jcenter.bintray.com/org/apache/httpcomponents/httpmime/4.1/httpmime-4.1.pom’.
Connection reset
Could not resolve commons-logging:commons-logging:1.1.1.
Required by:
project : > com.android.tools.build:gradle:3.1.0 > com.android.tools.build:gradle-core:3.1.0 > com.android.tools.build:builder:3.1.0 > com.android.tools:sdklib:26.1.0 > org.apache.httpcomponents:httpclient:4.2.6
Could not resolve commons-logging:commons-logging:1.1.1.
Could not get resource ‘https://jcenter.bintray.com/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom’.
Could not HEAD ‘https://jcenter.bintray.com/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom’.
Connection reset

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.6/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 10s
VCS Checkout Cache (/Users/manish/Documents/crossPlatfrom/cocos2d-x-3.2/tests/cpp-empty-test/proj.android/.gradle/vcsWorkingDirs) has not been cleaned up in 0 days
Error running command, return code: 1.
Error running command, return code: 14.


#2

updating jdk resolve above error but now i am stuck with this issue using prebuild (i am using ndk 16 name of folder is just a reference folder)

**command i am using >**cocos gen-libs -p android

error=> FAILURE: Build failed with an exception.

  • What went wrong:

Execution failed for task ‘:CppEmptyTest:generateJsonModelDebug’.

> Build command failed.

Error while executing process /Users/manish/Documents/crossPlatfrom/android-ndk-r9d/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/manish/Documents/crossPlatfrom/cocos2d-x-3.2/tests/cpp-empty-test/proj.android/app/jni/Android.mk NDK_APPLICATION_MK=/Users/manish/Documents/crossPlatfrom/cocos2d-x-3.2/tests/cpp-empty-test/proj.android/app/jni/Application.mk APP_ABI=x86 NDK_ALL_ABIS=x86 NDK_DEBUG=1 APP_PLATFORM=android-16 NDK_OUT=/Users/manish/Documents/crossPlatfrom/cocos2d-x-3.2/tests/cpp-empty-test/proj.android/app/build/intermediates/ndkBuild/debug/obj NDK_LIBS_OUT=/Users/manish/Documents/crossPlatfrom/cocos2d-x-3.2/tests/cpp-empty-test/proj.android/app/build/intermediates/ndkBuild/debug/lib NDK_TOOLCHAIN_VERSION=clang -j4 NDK_MODULE_PATH=/Users/manish/Documents/crossPlatfrom/cocos2d-x-3.2:/Users/manish/Documents/crossPlatfrom/cocos2d-x-3.2/cocos:/Users/manish/Documents/crossPlatfrom/cocos2d-x-3.2/external NDK_DEBUG=1 APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}

/Users/manish/Documents/crossPlatfrom/android-ndk-r9d/build/core/build-binary.mk:693: Android NDK: Module cpp_empty_test_shared depends on undefined modules: cc_static

/Users/manish/Documents/crossPlatfrom/android-ndk-r9d/build/core/build-binary.mk:706: *** Android NDK: Aborting (set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies) . Stop.

  • Try:

Run with –stacktrace option to get the stack trace. Run with –debug option to get more log output. Run with –scan to get full insights.


#3

Gen-libs is no longer. Use Cmake.


#4

i don’t know anything about cmake it would be helpfull if you provide some reference link


#5

http://docs.cocos2d-x.org/cocos2d-x/en/installation/CMake-Guide.html


#6

thank you so much its really easy to compile new project for both android and ios using cmake

  1. just updated Gradle version 3.2.0 to 3.2.1 and project running smoothly on android