Skip to content

Android prod release - gradle tools 3 error #3097

@kelset

Description

@kelset

This is basically a "reload" of issue #1976 because it became polluted and hard to follow.

Current Behavior

When using Android Studio 3.0, gradle 4.1 & gradle tools 3.0.0 (build tools 26.0.2) (or higher), creating a production release is impossible because of this error:

uncompiled PNG file passed as argument. Must be compiled first into a .flat file.. error: failed parsing overlays.

Which is it's caused by the asset files that gets bundled, like: node_modules_reactnavigation_src_views_assets_backicon.png

It's clearly related to AAPT2, the new version present in gradle tools 3.0 - but even the migration guide doesn't seem to offer an explanation for this kind of error. This SO answer seems to provide some more details but, yeah, until better explanations here are some workarounds:

Expected Behavior

That everything gets bundled properly with AAPT2.

Your Environment

As already stated, Android Studio 3.0, gradle 4.1 & gradle tools 3.0.0 (build tools 26.0.2). Doesn't look like it's related to rn/navigation versions, but still happens with latest:

software version
react-navigation beta.21
react-native 0.51
node 8.9.x
yarn 1.3.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions