Hi All, I’m having some issue building for android with the latests 3.6. I’ve even tried with a fresh project to eliminate any of my mistakes. Here’s what I’ve done.
Create New Project :
cocos new -l cpp -p com.tee.test Test
Running command: new
Copy template into /Users/Rick/Projects/cocos/Test
Copying cocos2d-x files...
Rename project name from 'HelloCpp' to 'Test'
Replace the project name from 'HelloCpp' to 'Test'
Replace the project package name from 'org.cocos2dx.hellocpp' to 'com.tee.test'
Replace the mac bundle id from 'org.cocos2dx.hellocpp' to 'com.tee.test'
Replace the ios bundle id from 'org.cocos2dx.hellocpp' to 'com.tee.test'
Attempt to compile for android :
cd Test/
cocos compile -p android
Running command: compile
Building mode: debug
Android platform not specified, searching a default one...
running: '/Users/Rick/Library/Developer/android-sdk-macosx/tools/android update project -t android-22 -p /Users/Rick/Projects/cocos/Test/proj.android'
Updated project.properties
Updated local.properties
Updated file /Users/Rick/Projects/cocos/Test/proj.android/proguard-project.txt
GoogleInc.:GoogleAPIs:22 is not a valid android target platform.
Note The error : GoogleInc.:GoogleAPIs:22 is not a valid android target platform.
I verified my env setup:
ANDROID_SDK_ROOT=/Users/Rick/Library/Developer/android-sdk-macosx
COCOS_CONSOLE_ROOT=/Applications/Cocos/frameworks/cocos2d-x-3.6/tools/cocos2d-console/bin
COCOS_TEMPLATES_ROOT=/Applications/Cocos/frameworks/cocos2d-x-3.6/templates
ANT_ROOT=/Applications/Cocos/tools/ant/bin
COCOS_FRAMEWORKS=/Applications/Cocos/frameworks
NDK_ROOT=/Users/Rick/Library/Developer/android-ndk-r9d
I’ve verified all these paths exist.
Next I checked the available android targets via :
android list target
returns :
Available Android targets:
----------
id: 1 or "android-22"
Name: Android 5.1.1
Type: Platform
API level: 22
Revision: 2
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : android-tv/armeabi-v7a, android-tv/x86, default/armeabi-v7a, default/x86, default/x86_64
----------
id: 2 or "Google Inc.:Google APIs:22"
Name: Google APIs
Type: Add-On
Vendor: Google Inc.
Revision: 1
Description: Android + Google APIs
Based on Android 5.1.1 (API level 22)
Libraries:
* com.android.future.usb.accessory (usb.jar)
API for USB Accessories
* com.google.android.media.effects (effects.jar)
Collection of video effects
* com.google.android.maps (maps.jar)
API for Google Maps
Skins: HVGA, QVGA, WQVGA400, WQVGA432, WSVGA, WVGA800 (default), WVGA854, WXGA720, WXGA800, WXGA800-7in
Tag/ABIs : google_apis/armeabi-v7a, google_apis/x86, google_apis/x86_64
indent preformatted text by 4 spaces
The Android SDK manager GUI also shows version 22 installed. Everything seems in order to me, I am rather new at android dev, so I may be missing something obvious. The only thing I noted, that seemed odd is that in the error, GoogleInc.:GoogleAPIs:22 is not a valid android target platform.
, the whitespace seems to be stripped from the target name compared to what android list target
returns. I seems the only file that makes reference to the api is :
cocos2d/cocos/platform/android/java/project.properties
which contains whitespace that matches android list target
:
target=Google Inc.:Google APIs:22
Any thoughts on what I might be doing wrong?
Thanks
Rick