Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backicon.png: error: Invalid filename. Unable to add. #1

Open
joelcloralt opened this issue Jun 20, 2016 · 27 comments
Open

backicon.png: error: Invalid filename. Unable to add. #1

joelcloralt opened this issue Jun 20, 2016 · 27 comments

Comments

@joelcloralt
Copy link

There seems to be an issue with the naming convention used for the back-icon.png. I got an error trying to assemble the Android app. iOS works fine.

When running ./gradlew aseembleRelease for Android, the build fails specifically with:

Unknown source file : /Users/joelcloralt/code/MyApp/android/app/build/intermediates/res/merged/release/drawable-mdpi/node_modules_reactnativerouterflux_node_modules_reactnativeexperimentalnavigation_assets_backicon.png: error: Invalid filename.  Unable to add.

I'm using:

"react": "^15.1.0",
"react-native": "^0.27.2",
"react-native-router-flux": "3.30.0",

I solved the issue by changing this line in NavigationHeaderBackButton.js to simply use require('./back_chevron.png'). Then deleted the app/build folder and ran the aseembleRelase again and that worked. This is just a workaround so that's why I'm submitting the ticket.

Here is a little bit more from the build log.

bundle: start
bundle: finish
bundle: Writing bundle output to: /Users/joelcloralt/code/MyApp/android/app/build/intermediates/assets/release/index.android.bundle
bundle: Done writing bundle output
bundle: Copying 22 asset files
bundle: Done copying assets
:app:processReleaseManifest UP-TO-DATE
:app:processReleaseResources
Unknown source file : /Users/joelcloralt/code/MyApp/android/app/build/intermediates/res/merged/release/drawable-mdpi/node_modules_reactnativerouterflux_node_modules_reactnativeexperimentalnavigation_assets_backicon.png: error: Invalid filename.  Unable to add.

:app:processReleaseResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/joelcloralt/Library/Android/sdk/build-tools/23.0.1/aapt'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

@aksonov
Copy link
Owner

aksonov commented Jun 20, 2016

It is strange, back-button is placed within assets folder and it is exactly the same as in original NavigationExperimental...

@leonardokl
Copy link

I had the same problem.
The same workaround worked to me.

My settings:

"react": "^15.1.0",
"react-native": "^0.27.0-rc2",
"react-native-router-flux": "^3.30.0",

@cyphire
Copy link

cyphire commented Jul 27, 2016

Same error, same problem, same fix. Thanks joel et. al.!

@florentdestremau
Copy link

I have the same issue on ubuntu , is there a proper way to handle this ? Changing the sources are not a proper kind of solution..

@cyphire
Copy link

cyphire commented Aug 4, 2016

I just implemented my own, simple top menu bar. Made it a component. It
calls the right and left menus. I still use the router, but I don't show
the menu up top. So much easier and keeping it in my control has made
things much simpler.

If only I could figure out how to get the screens to stop coming from the
right only (including my menus)...


Brian B. Canin [email protected]

858-945-5601 (cell)

On Thu, Aug 4, 2016 at 5:50 AM, Florent Destremau [email protected]
wrote:

I have the same issue on ubuntu , is there a proper way to handle this ?
Changing the sources are not a proper kind of solution..


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAUnhrmoYDVZtwgjS_bRP90kBdvFPau-ks5qccP5gaJpZM4I5lEv
.

@juanpasolano
Copy link

juanpasolano commented Aug 10, 2016

Having the same issue

"react": "15.2.1",
"react-native": "0.30.0",
"react-native-router-flux": "^3.32.0",

@joelbriggs
Copy link

Had the same problem and this fixed it. Thanks a bunch!

@blackavec
Copy link
Contributor

blackavec commented Sep 8, 2016

shoudn't we create PR for it?
i also have the same issue, which fixed after change to ./back_chevron.png

    "react": "15.3.1",
    "react-native": "0.32.0",
    "react-native-router-flux": "^3.35.0",

i'm running it on android.
we can easily make ./assets/back-icon.png in order to not even need to change anything on code
if people are not working on it, i can make PR

@florentdestremau
Copy link

please do 😃

@blackavec
Copy link
Contributor

@florentdestremau as u asked, here is the result, i created a pull request due to the issue.
i also explained how i fixed the issue in PR

#6

@blackavec
Copy link
Contributor

blackavec commented Sep 12, 2016

my PR has been merged @florentdestremau @joelcloralt.
i tested it, it works fine now, i left the screenshot as well.

important: don't forget to run the following command before ./gradlew aseembleRelease

# this might take a bit long but it's safer than update the npm modules
# remove the node_modules and install again

rm -rf node_modules && npm install

image

@eppisapia-legacy
Copy link

and you have to update all the libraries or just router-flux?

@blackavec
Copy link
Contributor

i didn't update @eppisapia . to make sure everything is correct i just remove all of my modules and install again but if u want to do update, yes u should only update router-flux, it will update its dependencies and do the minor update onn all of them .

aksonov pushed a commit that referenced this issue Apr 11, 2017
feat(animation): use native driver for animations
@cbrevik
Copy link

cbrevik commented May 9, 2017

Recently I upgraded react-native to 0.44.0, and upgraded react-native-router-flux at the same time. Now I'm getting this error on OSX.

"react": "16.0.0-alpha.6",
"react-native": "0.44.0",
"react-native-router-flux": "^3.38.1"

@aksonov
Copy link
Owner

aksonov commented May 9, 2017

@cbrevik Could you check latest master version?

@cbrevik
Copy link

cbrevik commented May 9, 2017

@aksonov of react-native-router-flux? Since I seem to be using the latest version (3.38.1) which is the same as master there.

It has resolved 0.26.10 of react-native-experimental-navigation as a dependency.
Edit: My bad, that is before the fix. I'll try the latest of this repository.

@cbrevik
Copy link

cbrevik commented May 9, 2017

@aksonov I've tried adding "react-native-experimental-navigation": "git://github.com/aksonov/react-native-experimental-navigation.git#c02cd04" as a dependency in my package.json. But I still seem to get this issue.

As an aside, I also get a whole lot of This warning is caused by a @providesModule declaration with the same name across two different files. from react-native-router-flux colliding with react-native files, with the latest RN version.

@cbrevik
Copy link

cbrevik commented May 10, 2017

I've tried any number of combinations of earlier versions of react-native-router-flux (3.35.0 up to 3.38.1) and react-native.

Using a lower version than 3.38.0 with RN 0.44.0 gives me the build error involving react-addons-pure-render-mixin, whilst 3.38.1 gives me the error in this issue.

Using 3.35.0 ~ 3.38.0 with RN <= 0.42.0 works fine.

There's two crashing bugs for Android, that are fixed in RN 0.44.0. A lot of my users are experiencing it, so I'd like to upgrade. But I'm sort of blocked by this error.

@imalik8088
Copy link

imalik8088 commented May 12, 2017

Same here:

Error log
...../android/app/build/intermediates/res/merged/release/drawable-mdpi/node_modules_reactnativerouterflux_node_modules_reactnative_libraries_customcomponents_navigationexperimental_assets_backicon.png: error: Invalid filename. Unable to add.

I've tried to get the latest version from react-native-router-flux and react-native-experimental-navigation

....
    "react-native": "0.44.0",
    "react-native-experimental-navigation": "git+https://github.com/aksonov/react-native-experimental-navigation.git",
    "react-native-router-flux": "git+https://github.com/aksonov/react-native-router-flux.git",

Any ideas why this backicon.png issue is still there?

@aksonov
Copy link
Owner

aksonov commented May 13, 2017

Sorry, I can't help here because I'm using only iOS. I've just upgraded to RN0.44, iOS Example now works fine (3.39.1 version)

@jinookoo
Copy link

I guess, the file name is too long in Java.
The file name can't be more than 255 byte but the file name length is 129.
in Java, character allocate 2byte.

node_modules_reactnativerouterflux_node_modules_reactnative_libraries_customcomponents_navigationexperimental_assets_backicon.png

So, although if the file exactly exist, gradle can't find file.

If I change file name to "backicon.png"
No problem.

It just in my case, opinion & solution

sorry for poor eng

@output4
Copy link

output4 commented May 26, 2017

@eyu0415, how you do that?

@Dhrupal
Copy link

Dhrupal commented Jul 27, 2018

eyu0415 which png file you renamed? I am not finding the same file in my project.

@Luckygirlllll
Copy link

Have the same problem, is there any good solution so far?

@Luckygirlllll
Copy link

@eyu0415 where exactly did you change the name of that icon? in /android/app/build/intermediates/res/merged/release/drawable-mdpi/node_modules_reactnativerouterflux_node_modules_reactnavigationstack_dist_views_assets_backiconmask.png ?

@mirzaumersaleem
Copy link

Thanks @leonardokl same workaround worked to me.

@zainmusani
Copy link

zainmusani commented Sep 26, 2018

yarn remove react-native-router-flux
yarn remove react-navigation
yarn add react-native-router-flux
cd android && ./gradlew clean
./gradlew assembleRelease

I know that I missed yarn add react-navigation . Because this is not required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests