Skip to content

Package is not a valid resource name #25645

@crispywong

Description

@crispywong

Having following issue when running command ./gradlew :app:assembleprodRelease with enableHermes: true. package.json is generated under folder android/app/build/generated/res/react/release/raw/ after execute command

Execution failed for task ':app:mergeProdReleaseResources'.
> 
android/app/build/generated/res/react/prod/release/raw/package.json: Error: package is not a valid resource name (reserved Java keyword)

There are 2 product flavors (stag and prod) for the project. Using below dependencies:
package.json

"react-native": "^0.60.3",
"react-native-fbsdk": "1.0.0-rc.5"

Below is the hermes dependency added in android/app/build.gradle

dependencies {
    if (enableHermes) {
      def hermesPath = "../../node_modules/hermesvm/android/";
      debugImplementation files(hermesPath + "hermes-debug.aar")
      releaseImplementation files(hermesPath + "hermes-release.aar")
      stagImplementation files(hermesPath + "hermes-release.aar")
      prodImplementation files(hermesPath + "hermes-release.aar")
    } else {
      implementation jscFlavor
    }
}

Same error when running command react-native run-android --variant prodRelease --appId <appId> --main-activity MainActivity

Even clean android/build folder using command ./gradlew :app:clean, issue still persist. Is there any other way to fix this error?

Any help would be very appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugRan CommandsOne of our bots successfully processed a command.Resolution: LockedThis issue was locked by the bot.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions