Android应用程序仅在Galaxy SIII上崩溃

时间:2016-02-08 01:38:18

标签: android

我的团队遇到了一个奇怪的错误,我们的Android应用程序只有在我们尝试在Galaxy SIII测试手机上运行应用程序时才会崩溃。它在我们的其他两款测试手机(S6和DROID)上运行良好。

应用程序在运行时因未处理的异常而崩溃,因为它无法找到joda-time中引用的某些类 - 我们在build.gradle中声明的项目依赖项。同样,这个错误发生在我们的S3上,即使这样,它也会在大约两周前发生。

有了这种类型的问题,我可以通过很多方式来找出问题所在。不过,我开始碰壁,并且会喜欢任何关于可能出现问题的想法/建议。

Edit2:我们发现了这个问题。我们没有正确地实例化multidex支持,并且没有加载类。

编辑:下面的Logcat

W/dalvikvm: VFY: unable to find class referenced in signature (Lorg/joda/time/format/DateTimeFormatterBuilder;)
W/dalvikvm: VFY: unable to find class referenced in signature (Lorg/joda/time/format/DateTimeFormatterBuilder;)
E/dalvikvm: Could not find class 'org.joda.time.format.DateTimeFormat$StyleFormatter', referenced from method org.joda.time.format.DateTimeFormat.createDateTimeFormatter
W/dalvikvm: VFY: unable to resolve new-instance 9443 (Lorg/joda/time/format/DateTimeFormat$StyleFormatter;) in Lorg/joda/time/format/DateTimeFormat;
D/dalvikvm: VFY: replacing opcode 0x22 at 0x0005
E/dalvikvm: Could not find class 'org.joda.time.format.DateTimeFormatterBuilder', referenced from method org.joda.time.format.DateTimeFormat.createFormatterForPattern
W/dalvikvm: VFY: unable to resolve new-instance 9447 (Lorg/joda/time/format/DateTimeFormatterBuilder;) in Lorg/joda/time/format/DateTimeFormat;
D/dalvikvm: VFY: replacing opcode 0x22 at 0x001a
W/dalvikvm: VFY: unable to find class referenced in signature (Lorg/joda/time/format/DateTimeFormatterBuilder;)
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendEraText, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65094: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendEraText ()Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x003c
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendCenturyOfEra, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65086: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendCenturyOfEra (II)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0042
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendTwoDigitYear, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65113: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendTwoDigitYear (IZ)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0075
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendTwoDigitWeekyear, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65112: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendTwoDigitWeekyear (IZ)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0084
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendYearOfEra, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65117: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendYearOfEra (II)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00ab
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendWeekyear, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65115: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendWeekyear (II)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00af
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendYear, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65116: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendYear (II)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00b3
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendMonthOfYearText, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65104: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendMonthOfYearText ()Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00bd
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendMonthOfYearShortText, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65103: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendMonthOfYearShortText ()Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00c2
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendMonthOfYear, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65102: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendMonthOfYear (I)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00c7
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendDayOfMonth, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65089: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendDayOfMonth (I)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00cc
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendHalfdayOfDayText, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65096: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendHalfdayOfDayText ()Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00d1
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendClockhourOfHalfday, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65088: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendClockhourOfHalfday (I)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00d6
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendHourOfDay, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65097: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendHourOfDay (I)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00db
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendClockhourOfDay, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65087: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendClockhourOfDay (I)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00e0
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendHourOfHalfday, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65098: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendHourOfHalfday (I)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00e5
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendMinuteOfHour, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65101: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendMinuteOfHour (I)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00ea
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendSecondOfMinute, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65106: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendSecondOfMinute (I)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00ef
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendFractionOfSecond, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65095: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendFractionOfSecond (II)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00f4
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendDayOfWeek, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65090: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendDayOfWeek (I)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x00f9
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendDayOfWeekText, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65092: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendDayOfWeekText ()Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0101
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendDayOfWeekShortText, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65091: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendDayOfWeekShortText ()Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0106
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendDayOfYear, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65093: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendDayOfYear (I)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x010b
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendWeekOfWeekyear, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65114: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendWeekOfWeekyear (I)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0110
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendTimeZoneName, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65108: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendTimeZoneName ()Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0118
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendTimeZoneShortName, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65111: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendTimeZoneShortName (Ljava/util/Map;)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x011e
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendTimeZoneOffset, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65109: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendTimeZoneOffset (Ljava/lang/String;Ljava/lang/String;ZII)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x74 at 0x012d
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendTimeZoneOffset, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65109: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendTimeZoneOffset (Ljava/lang/String;Ljava/lang/String;ZII)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x74 at 0x013c
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendTimeZoneId, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65107: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendTimeZoneId ()Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0141
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendLiteral, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65099: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendLiteral (C)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0157
I/dalvikvm: Could not find method org.joda.time.format.DateTimeFormatterBuilder.appendLiteral, referenced from method org.joda.time.format.DateTimeFormat.parsePatternTo
W/dalvikvm: VFY: unable to resolve virtual method 65100: Lorg/joda/time/format/DateTimeFormatterBuilder;.appendLiteral (Ljava/lang/String;)Lorg/joda/time/format/DateTimeFormatterBuilder;
D/dalvikvm: VFY: replacing opcode 0x6e at 0x0161
W/dalvikvm: VFY: unable to find class referenced in signature (Lorg/joda/time/format/InternalPrinter;)
E/dalvikvm: Could not find class 'org.joda.time.format.DateTimeFormat$StyleFormatter', referenced from method org.joda.time.format.DateTimeFormat.patternForStyle
W/dalvikvm: VFY: unable to resolve check-cast 9443 (Lorg/joda/time/format/DateTimeFormat$StyleFormatter;) in Lorg/joda/time/format/DateTimeFormat;
D/dalvikvm: VFY: replacing opcode 0x1f at 0x000e
D/dalvikvm: DexOpt: unable to opt direct call 0xfdef at 0x07 in Lorg/joda/time/format/DateTimeFormat;.createDateTimeFormatter
D/dalvikvm: DexOpt: unable to opt direct call 0xfe3d at 0x1c in Lorg/joda/time/format/DateTimeFormat;.createFormatterForPattern
D/AndroidRuntime: Shutting down VM
W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41799da0)
D/HockeyApp: Writing unhandled exception to: /data/data/advancetransit.advancetransit/files/ca1894c1-c19a-49ea-acbe-bf74fc934521.stacktrace
E/AndroidRuntime: FATAL EXCEPTION: main
                                                                             Process: advancetransit.advancetransit, PID: 6151
                                                                             java.lang.NoClassDefFoundError: org.joda.time.format.DateTimeFormatterBuilder
                                                                                 at org.joda.time.format.DateTimeFormat.createFormatterForPattern(DateTimeFormat.java:686)
                                                                                 at org.joda.time.format.DateTimeFormat.forPattern(DateTimeFormat.java:177)
                                                                                 at advancetransit.advancetransit.models.StopTime.timeDifference(StopTime.java:116)
                                                                                 at advancetransit.advancetransit.ui.activities.MainActivity.onStopSelect(MainActivity.java:1678)
                                                                                 at advancetransit.advancetransit.ui.activities.MainActivity$GetLiveData.onPostExecute(MainActivity.java:970)
                                                                                 at advancetransit.advancetransit.ui.activities.MainActivity$GetLiveData.onPostExecute(MainActivity.java:785)
                                                                                 at android.os.AsyncTask.finish(AsyncTask.java:632)
                                                                                 at android.os.AsyncTask.access$600(AsyncTask.java:177)
                                                                                 at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
                                                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                                 at android.os.Looper.loop(Looper.java:146)
                                                                                 at android.app.ActivityThread.main(ActivityThread.java:5487)
                                                                                 at java.lang.reflect.Method.invokeNative(Native Method)
                                                                                 at java.lang.reflect.Method.invoke(Method.java:515)
                                                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
                                                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
                                                                                 at dalvik.system.NativeStart.main(Native Method)
01-28 16:47:38.974 6151-6158/advancetransit.advancetransit I/AndroidRuntime: VM exiting with result code 1, cleanup skipped.

1 个答案:

答案 0 :(得分:1)

从标准JodaTime更改为JodaTime的Android端口无法解决问题。 正如@ coder-con所解释的那样,问题与MultiDex支持无法正确设置有关。 要设置multidex,您需要(如Android Developer中所述):

  1. 修改您的build.gradle并添加mutliDexEnabled truecompile 'com.android.support.multidex:1.01'

    android {
        ...
        defaultConfig {
            ...
            // Enabling multidex support.
            multiDexEnabled true
        }
    ...
    }
    dependencies {
        compile 'com.android.support:multidex:1.0.1'
    }
    
  2. AndroidManifest.xml中,如果您没有自己的应用程序类,请将应用程序名称设置为android.support.multidex.MultiDexApplication。否则,要么扩展此类,要么覆盖attachBaseContext,如下所示:(See details here

    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);