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.
就這些提示,這個怎么好;
機智的我,在配置里找到了

屏幕快照 2016-08-19 18.00.54.png
瞬間世界不一樣了,直接報出來那一行的錯誤了:
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!?。?/p>