question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Long image filenames result in assembleRelease crash

See original GitHub issue

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

  1. react-native -v: 0.45.1
  2. node -v: v8.2.1
  3. npm -v: 5.3.0
  • Target Platform: Android

  • Development Operating System: macOS

  • Build tools: compileSdkVersion 23 buildToolsVersion ‘25.0.0’

Steps to Reproduce

  1. Create a file in a deep folder (e.g. /shared/components/Component/components/AnotherComponent/components/AnotherComponent/components/AnotherComponent/img/image.png)
  2. Require that file
  3. 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:

  1. clone repo
  2. npm install
  3. run ./android/assembleRelease

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
dante8300commented, Aug 10, 2018

Hi this is the future and i confirm this is still an issue…

1reaction
mlazaricommented, Oct 15, 2018

Related Android bug: https://issuetracker.google.com/issues/36953084 It looks like the resulting drawable file name should be no longer than 100 characters.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found