Android studio 2.2 beta2 升级以后报错transformClassesWithInstantRunForDebug
今天从Android studio 2.2beta1升级到了beta2之后,本来满心欢喜,结果一运行,报错了:
Execution failed for task ':ttt:transformClassesWithInstantRunForDebug'.
> java.lang.ExceptionInInitializerError (no error message)
下面提示:
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
就这些提示,这个怎么好;
机智的我,在配置里找到了

瞬间世界不一样了,直接报出来那一行的错误了:
Caused by: java.lang.RuntimeException: Stub!
at android.graphics.Color.rgb(Color.java:9)
at cn.finalteam.galleryfinal.ThemeConfig$Builder.<init>(ThemeConfig.java:120)
at cn.finalteam.galleryfinal.ThemeConfig.<clinit>(ThemeConfig.java:28)
... 31 more
顺藤摸瓜,找到了具体的错误:
private int titleBarBgColor = Color.rgb(0x3F, 0x51, 0xB5);
居然是因为这个,无法编译通过,我的天呐!!!
修改为
private int titleBarBgColor = 0x3F51B5;
这样就好了,顺利使用InstantRun!!!
网友评论