Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.
This repository was archived by the owner on May 20, 2025. It is now read-only.

Requiring images with latest gradle fails release builds  #1214

@akrumel

Description

@akrumel

Steps to Reproduce

Here are the steps to reproduce it:

  1. Init a new project: react-native init Test
  2. Update to latest Gradle:
    • Open Android Studio and install recommended version
    • Build from Android Studio 3, it should ask you to update build tools, do so
  3. Require an image in index.js
  4. Run cd android && ./gradlew assembleRelease

Expected Behavior

The command ./gradlew assembleRelease should not fail.

Actual Behavior

Running ./gradlew assembleRelease when the image is required from the JS fails with:

/Users/almouro/bam/uefa/TestGradle3/android/app/build/intermediates/res/merged/release/drawable-mdpi/image.png: error: uncompiled PNG file passed as argument. Must be compiled first into .flat file.
error: failed parsing overlays.

If the image is not required, the command works fine.

This is due to a bug in /node_modules/react-native/react.gradle file and aapt2 used in Android Studio 3. RN Issue 17967 is a PR that is beign integrated to fix the issue but this fails when using codepush:

Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Circular dependency between the following tasks:
:app:bundleProductionReleaseJsAndAssets
\--- :app:recordFilesBeforeBundleCommandProductionRelease
     \--- :app:mergeProductionReleaseResources
          \--- :app:bundleProductionReleaseJsAndAssets (*)

as documented RN 16906

Environment

  • react-native-code-push version: v5.0.0-beta
  • react-native version: v 0.53.3
  • iOS/Android/Windows version: Android
  • Android Studio: v3
  • Does this reproduce on a debug build or release build? release
  • Does this reproduce on a simulator, or only on a physical device? build error

The RN PR has been integrated so this bug is critical.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions