Android ART/Dalvik

http://developer.android.com/preview/index.html

cocos2dx-3.3 alpha AssetsManager has crashed in Android L using ART.

older version(3.2~) is OK.

What’s wrong with 3.3

I don’t remember what’s modified.
I will check it.
Another thing is that, there will be more powerful AssetsManager in v3.3.

Thanks to reply. I’ll waiting for you.
in Dalvik machine, no problem.
but only Android L has crashed.
It was caused by ART.

I don’t have device that has Android L. I am not sure if i can update my machine to Android L or not.

Hi. zhangxm.
I have two devices, Nexus5 and GalaxyS5.
Nexus5 can install AndroidL, then I found that problem this device.
and
GalaxyS5 was installed android kitkat 4.4.x
after Kitkat, some device can switch ART/Dalvik.
Then I try GalaxyS5 set to ART, no problem about that issue.

I think AndroidL has some bugs.
Thanks to reply, have a nice day.

Thanks.
Could you paster error message?

I’m sorry, I can’t get any useful log.
because, crash reason was just ANR
like follow.

09-15 14:39:59.663: E/WifiHAL(767): Error polling socket
09-15 14:40:01.917: E/ActivityManager(767): PID: 26448
09-15 14:40:01.917: E/ActivityManager(767): Reason: Input dispatching timed out (Waiting because the touched window has not finished processing the input events that were previously delivered to it.)
09-15 14:40:01.917: E/ActivityManager(767): Load: 11.4 / 10.01 / 9.66
09-15 14:40:01.917: E/ActivityManager(767): CPU usage from 1061ms to -4077ms ago with 99% awake:
09-15 14:40:01.917: E/ActivityManager(767):   43% 767/system_server: 19% user + 23% kernel / faults: 2075 minor
09-15 14:40:01.917: E/ActivityManager(767):   0% 183/debuggerd: 0% user + 0% kernel / faults: 2219 minor
09-15 14:40:01.917: E/ActivityManager(767):   4.3% 1118/com.android.phone: 2.1% user + 2.1% kernel / faults: 560 minor
09-15 14:40:01.917: E/ActivityManager(767):   1.7% 26448/com.malangstudio.alarmmon: 1% user + 0.6% kernel / faults: 422 minor
09-15 14:40:01.917: E/ActivityManager(767):   0.2% 1101/com.android.nfc: 0.1% user + 0.1% kernel / faults: 304 minor
09-15 14:40:01.917: E/ActivityManager(767):   0.8% 881/com.android.systemui: 0.5% user + 0.2% kernel / faults: 165 minor
09-15 14:40:01.917: E/ActivityManager(767):   0.9% 176/logd: 0.9% user + 0% kernel / faults: 78 minor
09-15 14:40:01.917: E/ActivityManager(767):   0.7% 1421/mpdecision: 0% user + 0.7% kernel
09-15 14:40:01.917: E/ActivityManager(767):   0.5% 204/adbd: 0% user + 0.5% kernel / faults: 60 minor
09-15 14:40:01.917: E/ActivityManager(767):   0.3% 95/irq/362-s3350: 0% user + 0.3% kernel
09-15 14:40:01.917: E/ActivityManager(767):   0% 1137/com.android.telecomm: 0% user + 0% kernel / faults: 296 minor
09-15 14:40:01.917: E/ActivityManager(767):   0.3% 3440/com.nhn.android.music: 0% user + 0.3% kernel / faults: 51 minor
09-15 14:40:01.917: E/ActivityManager(767):   0% 3/ksoftirqd/0: 0% user + 0% kernel
09-15 14:40:01.917: E/ActivityManager(767):   0% 7/kworker/u:0H: 0% user + 0% kernel
09-15 14:40:01.917: E/ActivityManager(767):   0% 123/dhd_dpc: 0% user + 0% kernel
09-15 14:40:01.917: E/ActivityManager(767):   0.1% 195/sensors.qcom: 0.1% user + 0% kernel
09-15 14:40:01.917: E/ActivityManager(767):   0% 1080/com.redbend.vdmc: 0% user + 0% kernel / faults: 74 minor
09-15 14:40:01.917: E/ActivityManager(767):   0% 8068/logcat: 0% user + 0% kernel
09-15 14:40:01.917: E/ActivityManager(767):   0.1% 27258/org.cocos2dx.cpp_tests: 0.1% user + 0% kernel
09-15 14:40:01.917: E/ActivityManager(767):   0.1% 28474/kworker/0:0H: 0% user + 0.1% kernel
09-15 14:40:01.917: E/ActivityManager(767):   0% 31459/kworker/0:0: 0% user + 0% kernel
09-15 14:40:01.917: E/ActivityManager(767): 39% TOTAL: 17% user + 22% kernel
09-15 14:40:01.917: E/ActivityManager(767): CPU usage from 3506ms to 4040ms later:
09-15 14:40:01.917: E/ActivityManager(767):   7.4% 767/system_server: 5.5% user + 1.8% kernel / faults: 3 minor
09-15 14:40:01.917: E/ActivityManager(767):     5.5% 827/ActivityManager: 3.7% user + 1.8% kernel
09-15 14:40:01.917: E/ActivityManager(767):   1.4% 1421/mpdecision: 0% user + 1.4% kernel
09-15 14:40:01.917: E/ActivityManager(767):  +0% 32168/kworker/1:2H: 0% user + 0% kernel
09-15 14:40:01.917: E/ActivityManager(767):  +0% 32169/workqueue_trust: 0% user + 0% kernel
09-15 14:40:01.917: E/ActivityManager(767): 2.9% TOTAL: 1.9% user + 0.9% kernel

I think, curl cause thread block.
(Also cpp-tests in curl example was same result.)
If I used curl, application was halt ( and ANR )

P.S.
ART machine works fine, It occur only Android L
P.S.2
older version(3.2) works fine, test version is 3.3alpha

here is curl sample.
res = curl_easy_perform(curl);
was cause block.

CURL *curl;
    CURLcode res;
    char buffer[10];

    curl = curl_easy_init();
    if (curl) 
    {
        curl_easy_setopt(curl, CURLOPT_URL, "http://webtest.cocos2d-x.org/curltest");
        res = curl_easy_perform(curl);
        /* always cleanup */
        curl_easy_cleanup(curl);
        if (res == 0)
        {
            _label->setString("Connect successfully!");
        }
        else
        {
            sprintf(buffer,"code: %i",res);
            _label->setString(buffer);
        }
    }

after halt locat below

09-15 15:06:17.980: I/wpa_supplicant(975): wlan0: CTRL-EVENT-SCAN-STARTED 
09-15 15:06:18.063: I/auditd(8985): type=1400 audit(0.0:772): avc:  denied  { getattr } for  comm="ls" path="/persist" dev="mmcblk0p16" ino=2 scontext=u:r:shell:s0 tcontext=u:object_r:persist_file:s0 tclass=dir
09-15 15:06:23.113: I/auditd(9003): type=1400 audit(0.0:773): avc:  denied  { getattr } for  comm="ls" path="/persist" dev="mmcblk0p16" ino=2 scontext=u:r:shell:s0 tcontext=u:object_r:persist_file:s0 tclass=dir
09-15 15:06:28.113: I/auditd(9018): type=1400 audit(0.0:774): avc:  denied  { getattr } for  comm="ls" path="/persist" dev="mmcblk0p16" ino=2 scontext=u:r:shell:s0 tcontext=u:object_r:persist_file:s0 tclass=dir

It is strange.
libcurl is not changed after releasing v3.2.

um… really strange…
I can’t guess anymore.
How can I help you?

I have not idea.
Will you please just use ndk sample and libcurl to test it?
And do you have other device that can run Android L?

Nope, I test on Nexus5.
Current android L preview support only two devices.
Or emulator( but I didn’t try. )

http://developer.android.com/preview/setup-sdk.html

The Android L developer preview provides you with 32-bit system images to flash the following devices:

Nexus 5
Nexus 7 Wi-Fi (version 2, released in 2013)

In addition, you also get the emulator system images, which includes experimental 64-bit system images along with standard 32-bit system images.

I just tested all of our games w/ my Nexus 5 running the latest Android 5.0 preview. All games crash that have been built with cocos2dx 3.2. All our older stuff based on Cocos2dx 2.4 run. It seems there are some serious issues with loading libraries/assets. Here are some logs:

> D/JniHelper(13600): JniHelper::setJavaVM(0xb505c280), pthread_self() = -1224802616
> D/stopwatch(13600): Java::onCreate Initializing
> W/System.err(13600): java.lang.NullPointerException
> W/System.err(13600): 	at java.lang.System.mapLibraryName(Native Method)
> W/System.err(13600): 	at dalvik.system.DexPathList.findLibrary(DexPathList.java:380)
> W/System.err(13600): 	at dalvik.system.BaseDexClassLoader.findLibrary(BaseDexClassLoader.java:77)
> W/System.err(13600): 	at java.lang.Runtime.loadLibrary(Runtime.java:360)
> W/System.err(13600): 	at java.lang.System.loadLibrary(System.java:989)
> W/System.err(13600): 	at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:66)
> W/System.err(13600): 	at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:80)
> W/System.err(13600): 	at com.tmsoft.library.CoreActivity.onCreate(CoreActivity.java:349)
> W/System.err(13600): 	at com.freeappcompany.stopwatch.Stopwatch.onCreate(Stopwatch.java:24)
> W/System.err(13600): 	at android.app.Activity.performCreate(Activity.java:5933)
> W/System.err(13600): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
> W/System.err(13600): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2251)
> W/System.err(13600): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
> W/System.err(13600): 	at android.app.ActivityThread.access$800(ActivityThread.java:144)
> W/System.err(13600): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
> W/System.err(13600): 	at android.os.Handler.dispatchMessage(Handler.java:102)
> W/System.err(13600): 	at android.os.Looper.loop(Looper.java:135)
> W/System.err(13600): 	at android.app.ActivityThread.main(ActivityThread.java:5221)
> W/System.err(13600): 	at java.lang.reflect.Method.invoke(Native Method)
> W/System.err(13600): 	at java.lang.reflect.Method.invoke(Method.java:372)
> W/System.err(13600): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
> W/System.err(13600): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
> D/Cocos2dxActivity(13600): model=Nexus 5
> D/Cocos2dxActivity(13600): product=hammerhead
> D/Cocos2dxActivity(13600): isEmulator=false

Another call to load a font:

D/CCFileUtilsAndroid.cpp(13600): relative path = medium.fnt
D/CCFileUtilsAndroid.cpp(13600): asset is nullptr
F/libc (13600): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 13630 (GLThread 399)
I/DEBUG ( 186): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 186): Build fingerprint: ‘google/hammerhead/hammerhead:5.0/LPX13D/1519572:user/release-keys’
I/DEBUG ( 186): Revision: ‘11’
I/DEBUG ( 186): ABI: ‘arm’
I/DEBUG ( 186): pid: 13600, tid: 13630, name: GLThread 399 >>> com.freeappcompany.stopwatch <<<
I/DEBUG ( 186): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
I/DEBUG ( 186): r0 00000042 r1 00000000 r2 00000003 r3 a31e1bf9
I/DEBUG ( 186): r4 a26ff6e0 r5 a26ff6d8 r6 a26ff720 r7 a26ff720
I/DEBUG ( 186): r8 75791750 r9 aca6d800 sl 00000001 fp 00000000
I/DEBUG ( 186): ip a32a1a24 sp a26ff5d0 lr a2ddd495 pc b6f76bec cpsr 20070010
I/DEBUG ( 186):
I/DEBUG ( 186): backtrace:
I/DEBUG ( 186): #00 pc 00012bec /system/lib/libc.so (memcmp+336)
I/DEBUG ( 186): #01 pc 00007dc4
I/DEBUG ( 186):
I/DEBUG ( 186): Tombstone written to: /data/tombstones/tombstone_01

I doubt there is anything helpful there but I’ll continue to dig into it.

I have same problem,what should I do?
cocos2dx 3.3 in android 5.0
error log:
02-28 14:46:41.050: E/ActivityManager(533): ANR in com.ileadgame.clashofcrowns_arb (com.ileadgame.clashofcrowns_arb/com.ilead.sdk.activity.ILeadLoginActivity)
02-28 14:46:41.050: E/ActivityManager(533): PID: 23835
02-28 14:46:41.050: E/ActivityManager(533): Reason: Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 2. Wait queue head age: 6049.0ms.)