Can anyone confirm current operability of Cocos2d-x on Ubuntu?

Your project cocos library is using android API 23, normally call API 10 like in mine, I changed my to be like yours and I got the same errors. I think that you only need to download the android API 10 on your android SDK manager, and change project.properties of:
> /home/user/CocosProjects/MyGame/cocos2d/cocos/platform/android/java

change this:
> target=android-23

to this:

target=android-10

I have ‘target=android-10’, I created project from the beginning, now on AVD I have message that application has stopped unexpectedly.

Nice, now you have to check if your AVD has the Use Host GPU checked.

Yes, it is

Can you show your AVD details?

The CPU is ARM?

tried both ARM and Intel

and in eclipse I have this:

Change your CPU/ABI to ARM.

Or

Include on Applicantion.mk
> APP_ABI := armeabi armeabi-v7a x86

These are common Eclipse errors, you only have to clean your project.

Try create an AVD with a target API 17 or greater with CPU/ABI ARM. AVD’s aren’t best choice, try to use a real device just to check if the problem is on AVD or in your project.

I suggest to use Android-Studio instead Eclipse. Currently cocos2d has generated android-studio project. :smiley:

Cleaning doesn’t help:

On a real device application works (but interface is displaced, and button with ‘turn off/on’ image does nothing - don’t know if it’s normal for initial project).
I need it working on AVD (because I should check if application’s interface displayed properly on different screens).
(ARM works only without using Host GPU)
With Android 4.2.2 appears this message (with interval): com.android.phone has stopped.
I tried API10 and 17 with Intel and ARM, with/without Host GPU, tried to replace SDK with newly unpacked there are always message: MyGame unexpectedly has stopped.

It is normal your interface be a lot strange at first, you will need to work on design resolutions, for this I suggest you to use:

Sonar Systems Tutorials - Cocos2d-x Multi Device 2.0 Tutorial Series.
Cocos2d-x Wiki: MULTI-RESOLUTION SUPPORT and DETAILED EXPLANATION OF COCOS2D-X MULTI-RESOLUTION ADAPTATION.

After you understand how it works, you will not need to test your project every time on various devices.

Normally the button works, but this is just to be an example and most of the time I delete it.

You don’t have to use Eclipse, it is has too much bug’s, I agree that is best to use Android-Studio instead of Eclipse, in Linux I prefer to use Qt-Creator or KDEvelop as IDE to develop to Linux, it is fast and much more stable, using the benefits of cross-platform powers of Cocos2d-x, after the game is work on Linux, I try to run on Android devices, open the project on Eclipse or Android-Studio just to adjust the Android details.

Thanks, today with API 22 I’ve got this error:

Installing on device
running: '/home/user/android-sdk/platform-tools/adb uninstall com.MyCompany.MyGame'

Failure [DELETE_FAILED_INTERNAL_ERROR]
running: '/home/user/android-sdk/platform-tools/adb install "/home/user/CocosProjects/MyGame/bin/debug/android/MyGame-debug.apk"'

5806 KB/s (3634337 bytes in 0.611s)
	pkg: /data/local/tmp/MyGame-debug.apk
Failure [INSTALL_FAILED_NO_MATCHING_ABIS]
Starting application.
running: '/home/user/android-sdk/platform-tools/adb shell am start -n "com.MyCompany.MyGame/org.cocos2dx.cpp.AppActivity"'

Starting: Intent { cmp=com.MyCompany.MyGame/org.cocos2dx.cpp.AppActivity }
Error type 3
Error: Activity class {com.MyCompany.MyGame/org.cocos2dx.cpp.AppActivity} does not exist.

This is related with CPU of your device/AVD http://stackoverflow.com/questions/24572052/install-failed-no-matching-abis-when-install-apk

How can I compile for another architecture ?

For example to include ARM:

APP_ABI := armeabi

But you need to search on Google, this is not related with your first question…

Why don’t you build for desktop ? You can change screen size.

1 Like