Status Update
Comments
uc...@google.com <uc...@google.com>
xa...@google.com <xa...@google.com>
cm...@google.com <cm...@google.com> #2
Thanks for the reproducible test case.
This seems like an AAPT2 issue.
Running the APK built with 3.0-beta7 shows the issue, and disabling AAPT2 fixes it. De-inlining the inner <aapt:attr > to be a normal reference also fixes it.
To repro: take the test project, update the plugin to beta 7
gradle :app:installDebug
- observe that the lower button does not animate correctly
gradle -Pandroid.enableAapt2=false :app:installDebug
- observe that it works correctly now.
This seems like an AAPT2 issue.
Running the APK built with 3.0-beta7 shows the issue, and disabling AAPT2 fixes it. De-inlining the inner <aapt:attr > to be a normal reference also fixes it.
To repro: take the test project, update the plugin to beta 7
gradle :app:installDebug
- observe that the lower button does not animate correctly
gradle -Pandroid.enableAapt2=false :app:installDebug
- observe that it works correctly now.
pe...@gmail.com <pe...@gmail.com> #3
Still goes on Android Studio 3.0.0
ha...@gmail.com <ha...@gmail.com> #5
This is still not working in version 3.0.1. And setting enableAapt2=false causes duplicates of ID-tags in the IDE. That is really bad for development, since you don't know if you are referencing the right ID.
But then the animation works with this hack.
But then the animation works with this hack.
ad...@google.com <ad...@google.com> #6
Have you set your build tools version to 27.0.2?
ha...@gmail.com <ha...@gmail.com> #7
Yes we have downgraded to buildToolsVersion: 27.0.2.
The animation works but we get duplicated ID's.
I'll send a screenshot.
The animation works but we get duplicated ID's.
I'll send a screenshot.
cm...@google.com <cm...@google.com> #8
#7 is a different issue, please can you file it separately.
Description
I've attached a sample project. Steps to reproduce:
1. Build and run the app
2. Tap the buttons, both stars should animate when tapped.
3. Go in to the root build.gradle and change the build tools to 3.0.0-beta7
4. Sync
5. Clean
6. Build and run the app
The top star should still work as before but the bottom one does not, it does not animate when tapped and is also stuck in the checked state.
Gradle version: 4.1
Android Plugin Version: 3.0.0-beta7
Module Compile Sdk Version: 26
Module Build Tools Version: 26.0.2
Android SDK Tools version: 26.1.1
Here is the contents of the file that is broken:
<?xml version="1.0" encoding="utf-8"?>
<animated-selector
xmlns:aapt="
xmlns:android="
<item
android:id="@+id/checked"
android:drawable="@drawable/ic_star_checked"
android:state_selected="true" />
<item
android:id="@+id/unchecked"
android:drawable="@drawable/ic_star_unchecked" />
<transition
android:fromId="@+id/unchecked"
android:toId="@+id/checked">
<aapt:attr name="android:drawable">
<animated-vector android:drawable="@drawable/ic_star_checked">
<target android:name="fill">
<aapt:attr name="android:animation">
<objectAnimator
android:duration="500"
android:interpolator="@android:interpolator/fast_out_slow_in"
android:propertyName="strokeWidth"
android:valueFrom="0"
android:valueTo="10"
android:valueType="floatType"/>
</aapt:attr>
</target>
</animated-vector>
</aapt:attr>
</transition>
<transition
android:fromId="@+id/checked"
android:toId="@+id/unchecked">
<aapt:attr name="android:drawable">
<animated-vector android:drawable="@drawable/ic_star_checked">
<target android:name="fill">
<aapt:attr name="android:animation">
<objectAnimator
android:duration="500"
android:interpolator="@android:interpolator/fast_out_slow_in"
android:propertyName="strokeWidth"
android:valueFrom="10"
android:valueTo="0"
android:valueType="floatType"/>
</aapt:attr>
</target>
</animated-vector>
</aapt:attr>
</transition>
</animated-selector>