每次Instant Run应用代码更改并重新启动包含GooglePlusOne按钮的活动时,应用程序崩溃时会出现以下异常:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.mycompany.myapp, PID: 26877
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycompany.myapp/com.mycompany.activities.MyActivity}: android.view.InflateException: Binary XML file line #221: Error inflating class <unknown>
...
Caused by: android.view.InflateException: Binary XML file line #221: Error inflating class <unknown>
at android.view.LayoutInflater.createView(LayoutInflater.java:633)
...
...
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1266)
at android.content.res.Resources.getDrawable(Resources.java:785)
at android.content.res.Resources.getDrawable(Resources.java:752)
at com.google.android.gms.plus.PlusOneDummyView$zzb.getDrawable(Unknown Source)
at com.google.android.gms.plus.PlusOneDummyView.<init>(Unknown Source)
at com.google.android.gms.plus.internal.zzg.zza(Unknown Source)
at com.google.android.gms.plus.PlusOneButton.zzca(Unknown Source)
at com.google.android.gms.plus.PlusOneButton.<init>(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.mycompany.MyActivity.inializeContents(MyActivity.java:37)
...
...
我不知道在哪里填写Google Play服务的错误报告,希望Google小组看看StackOverflow。
即使在这种情况下,还有任何解决方法可以使Instant Run工作吗?
注意:我使用的是Android Studio 2.2和Google Play Services 9.6.0,但此问题也出现在以前的版本中。