Status Update
Comments
am...@google.com <am...@google.com> #2
Thank you for reporting this issue. We have shared this with our product and engineering team and will update this issue with more information as it becomes available.
al...@google.com <al...@google.com> #3
This is a platform issue that was fixed in Android O. You can work around it for now by creating your themes such that attributes only point to @string references rather than inline string data. For example,
<style name="AppCompatTheme" parent="android:...">
<item name="fontFamily">@string/sans_serif</item>
</style>
...
<string name="sans_serif" untranslateable="true">sans-serif</string>
...
We will also implement this workaround as an automatic fix in AAPT2 for a future release.
<style name="AppCompatTheme" parent="android:...">
<item name="fontFamily">@string/sans_serif</item>
</style>
...
<string name="sans_serif" untranslateable="true">sans-serif</string>
...
We will also implement this workaround as an automatic fix in AAPT2 for a future release.
al...@google.com <al...@google.com> #4
Leaving this open and blocked on AAPT2 workaround.
am...@google.com <am...@google.com>
jo...@fueledbycaffeine.com <jo...@fueledbycaffeine.com> #5
Using the latest build-tools version (29.0.0) and this is _still_ not fixed. The stacktraces from the runtime crash give no indication that this is an issue with the fontFamily attribute in styles and was therefore very difficult to debug and solve.
di...@gmail.com <di...@gmail.com> #6
I can confirm that the automatic fix is not yet in place. However doing the manual workaround worked fine.
Description
Version used: 26.0.0
Theme used: Theme.AppCompat.Light.DarkActionBar , with <item name="android:fontFamily">roboto-medium</item>
Devices/Android versions reproduced on: 25 and lower
- Relevant code to trigger the issue.
Toast.makeText(this,"I will now crash", Toast.LENGTH_SHORT).show();
Project attached, run with an emulator/device with api lower than 26,