[TIMOB-25546] Android: Simple Code Crash after installing Titanium SDK 7.0.0 Beta
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-11-28T20:08:28.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.0.0 |
Components | Android |
Labels | android, parity, sdk-7.0.0, titanium, titanium-cli |
Reporter | David van de Meer |
Assignee | Yordan Banev |
Created | 2017-11-22T13:57:46.000+0000 |
Updated | 2017-11-30T00:32:10.000+0000 |
Description
Steps to reproduce:
1. Create a new classic app
2. Only have this code in the app.js file
3. Build to Android
Ti.API.log("App Start");
var testVar = {testObject: "testvalue"};
var testData = testVar.testObject;
Ti.API.log(testVar);
Ti.API.log(testData);
function testFunction(testVar){
Ti.API.log("TestFunction");
Ti.API.log(testVar);
var newTestVar = {testObject: "testvalue"};
var newTestData = newTestVar.testObject;
Ti.API.log(newTestVar);
Ti.API.log(newTestData);
}
testFunction(testVar);
App will build and fail with the following log
-- Start application log -----------------------------------------------------
[INFO] : TiApplication: (main) [0,0] checkpoint, app created.
[INFO] : TiApplication: (main) [23,23] Titanium 7.0.0 (2017/11/17 15:29 undefined)
[INFO] : MultiDex: VM with version 2.1.0 has multidex support
[INFO] : MultiDex: install
[INFO] : MultiDex: VM has multidex support, MultiDex support library is disabled.
[INFO] : DatabaseHelper: No value in database for platform key: 'unique_machine_id' returning supplied default ''
[INFO] : DatabaseHelper: No value in database for platform key: 'hardware_machine_id' returning supplied default ''
[WARN] : TiAndroid: (main) [746,769] Application instance no longer available. Unable to get current activity.
[WARN] : TiAndroid: (main) [1,770] Application instance no longer available. Unable to get current activity.
[WARN] : TiAndroid: (main) [4,774] Application instance no longer available. Unable to get current activity.
[INFO] : TiApplication: (main) [17,791] Titanium Javascript runtime: v8
[WARN] : art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
[INFO] : App Start
I have been testing my app on Android and have found some very random bugs in Android, everything works perfectly on iOS.
The funny thing is that my app has tons of code, about 250 000 lines, and most of it works, but then randomly at one location when I try to access an object data as in this example it crashes, even though I do it in many other locations, the location it fails is at most likely the highest? point in the code, the point with the most layers of callsbacks functions objects so that might be why.
I tracked it down to object not being set and objects not being usable, as soon as I access an object data the app crashes....then I ran this test in my app in different location and finally in the alloy.js file, and it crashed there.
As I said this fails on a Clean Classic App as well and has been confirmed by Yordan Banev.
I am not sure if this is something caused by me installing Titanium 7.0.0 Beta, if so how can I remove that and get back to a working environment?
I have lost 2 days tracking this down..
Check http://docs.appcelerator.com/platform/latest/#!/api/Titanium.API-method-log
Ti.API.log
takes two parameters. It works for me if you change it toTi.API.log("info","")
or useconsole.log()
orTi.API.info()
Crashlog for the example above: {noformat} Build fingerprint: 'htc/hiaeuhl_00401/htc_hiaeuhl:7.0/NRD90M/876837.2:user/release-keys' Revision: '0' ABI: 'arm' pid: 15622, tid: 15622, name: .app >>> com.app <<< signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x1 r0 12e42080 r1 000000c3 r2 00000003 r3 ffffff89 r4 00000001 r5 00000000 r6 222f07d1 r7 12e42080 r8 ff91bf40 r9 12e42080 sl 00000000 fp 00000001 ip 00000002 sp ff91bea8 lr d580e1d4 pc d580df6c cpsr 800e0010 backtrace: #00 pc 00455f6c /data/app/lib/arm/libkroll-v8.so #01 pc 004561d0 /data/app/lib/arm/libkroll-v8.so #02 pc 004705c4 /data/app/lib/arm/libkroll-v8.so (_ZNK2v86String9WriteUtf8EPciPii+536) #03 pc 00387ef1 /data/app/lib/arm/libkroll-v8.so (_ZN8titanium9Utf8ValueC1EN2v85LocalINS1_5ValueEEE+56) #04 pc 00388d87 /data/app/lib/arm/libkroll-v8.so (_ZN8titanium9APIModule3logERKN2v820FunctionCallbackInfoINS1_5ValueEEE+50) #05 pc 00481bf4 /data/app/lib/arm/libkroll-v8.so (_ZN2v88internal25FunctionCallbackArguments4CallEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEE+188) #06 pc 004f2f68 /data/app/lib/arm/libkroll-v8.so #07 pc 004f3438 /data/app/lib/arm/libkroll-v8.so #08 pc 004f36c8 /data/app/lib/arm/libkroll-v8.so (_ZN2v88internal21Builtin_HandleApiCallEiPPNS0_6ObjectEPNS0_7IsolateE+44) #09 pc 00000098
INFO
([github](https://github.com/appcelerator/titanium_mobile/blob/a8aceeaeee02ed9c8ea70c835a0e78960e254a55/android/runtime/common/src/java/org/appcelerator/kroll/KrollLogging.java#L96)) and not crashPR: https://github.com/appcelerator/titanium_mobile/pull/9632
FR Passed. Waiting for merge to get enabled.
Verified the fix with SDK 7.0.0.v20171129100330. Closing.