Long image filenames result in assembleRelease crash
See original GitHub issueIs this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
react-native -v
: 0.45.1node -v
: v8.2.1npm -v
: 5.3.0
-
Target Platform: Android
-
Development Operating System: macOS
-
Build tools: compileSdkVersion 23 buildToolsVersion ‘25.0.0’
Steps to Reproduce
- Create a file in a deep folder (e.g.
/shared/components/Component/components/AnotherComponent/components/AnotherComponent/components/AnotherComponent/img/image.png
) - Require that file
- Run
assembleRelease
Expected Behavior
Successful assembly
Actual Behavior
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.
Reproducible Demo
https://github.com/joachimroeleveld/rn-issue-15509
Steps to reproduce:
- clone repo
npm install
- run
./android/assembleRelease
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:8 (2 by maintainers)
Top Results From Across the Web
RN Issue Triage Group 2 · Issue #24029 · facebook/react-native
React Native Android app that uses websockets is crashing as webview is not ... Long image filenames result in assembleRelease crash #16263 Long...
Read more >App crashes when an uploaded large image is sent to the next ...
I have searched through google and even youtube for videos. The code works perfectly when uploading and displaying the large image ...
Read more >Build and release an Android app - Flutter documentation
(The flutter build command defaults to --release .) This command results in three APK files: [project]/build/app/outputs/apk/release/app-armeabi- ...
Read more >Windows Explorer crash on NVMe drive. - Microsoft Community
When I try to view thumbnails on the folders with a lot of images with the long names it crashes windows explorer back...
Read more >crashes while exporting with long file names – Adobe InDesign
My InDesign Seems to crash every time I try to export a file to pdf with a filename that is longer than 40...
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 FreeTop 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
Top GitHub Comments
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.