Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14919] Android: App crashes when calling Ti.UI.Android.openPreferences() when using Urban Airship

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionDuplicate
Resolution Date2013-08-26T20:41:53.000+0000
Affected Version/sRelease 3.0.0, Release 3.0.2, Release 3.1.1, Release 3.1.2
Fix Version/s2013 Sprint 18, 2013 Sprint 18 API, Release 3.1.3, Release 3.2.0
ComponentsAndroid
Labelsregression
ReporterBetty Tran
AssigneeHieu Pham
Created2013-08-20T13:20:01.000+0000
Updated2013-08-30T17:19:26.000+0000

Description

When we are using the ti.urbanairship module, calling Ti.UI.Android.openPreferences() crashes the application. Note that this issue did not occur in 2.1.4GA Steps to reproduce: 1. Download the attached zip file 2. Create a new project and add the Urban Airship module (2.3.2) 3. Place the platform folder and app.js in the new project 4. Edit the airshipconfig.properties file with your app secret and key 5. Run App and click the button. 6. App will crash If the module is not added, the app does not crash. Please also see the attached log file. If the module is removed

Attachments

FileDateSize
sample.zip2013-08-20T13:20:01.000+00006281
ualog.txt2013-08-20T13:20:01.000+00008994

Comments

  1. Guto Dasilva 2013-08-26

    it is not crashing without the UA module side loading so I am not sure if it is really a duplicate.
  2. Ingo Muschenetz 2013-08-26

    [~mobile_developer@onforce.com] Can you see if it crashes using the 3.2 (master) branch of CI?
  3. Guto Dasilva 2013-08-27

    [~ingo] I just checked and it doesnt crash on load. It crashes when it opens but I think it is a module problem of exposure of the preference classes.
       08-27 10:18:50.037: E/TiApplication(21242): (main) [3836,3836] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.toastToast/ti.modules.titanium.ui.android.TiPreferencesActivity}: android.view.InflateException: Binary XML file line #38: Error inflating class com.urbanairship.preference.PushEnablePreference; Titanium 3.2.0,2013/08/26 16:33,90d473b 08-27 10:18:50.037: E/TiApplication(21242): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.toastToast/ti.modules.titanium.ui.android.TiPreferencesActivity}: android.view.InflateException: Binary XML file line #38: Error inflating class com.urbanairship.preference.PushEnablePreference 08-27 10:18:50.037: E/TiApplication(21242): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2136) 08-27 10:18:50.037: E/TiApplication(21242): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2174) 08-27 10:18:50.037: E/TiApplication(21242): at android.app.ActivityThread.access$700(ActivityThread.java:141) 08-27 10:18:50.037: E/TiApplication(21242): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1267) 08-27 10:18:50.037: E/TiApplication(21242): at android.os.Handler.dispatchMessage(Handler.java:99) 08-27 10:18:50.037: E/TiApplication(21242): at android.os.Looper.loop(Looper.java:137) 08-27 10:18:50.037: E/TiApplication(21242): at android.app.ActivityThread.main(ActivityThread.java:5059) 08-27 10:18:50.037: E/TiApplication(21242): at java.lang.reflect.Method.invokeNative(Native Method) 08-27 10:18:50.037: E/TiApplication(21242): at java.lang.reflect.Method.invoke(Method.java:511) 08-27 10:18:50.037: E/TiApplication(21242): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) 08-27 10:18:50.037: E/TiApplication(21242): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) 08-27 10:18:50.037: E/TiApplication(21242): at dalvik.system.NativeStart.main(Native Method) 08-27 10:18:50.037: E/TiApplication(21242): Caused by: android.view.InflateException: Binary XML file line #38: Error inflating class com.urbanairship.preference.PushEnablePreference 08-27 10:18:50.037: E/TiApplication(21242): at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:441) 08-27 10:18:50.037: E/TiApplication(21242): at android.preference.GenericInflater.rInflate(GenericInflater.java:481) 08-27 10:18:50.037: E/TiApplication(21242): at android.preference.GenericInflater.inflate(GenericInflater.java:326) 08-27 10:18:50.037: E/TiApplication(21242): at android.preference.GenericInflater.inflate(GenericInflater.java:263) 08-27 10:18:50.037: E/TiApplication(21242): at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:269) 08-27 10:18:50.037: E/TiApplication(21242): at android.preference.PreferenceActivity.addPreferencesFromResource(PreferenceActivity.java:1418) 08-27 10:18:50.037: E/TiApplication(21242): at ti.modules.titanium.ui.android.TiPreferencesActivity.onCreate(TiPreferencesActivity.java:38) 08-27 10:18:50.037: E/TiApplication(21242): at android.app.Activity.performCreate(Activity.java:5058) 08-27 10:18:50.037: E/TiApplication(21242): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 08-27 10:18:50.037: E/TiApplication(21242): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100) 08-27 10:18:50.037: E/TiApplication(21242): ... 11 more 08-27 10:18:50.037: E/TiApplication(21242): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.urbanairship.preference.PushEnablePreference" on path: /data/app/com.toastToast-1.apk 08-27 10:18:50.037: E/TiApplication(21242): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 08-27 10:18:50.037: E/TiApplication(21242): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 08-27 10:18:50.037: E/TiApplication(21242): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 08-27 10:18:50.037: E/TiApplication(21242): at android.preference.GenericInflater.createItem(GenericInflater.java:375) 08-27 10:18:50.037: E/TiApplication(21242): at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:430) 08-27 10:18:50.037: E/TiApplication(21242): ... 20 more 08-27 10:18:50.576: E/AndroidRuntime(21242): FATAL EXCEPTION: main 08-27 10:18:50.576: E/AndroidRuntime(21242): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.toastToast/ti.modules.titanium.ui.android.TiPreferencesActivity}: android.view.InflateException: Binary XML file line #38: Error inflating class com.urbanairship.preference.PushEnablePreference 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2136) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2174) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.app.ActivityThread.access$700(ActivityThread.java:141) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1267) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.os.Handler.dispatchMessage(Handler.java:99) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.os.Looper.loop(Looper.java:137) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.app.ActivityThread.main(ActivityThread.java:5059) 08-27 10:18:50.576: E/AndroidRuntime(21242): at java.lang.reflect.Method.invokeNative(Native Method) 08-27 10:18:50.576: E/AndroidRuntime(21242): at java.lang.reflect.Method.invoke(Method.java:511) 08-27 10:18:50.576: E/AndroidRuntime(21242): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) 08-27 10:18:50.576: E/AndroidRuntime(21242): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) 08-27 10:18:50.576: E/AndroidRuntime(21242): at dalvik.system.NativeStart.main(Native Method) 08-27 10:18:50.576: E/AndroidRuntime(21242): Caused by: android.view.InflateException: Binary XML file line #38: Error inflating class com.urbanairship.preference.PushEnablePreference 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:441) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.preference.GenericInflater.rInflate(GenericInflater.java:481) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.preference.GenericInflater.inflate(GenericInflater.java:326) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.preference.GenericInflater.inflate(GenericInflater.java:263) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:269) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.preference.PreferenceActivity.addPreferencesFromResource(PreferenceActivity.java:1418) 08-27 10:18:50.576: E/AndroidRuntime(21242): at ti.modules.titanium.ui.android.TiPreferencesActivity.onCreate(TiPreferencesActivity.java:38) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.app.Activity.performCreate(Activity.java:5058) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100) 08-27 10:18:50.576: E/AndroidRuntime(21242): ... 11 more 08-27 10:18:50.576: E/AndroidRuntime(21242): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.urbanairship.preference.PushEnablePreference" on path: /data/app/com.toastToast-1.apk 08-27 10:18:50.576: E/AndroidRuntime(21242): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 08-27 10:18:50.576: E/AndroidRuntime(21242): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 08-27 10:18:50.576: E/AndroidRuntime(21242): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.preference.GenericInflater.createItem(GenericInflater.java:375) 08-27 10:18:50.576: E/AndroidRuntime(21242): at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:430) 08-27 10:18:50.576: E/AndroidRuntime(21242): ... 20 more
       
  4. Ingo Muschenetz 2013-08-27

    [~mobile_developer@onforce.com] Any way you could paste that stack trace in inside a code block with line wraps?
  5. Guto Dasilva 2013-08-27

    [~ingo] here it goes The preference http://schemas.android.com/apk/res/android" > The stack trace 08-27 10:40:36.663: W/dalvikvm(21621): threadid=1: thread exiting with uncaught exception (group=0x40cb02a0) 08-27 10:40:36.679: E/TiApplication(21621): (main) [16794,16794] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.toastToast/ti.modules.titanium.ui.android.TiPreferencesActivity}: android.view.InflateException: Binary XML file line #3: Error inflating class com.urbanairship.preference.PushEnablePreference; Titanium 3.2.0,2013/08/26 16:33,90d473b 08-27 10:40:36.679: E/TiApplication(21621): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.toastToast/ti.modules.titanium.ui.android.TiPreferencesActivity}: android.view.InflateException: Binary XML file line #3: Error inflating class com.urbanairship.preference.PushEnablePreference 08-27 10:40:36.679: E/TiApplication(21621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2136) 08-27 10:40:36.679: E/TiApplication(21621): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2174) 08-27 10:40:36.679: E/TiApplication(21621): at android.app.ActivityThread.access$700(ActivityThread.java:141) 08-27 10:40:36.679: E/TiApplication(21621): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1267) 08-27 10:40:36.679: E/TiApplication(21621): at android.os.Handler.dispatchMessage(Handler.java:99) 08-27 10:40:36.679: E/TiApplication(21621): at android.os.Looper.loop(Looper.java:137) 08-27 10:40:36.679: E/TiApplication(21621): at android.app.ActivityThread.main(ActivityThread.java:5059) 08-27 10:40:36.679: E/TiApplication(21621): at java.lang.reflect.Method.invokeNative(Native Method) 08-27 10:40:36.679: E/TiApplication(21621): at java.lang.reflect.Method.invoke(Method.java:511) 08-27 10:40:36.679: E/TiApplication(21621): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) 08-27 10:40:36.679: E/TiApplication(21621): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) 08-27 10:40:36.679: E/TiApplication(21621): at dalvik.system.NativeStart.main(Native Method) 08-27 10:40:36.679: E/TiApplication(21621): Caused by: android.view.InflateException: Binary XML file line #3: Error inflating class com.urbanairship.preference.PushEnablePreference 08-27 10:40:36.679: E/TiApplication(21621): at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:441) 08-27 10:40:36.679: E/TiApplication(21621): at android.preference.GenericInflater.rInflate(GenericInflater.java:481) 08-27 10:40:36.679: E/TiApplication(21621): at android.preference.GenericInflater.inflate(GenericInflater.java:326) 08-27 10:40:36.679: E/TiApplication(21621): at android.preference.GenericInflater.inflate(GenericInflater.java:263) 08-27 10:40:36.679: E/TiApplication(21621): at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:269) 08-27 10:40:36.679: E/TiApplication(21621): at android.preference.PreferenceActivity.addPreferencesFromResource(PreferenceActivity.java:1418) 08-27 10:40:36.679: E/TiApplication(21621): at ti.modules.titanium.ui.android.TiPreferencesActivity.onCreate(TiPreferencesActivity.java:38) 08-27 10:40:36.679: E/TiApplication(21621): at android.app.Activity.performCreate(Activity.java:5058) 08-27 10:40:36.679: E/TiApplication(21621): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 08-27 10:40:36.679: E/TiApplication(21621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100) 08-27 10:40:36.679: E/TiApplication(21621): ... 11 more 08-27 10:40:36.679: E/TiApplication(21621): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.urbanairship.preference.PushEnablePreference" on path: /data/app/com.toastToast-1.apk 08-27 10:40:36.679: E/TiApplication(21621): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 08-27 10:40:36.679: E/TiApplication(21621): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 08-27 10:40:36.679: E/TiApplication(21621): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 08-27 10:40:36.679: E/TiApplication(21621): at android.preference.GenericInflater.createItem(GenericInflater.java:375) 08-27 10:40:36.679: E/TiApplication(21621): at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:430) 08-27 10:40:36.679: E/TiApplication(21621): ... 20 more 08-27 10:40:36.710: D/MotoSystemUIUtils(582): Not on network extender 08-27 10:40:36.710: D/ConnectivityService(462): getMobileDataEnabled returning false 08-27 10:40:36.718: D/ConnectivityService(462): getMobileDataEnabled returning false 08-27 10:40:36.718: D/ConnectivityService(462): getMobileDataEnabled returning false 08-27 10:40:36.725: E/AndroidRuntime(21621): FATAL EXCEPTION: main 08-27 10:40:36.725: E/AndroidRuntime(21621): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.toastToast/ti.modules.titanium.ui.android.TiPreferencesActivity}: android.view.InflateException: Binary XML file line #3: Error inflating class com.urbanairship.preference.PushEnablePreference 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2136) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2174) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.app.ActivityThread.access$700(ActivityThread.java:141) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1267) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.os.Handler.dispatchMessage(Handler.java:99) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.os.Looper.loop(Looper.java:137) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.app.ActivityThread.main(ActivityThread.java:5059) 08-27 10:40:36.725: E/AndroidRuntime(21621): at java.lang.reflect.Method.invokeNative(Native Method) 08-27 10:40:36.725: E/AndroidRuntime(21621): at java.lang.reflect.Method.invoke(Method.java:511) 08-27 10:40:36.725: E/AndroidRuntime(21621): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) 08-27 10:40:36.725: E/AndroidRuntime(21621): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:555) 08-27 10:40:36.725: E/AndroidRuntime(21621): at dalvik.system.NativeStart.main(Native Method) 08-27 10:40:36.725: E/AndroidRuntime(21621): Caused by: android.view.InflateException: Binary XML file line #3: Error inflating class com.urbanairship.preference.PushEnablePreference 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:441) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.preference.GenericInflater.rInflate(GenericInflater.java:481) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.preference.GenericInflater.inflate(GenericInflater.java:326) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.preference.GenericInflater.inflate(GenericInflater.java:263) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:269) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.preference.PreferenceActivity.addPreferencesFromResource(PreferenceActivity.java:1418) 08-27 10:40:36.725: E/AndroidRuntime(21621): at ti.modules.titanium.ui.android.TiPreferencesActivity.onCreate(TiPreferencesActivity.java:38) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.app.Activity.performCreate(Activity.java:5058) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100) 08-27 10:40:36.725: E/AndroidRuntime(21621): ... 11 more 08-27 10:40:36.725: E/AndroidRuntime(21621): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.urbanairship.preference.PushEnablePreference" on path: /data/app/com.toastToast-1.apk 08-27 10:40:36.725: E/AndroidRuntime(21621): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 08-27 10:40:36.725: E/AndroidRuntime(21621): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 08-27 10:40:36.725: E/AndroidRuntime(21621): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.preference.GenericInflater.createItem(GenericInflater.java:375) 08-27 10:40:36.725: E/AndroidRuntime(21621): at android.preference.GenericInflater.createItemFromTag(GenericInflater.java:430) 08-27 10:40:36.725: E/AndroidRuntime(21621): ... 20 more 08-27 10:40:36.733: W/ActivityManager(462): Force finishing activity com.toastToast/ti.modules.titanium.ui.android.TiPreferencesActivity 08-27 10:40:36.733: W/ActivityManager(462): Force finishing activity com.toastToast/org.appcelerator.titanium.TiActivity 08-27 10:40:36.757: W/ApplicationContext(462): Unable to create files directory files 08-27 10:40:37.233: W/ActivityManager(462): Activity pause timeout for ActivityRecord{414ac1f8 com.toastToast/ti.modules.titanium.ui.android.TiPreferencesActivity}
  6. Ping Wang 2013-08-27

    [~mobile_developer@onforce.com], the fix for TIMOB-14324 will fix the original test case that [~btran] attached in the ticket. But you used a different preferences.xml and the crash log shows it is a different issue than the original test case. Can you file a new ticket with your test case?
  7. Guto Dasilva 2013-08-27

    ok
  8. Guto Dasilva 2013-08-27

    However [~pwang] when does 3.2 will be in a stable release?
  9. Ingo Muschenetz 2013-08-27

    [~mobile_developer@onforce.com] 3.2.0 will come out late this year. However, the fix here should be out in 3.1.3 (mid-September)
  10. Guto Dasilva 2013-08-27

    Ok, we have a deadline for Sept 17th on this
  11. Betty Tran 2013-08-27

  12. Eric Merriman 2013-08-30

    After speaking to Betty, she agrees this ticket is a duplicate. Closing as such.

JSON Source