0

I'm using the google Sign In button this way :

<com.google.android.gms.common.SignInButton
    android:id="@+id/sign_in_button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

In my app, at runtime, the button works like a charm, but in the Android Studio's layout editor, i have this error :

The exception

The library is properly imported through gradle, properly configured (the meta-data tags in the manifest are present), etc.

Is there a way to fix this ?

EDIT:

The same error occurs for every GPS views, in fact, even for my AdView, and i'm pretty sure that i used to be able to design it through the editor without any modification ...

Community
  • 1
  • 1
Rogue
  • 751
  • 1
  • 17
  • 36

2 Answers2

0

As your editor says View.isInEditMode(). See this post on how to do that. It suggests to use isInEditMode() in the constructor of the view. But as you are using google's SignInButton button the only way to achieve what you want(in my opinion not so sure) is to extend SignInButton button class and in its constructor override use isInEditMode().

Community
  • 1
  • 1
Illegal Argument
  • 10,090
  • 2
  • 44
  • 61
0

Try to switch to Java 7:

   compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }