I use the Google Plus SDK in my Android app. On some rare devices, I have got the following crash when my view containing Google Plus buttons is inflated:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main); // CRASH HERE
....
}
My GooglePlus buttons are in xml like this:
<com.google.android.gms.common.SignInButton
android:id="@+id/sign_in_button"
....
/>
<com.google.android.gms.plus.PlusOneButton
xmlns:plus="http://schemas.android.com/apk/lib/com.google.android.gms.plus"
android:id="@+id/plus_one_button"
...
/>
Below the log. Any idea on the way to solve this issue ?
Thanks !!
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.audioguidia.myweather/com.audioguidia.myweather.MyWeatherActivity}: android.view.InflateException: Binary XML file line #111: Error inflating class com.google.android.gms.plus.PlusOneButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #111: Error inflating class com.google.android.gms.plus.PlusOneButton
at android.view.LayoutInflater.createView(LayoutInflater.java:613)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
at android.app.Activity.setContentView(Activity.java:1867)
at com.audioguidia.myweather.MyWeatherActivity.onCreate(MyWeatherActivity.java:419)
at android.app.Activity.performCreate(Activity.java:5008)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
... 22 more
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1013)
at android.content.res.Resources.getDrawable(Resources.java:658)
at com.google.android.gms.plus.PlusOneDummyView$b.getDrawable(Unknown Source)
at com.google.android.gms.plus.PlusOneDummyView.<init>(Unknown Source)
at com.google.android.gms.internal.bu.a(Unknown Source)
at com.google.android.gms.plus.PlusOneButton.d(Unknown Source)
at com.google.android.gms.plus.PlusOneButton.<init>(Unknown Source)
... 25 more
Examples of devices where I have got the issue (it happens only on few devices of each type otherwise I would have much more crash reports):
- crane-a702jhorange
- MW0712
- Tablet S (nbx03)
- List item
- Galaxy Y (GT-S5360B)
- Galaxy Y Duos (GT-S6102)
- rk2928sdk
- rk2928sdk
- rk2928sdk
- Galaxy Note II(t03g)
- Galaxy Mini (GT-S5570I)
- e1901_v77_jdt1_9p017_fwvga
- Nexus S (crespo)
- Galaxy Ace (GT-S5830i)
- crane-inet
- ITP-R208W (rk30sdk)