2

I am using

dependencies {
   compile 'com.android.support:appcompat-v7:24.0.0'
}

for

android {
   compileSdkVersion 24
   buildToolsVersion "23.0.3"
   minSdkVersion 18
   targetSdkVersion 24
}

I have an Activity with a theme

<style name="BaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
</style>

and would like to use a layout with switches. I used

<android.support.v7.widget.SwitchCompat />

earlier (with older SDK versions) and it worked fine. Now however, SwitchCompat switches render wired. Here is what I get for the two different switches in my layout:

<android.support.v7.widget.SwitchCompat
   android:text="android.support.v7.widget.SwitchCompat"/>
<android.support.v7.widget.SwitchCompat
   android:text="Switch" />

In OFF

Switches in off position

and in ON mode

Switches in on position

Is this a bug in the Android N SDK? Or the appcompat-v7:24.0.0? Od did I miss something?

GulBrillo
  • 901
  • 7
  • 9

1 Answers1

-2

The problem is --no-crunch in combination with targetSdkVersion 24. Removing --no-crunch solved the issue for me.

I am using Xamarin, so I had <AndroidResgenExtraArgs>--no-crunch </AndroidResgenExtraArgs> in my .csproj file. I don't know where is --no-crunch specified in native android but I guess it won't be a problem to find id.

David Riha
  • 1,368
  • 14
  • 29