TangXiaoLv / Android-Easy-MultiDex

[Deprecated] Android,multidex,splitdex,分包插件
974 stars 162 forks source link

找不到MainActivity #9

Open fishlovestoeatcat opened 8 years ago

fishlovestoeatcat commented 8 years ago

我已经写了-just activity asia.bluepay.best.pay.MainActivity,关闭了instant run,gradle版本是2.1.0,在坚果1上测试MainActivity没有打进主dex包中,如果单保留MainActivity.class,MainActivity中的内部类找不到

TangXiaoLv commented 8 years ago

@fishlovestoeatcat 只有坚果手机这样么? gradle换成1.5.0试试

TangXiaoLv commented 8 years ago

@fishlovestoeatcat 或者把你的分包配置信息和错误日志发来看看

fishlovestoeatcat commented 8 years ago

-----------主Dex中必要依赖的脚本配置-----------

默认保留四大组件中其他三大组件,Activity组件选择性保留(使用-just activity 选项),若为空不保留任何Activity

-just activity asia.bluepay.best.pay.MainActivity

-----------附加类-----------

如果你想要某个包路径在maindex中,则使用 -keep 选项,即使他已经在分包的路径中.若为空,不保留任意类

-keep asia.bluepay.best.pay.data. -keep asia.bluepay.best.pay.exceptions. -keep asia.bluepay.best.pay.helper. -keep asia.bluepay.best.pay.http. -keep asia.bluepay.best.pay.pay. -keep asia.bluepay.best.pay.utils. -keep asia.bluepay.best.pay.utils. -keep com.dodola.rocoofix. -keep com.dodola.rocoo.**

保留单个类.

-keep asia.bluepay.best.pay.MainActivity.class -keep asia.bluepay.best.pay.MainActivity$1.class -keep asia.bluepay.best.pay.MainActivity$2.class -keep asia.bluepay.best.pay.MainActivity$3.class -keep asia.bluepay.best.pay.MainActivity$4.class -keep asia.bluepay.best.pay.MainActivity$5.class -keep asia.bluepay.best.pay.MainActivity$6.class -keep asia.bluepay.best.pay.MainActivity$7.class -keep asia.bluepay.best.pay.MainActivity$8.class -keep asia.bluepay.best.pay.MainActivity$9.class -keep asia.bluepay.best.pay.MainActivity$10.class -keep asia.bluepay.best.pay.MainActivity$11.class -keep asia.bluepay.best.pay.MainActivity$12.class -keep asia.bluepay.best.pay.MainActivity$13.class -keep asia.bluepay.best.pay.MainActivity$14.class -keep asia.bluepay.best.pay.MainActivity$15.class -keep asia.bluepay.best.pay.MainActivity$16.class -keep asia.bluepay.best.pay.MainActivity$17.class -keep asia.bluepay.best.pay.MainActivity$18.class -keep asia.bluepay.best.pay.MainActivity$19.class -keep asia.bluepay.best.pay.MainActivity$20.class -keep asia.bluepay.best.pay.MainActivity$21.class -keep asia.bluepay.best.pay.MainActivity$22.class -keep asia.bluepay.best.pay.MainActivity$23.class -keep asia.bluepay.best.pay.MainActivity$24.class -keep asia.bluepay.best.pay.MainActivity$25.class -keep asia.bluepay.best.pay.MainActivity$26.class -keep asia.bluepay.best.pay.MainActivity$27.class -keep asia.bluepay.best.pay.MainActivity$28.class -keep asia.bluepay.best.pay.MainActivity$29.class -keep asia.bluepay.best.pay.MainActivity$30.class -keep asia.bluepay.best.pay.MainActivity$31.class -keep asia.bluepay.best.pay.MainActivity$PayCallback$1.class -keep asia.bluepay.best.pay.MainActivity$PayCallback.class

这条配置可以指定这个包下类在第二及其他dex中.

-split asia.bluepay.best.pay.core.**

将全部类移出主Dex

-split .

不包含Android gradle 插件自动生成的miandex列表.(不用系统自带分包策略)

-donot-use-suggest

不进行dex分包, 直到 dex 的id数量超过 65536.(设置自动执行分包策略)

-auto-maindex

显示miandex的日志.

-log-mainlist

fishlovestoeatcat commented 8 years ago

哈哈,我只好这样写了,上面那个保留activity的没用,这样写就可以用了

TangXiaoLv commented 8 years ago

@fishlovestoeatcat 配置有误, -donot-use-suggest 注释掉 #-donot-use-suggest 这条的意思是不使用-just activity 动态生成的依赖树,注释掉表示使用

TangXiaoLv commented 8 years ago

@fishlovestoeatcat keep的单独类可以去掉了,keep一般只在特殊情况下使用,这样可以保证main dex最小

fishlovestoeatcat commented 8 years ago

我注释后MainActivity可以找到了,可是我里面的OnClickListener和内部类还是找不到

TangXiaoLv commented 8 years ago

@fishlovestoeatcat 报什么错

fishlovestoeatcat commented 8 years ago

09-01 17:00:30.898 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.ac', referenced from method asia.bluepay.best.pay.MainActivity. 09-01 17:00:30.898 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 77 (Lasia/bluepay/best/pay/ac;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.898 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0003 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.i', referenced from method asia.bluepay.best.pay.MainActivity.a 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 146 (Lasia/bluepay/best/pay/i;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0017 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.w', referenced from method asia.bluepay.best.pay.MainActivity.c 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 160 (Lasia/bluepay/best/pay/w;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.y', referenced from method asia.bluepay.best.pay.MainActivity.d 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 162 (Lasia/bluepay/best/pay/y;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.z', referenced from method asia.bluepay.best.pay.MainActivity.e 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 163 (Lasia/bluepay/best/pay/z;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.aa', referenced from method asia.bluepay.best.pay.MainActivity.f 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 75 (Lasia/bluepay/best/pay/aa;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.ab', referenced from method asia.bluepay.best.pay.MainActivity.g 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 76 (Lasia/bluepay/best/pay/ab;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.b', referenced from method asia.bluepay.best.pay.MainActivity.h 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 86 (Lasia/bluepay/best/pay/b;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.c', referenced from method asia.bluepay.best.pay.MainActivity.i 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 88 (Lasia/bluepay/best/pay/c;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.d', referenced from method asia.bluepay.best.pay.MainActivity.j 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 92 (Lasia/bluepay/best/pay/d;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.e', referenced from method asia.bluepay.best.pay.MainActivity.k 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 102 (Lasia/bluepay/best/pay/e;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.f', referenced from method asia.bluepay.best.pay.MainActivity.l 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 113 (Lasia/bluepay/best/pay/f;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.g', referenced from method asia.bluepay.best.pay.MainActivity.m 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 144 (Lasia/bluepay/best/pay/g;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.h', referenced from method asia.bluepay.best.pay.MainActivity.n 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 145 (Lasia/bluepay/best/pay/h;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.j', referenced from method asia.bluepay.best.pay.MainActivity.o 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 147 (Lasia/bluepay/best/pay/j;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.k', referenced from method asia.bluepay.best.pay.MainActivity.p 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 148 (Lasia/bluepay/best/pay/k;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.m', referenced from method asia.bluepay.best.pay.MainActivity.q 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 150 (Lasia/bluepay/best/pay/m;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.908 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.n', referenced from method asia.bluepay.best.pay.MainActivity.r 09-01 17:00:30.908 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 151 (Lasia/bluepay/best/pay/n;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.908 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.918 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.o', referenced from method asia.bluepay.best.pay.MainActivity.s 09-01 17:00:30.918 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 152 (Lasia/bluepay/best/pay/o;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.918 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.918 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.p', referenced from method asia.bluepay.best.pay.MainActivity.t 09-01 17:00:30.918 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 153 (Lasia/bluepay/best/pay/p;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.918 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.918 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.q', referenced from method asia.bluepay.best.pay.MainActivity.u 09-01 17:00:30.918 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 154 (Lasia/bluepay/best/pay/q;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.918 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.918 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.r', referenced from method asia.bluepay.best.pay.MainActivity.v 09-01 17:00:30.918 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 155 (Lasia/bluepay/best/pay/r;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.918 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.918 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.s', referenced from method asia.bluepay.best.pay.MainActivity.w 09-01 17:00:30.918 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 156 (Lasia/bluepay/best/pay/s;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.918 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.918 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.t', referenced from method asia.bluepay.best.pay.MainActivity.x 09-01 17:00:30.918 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 157 (Lasia/bluepay/best/pay/t;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.918 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.918 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.u', referenced from method asia.bluepay.best.pay.MainActivity.y 09-01 17:00:30.918 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 158 (Lasia/bluepay/best/pay/u;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.918 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.918 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.l', referenced from method asia.bluepay.best.pay.MainActivity.a 09-01 17:00:30.918 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 149 (Lasia/bluepay/best/pay/l;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.918 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0011 09-01 17:00:30.918 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.x', referenced from method asia.bluepay.best.pay.MainActivity.b 09-01 17:00:30.918 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 161 (Lasia/bluepay/best/pay/x;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.918 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0014 09-01 17:00:30.918 32227-32227/? E/dalvikvm: Could not find class 'asia.bluepay.best.pay.a', referenced from method asia.bluepay.best.pay.MainActivity.onCreate 09-01 17:00:30.918 32227-32227/? W/dalvikvm: VFY: unable to resolve new-instance 74 (Lasia/bluepay/best/pay/a;) in Lasia/bluepay/best/pay/MainActivity; 09-01 17:00:30.918 32227-32227/? D/dalvikvm: VFY: replacing opcode 0x22 at 0x0028 09-01 17:00:30.918 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x00bd at 0x05 in Lasia/bluepay/best/pay/MainActivity;. 09-01 17:00:30.918 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0235 at 0x19 in Lasia/bluepay/best/pay/MainActivity;.a 09-01 17:00:30.918 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0243 at 0x16 in Lasia/bluepay/best/pay/MainActivity;.c 09-01 17:00:30.918 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0245 at 0x16 in Lasia/bluepay/best/pay/MainActivity;.d 09-01 17:00:30.918 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0246 at 0x16 in Lasia/bluepay/best/pay/MainActivity;.e 09-01 17:00:30.918 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x00bb at 0x16 in Lasia/bluepay/best/pay/MainActivity;.f 09-01 17:00:30.918 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x00bc at 0x16 in Lasia/bluepay/best/pay/MainActivity;.g 09-01 17:00:30.918 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x00f8 at 0x16 in Lasia/bluepay/best/pay/MainActivity;.h 09-01 17:00:30.918 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x00fe at 0x16 in Lasia/bluepay/best/pay/MainActivity;.i 09-01 17:00:30.918 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0114 at 0x16 in Lasia/bluepay/best/pay/MainActivity;.j 09-01 17:00:30.918 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x017b at 0x16 in Lasia/bluepay/best/pay/MainActivity;.k 09-01 17:00:30.918 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x01ab at 0x16 in Lasia/bluepay/best/pay/MainActivity;.l 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0233 at 0x16 in Lasia/bluepay/best/pay/MainActivity;.m 09-01 17:00:30.928 13116-13135/? D/dalvikvm: GC_EXPLICIT freed 18K, 49% free 8519K/16480K, paused 1ms+2ms, total 18ms, dvmtargetUtilize:0.750000 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0234 at 0x16 in Lasia/bluepay/best/pay/MainActivity;.n 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0236 at 0x16 in Lasia/bluepay/best/pay/MainActivity;.o 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0237 at 0x16 in Lasia/bluepay/best/pay/MainActivity;.p 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0239 at 0x16 in Lasia/bluepay/best/pay/MainActivity;.q 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x023a at 0x16 in Lasia/bluepay/best/pay/MainActivity;.r 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x023b at 0x16 in Lasia/bluepay/best/pay/MainActivity;.s 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x023c at 0x16 in Lasia/bluepay/best/pay/MainActivity;.t 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x023d at 0x16 in Lasia/bluepay/best/pay/MainActivity;.u 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x023e at 0x16 in Lasia/bluepay/best/pay/MainActivity;.v 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x023f at 0x16 in Lasia/bluepay/best/pay/MainActivity;.w 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0240 at 0x16 in Lasia/bluepay/best/pay/MainActivity;.x 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0241 at 0x16 in Lasia/bluepay/best/pay/MainActivity;.y 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0238 at 0x13 in Lasia/bluepay/best/pay/MainActivity;.a 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0242 at 0x1d in Lasia/bluepay/best/pay/MainActivity;.a 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x0244 at 0x16 in Lasia/bluepay/best/pay/MainActivity;.b 09-01 17:00:30.928 32227-32227/? D/dalvikvm: DexOpt: unable to opt direct call 0x00ba at 0x2a in Lasia/bluepay/best/pay/MainActivity;.onCreate 09-01 17:00:30.928 32227-32227/? D/AndroidRuntime: Shutting down VM 09-01 17:00:30.928 32227-32227/? W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41b6fd58) 09-01 17:00:30.928 32227-32227/? E/AndroidRuntime: FATAL EXCEPTION: main Process: asia.bluepay.best.pay, PID: 32227 java.lang.NoClassDefFoundError: asia.bluepay.best.pay.ac at asia.bluepay.best.pay.MainActivity.(Unknown Source) at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1208) at android.app.Instrumentation.newActivity(Instrumentation.java:1061) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2111) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2253) at android.app.ActivityThread.access$800(ActivityThread.java:145) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5128) 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:893) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:702) at dalvik.system.NativeStart.main(Native Method) 09-01 17:00:30.938 1107-2058/? W/ActivityManager: Force finishing activity asia.bluepay.best.pay/.MainActivity

fishlovestoeatcat commented 8 years ago

哈哈。好长,就是找不到各种listener和内部类ac,被混淆了看不见名字

TangXiaoLv commented 8 years ago

@fishlovestoeatcat 你用反射了么?用了的话需要把被反射的类keep

fishlovestoeatcat commented 8 years ago

用到反射的类全部保留了包路径了

fishlovestoeatcat commented 8 years ago

按照我最上面那种配置是可以正常使用的,就是有点别扭,加一大堆class

TangXiaoLv commented 8 years ago

@fishlovestoeatcat 所以尽量在启动时不要做复杂逻辑,复杂逻辑可以延迟加载,程序业务上如果能优化就稍微优化下

fishlovestoeatcat commented 8 years ago

我试了另外两个手机,你那种配置是可以的,但是那个坚果手机不行,没有把activity的内部类打进dex包里。另外请教一下,如果把项目打包成jar包,这种方式可以生效么?

TangXiaoLv commented 8 years ago

@fishlovestoeatcat 可以生效