aksonov / react-native-experimental-navigation

React Native ExperimentalNavigation clone (RN0.26 API) used by RNRF
Other
31 stars 53 forks source link

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

Open joelcloralt opened 8 years ago

joelcloralt commented 8 years ago

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 commented 8 years ago

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

leonardokl commented 8 years ago

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 commented 8 years ago

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

florentdestremau commented 8 years ago

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 commented 8 years ago

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 brian.canin@gmail.com

858-945-5601 (cell)

On Thu, Aug 4, 2016 at 5:50 AM, Florent Destremau notifications@github.com 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 https://github.com/aksonov/react-native-experimental-navigation/issues/1#issuecomment-237519802, or mute the thread https://github.com/notifications/unsubscribe-auth/AAUnhrmoYDVZtwgjS_bRP90kBdvFPau-ks5qccP5gaJpZM4I5lEv .

juanpasolano commented 8 years ago

Having the same issue

"react": "15.2.1",
"react-native": "0.30.0",
"react-native-router-flux": "^3.32.0",
joelbriggs commented 8 years ago

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

blackavec commented 8 years ago

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 commented 8 years ago

please do :smiley:

blackavec commented 8 years ago

@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

https://github.com/aksonov/react-native-experimental-navigation/pull/6

blackavec commented 8 years ago

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 commented 8 years ago

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

blackavec commented 8 years ago

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 .

cbrevik commented 7 years ago

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 commented 7 years ago

@cbrevik Could you check latest master version?

cbrevik commented 7 years ago

@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 commented 7 years ago

@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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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)

eyu0415 commented 7 years ago

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 commented 7 years ago

@eyu0415, how you do that?

Dhrupal commented 6 years ago

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

Luckygirlllll commented 6 years ago

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

Luckygirlllll commented 6 years ago

@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 commented 6 years ago

Thanks @leonardokl same workaround worked to me.

zainmusani commented 6 years ago
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.