2

Every time Instant Run applied code changes and restart an activity containing a GooglePlusOne button the app crashes with the following exception:

 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)
    ...
    ...

I do not know where to fill a bug report for Google Play Services, hoping the Google team look at StackOverflow.

And is there any workaround to make Instant Run works even in this such case?

Note: I'm using Android Studio 2.2 and Google Play Services 9.6.0 but this problem also occurred on previous versions.

Jérémy Reynaud
  • 3,020
  • 1
  • 24
  • 36
  • Is this happening on emulators only? A [similar question](http://stackoverflow.com/questions/20680451/inflateexception-binary-xml-file-line-1-error-inflating-class-unknown-cause) was asked previously and suggested to check the background image of your root layout as it runs OOM when decoding the bitmap. – adjuremods Sep 26 '16 at 10:16
  • No this is happening on emulator and real devices as well. Thanks but I think the question you mentioned is unrelated as 1) it is not a OOM exception at the problem root cause, is is a Resources$NotFoundException, 2) removing the PlusOneButton fixes the problem. – Jérémy Reynaud Sep 26 '16 at 16:57

0 Answers0