Yes
Yes
react-native -v: 0.45.1node -v: v8.2.1npm -v: 5.3.0Development Operating System: macOS
Build tools:
compileSdkVersion 23
buildToolsVersion '25.0.0'
/shared/components/Component/components/AnotherComponent/components/AnotherComponent/components/AnotherComponent/img/image.png)assembleReleaseSuccessful assembly
Assembly fails when processing the file:
.../app/android/app/build/intermediates/res/merged/release/drawable-mdpi/shared_components_component_components_anothercomponent_components_anothercomponent_components_anothercomponent_img_image.png: error: Invalid filename. Unable to add.
:app:processReleaseResources FAILED
FAILURE: Build failed with an exception.
It's probably the long filename that cannot be handled by Java. When I undeepen the structure, the problem disappears. If a hash of the path would be used as a filename, this problem would not exist.
https://github.com/joachimroeleveld/rn-issue-15509
Steps to reproduce:
1) clone repo
2) npm install
3) run ./android/assembleRelease
Same issue:
.../mobile_node_modules_reactnative_libraries_customcomponents_navigationexperimental_assets_backicon.png
Invalid filename. Unable to add.
The names of assets files converting at the getAndroidResourceIdentifier() method.
https://github.com/facebook/react-native/blob/164591218f5fab7d386e057e0d51b9c1fe30b0a9/local-cli/bundle/assetPathUtils.js#L58
I suggest to modify getAndroidResourceIdentifier() method by drastically change filenames with using md5
function getAndroidResourceIdentifier(asset: PackagerAsset) {
var folderPath = getBasePath(asset);
return 'a' + md5(folderPath + '/' + asset.name).toLowerCase();
}
Return value should not begins from digit. For this at the beginning of the line the symbol 'a' (shortened from the 'assets')
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.
This should really not be closed as this is still a problem and it will affect more people in the future.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions.
Hi this is the future and i confirm this is still an issue...
Related Android bug: https://issuetracker.google.com/issues/36953084 It looks like the resulting drawable file name should be no longer than 100 characters.
馃憢 hey all, thanks for the report and additional Android issue tracker details.
I'm going to close this issue as it's out of our control, but let's track this over on the Known Issues list instead.
Feel free to continue the conversation though if needed and update on the status of the Android issue tracker should anything change.
Thank you
Most helpful comment
Hi this is the future and i confirm this is still an issue...