Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android FloatingActionButton suddenly is transparent only on ProGuard build

After updating my AppCompat library to 25 when I build release with proguard all of my FloatingActionButton backgrounds are transparent. When i build a debug build without proguard it is colored like it should be.

Layout

 <android.support.design.widget.FloatingActionButton
    android:id="@+id/fab_upload"
    android:visibility="gone"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    app:layout_anchor="@id/content_frame"
    app:layout_anchorGravity="bottom|right|end"
    app:borderWidth="0dp"
    android:src="@drawable/app_fab_upload"
    android:layout_margin="@dimen/big_padding"
    android:clickable="true"
    app:backgroundTint="@color/fab_social"/>

Gradle

compileSdkVersion = 25
buildToolsVersion = '25.0.0'
supportLibVersion = '25.0.0'

supportLibAppCompat = "com.android.support:appcompat-v7:$supportLibVersion"
supportLibCardView = "com.android.support:cardview-v7:$supportLibVersion"
supportLibRecyclerView = "com.android.support:recyclerview-v7:$supportLibVersion"
supportLibDesign = "com.android.support:design:$supportLibVersion"
supportLibPalette = "com.android.support:palette-v7:$supportLibVersion"
supportLibPercent = "com.android.support:percent:$supportLibVersion"

I don't have any references to AppCompat in my proguard config.

UPDATE

I just tried another one of my projects and it has the same issue. The issue seems to stem from updating Android Studio to 2.3 Canary build.

like image 789
BigDX Avatar asked Nov 14 '16 17:11

BigDX


1 Answers

I have found and fixed the issue.

As stated in my update above the issue started when I updated to Android Studio 2.3 Canary. When doing that is updated my android build tools to 2.3 alhpa. I changed it back to

classpath 'com.android.tools.build:gradle:2.2.2'

and now the fab is as it should be.

To clarify I am still on Android Studio 2.3 Canary, I just did not update the android build tools.

like image 106
BigDX Avatar answered Nov 03 '22 12:11

BigDX