Package is not a valid resource name
See original GitHub issueHaving 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.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:14 (1 by maintainers)
Top Results From Across the Web
mergeReleaseResources Failed, caused of `not valid ...
The easiest way to solve this problem is to update to react-native 0.61.x . The whole solution can be found here.
Read more >FileResourceNameValidator.java - android Git repositories
@param file the file resource to validate. * @param resourceType the resource type. * @throws MergingException is the resource name is not valid....
Read more >Resources | Android Developers
Return the package name for a given resource identifier. ... This denotes an invalid resource ID that is returned by the system when...
Read more >'L' is not a valid file based resource name character - YouTube
Hi Hello friends 'L' is not a valid file-based resource name character: File-based resource names must contain only lowercase a-z, 0-9, ...
Read more >Error: ':' is not a valid resource name character - YouTube
SOLUTION: File Based Name Character Error | Error: ':' is not a valid resource name character#androidstudio #solution #errorfixed Error in ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@crispywong Why don’t import the
package.json
in theapp
? I’m using this to show the version in the app. Is this a bad practice?I imported
package-lock.json
instead ofpackage.json
, seems to work fine, fuck the police