-
Notifications
You must be signed in to change notification settings - Fork 182
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
Node module folders starting with underscore not copied on Android #60
Comments
I received a reply from @jaimecbernardo in the Gitter chat Hi @antoniuschan99 , Thank you for reporting it and opening the issue. The aapt (Android Asset Packaging Tool) seems to ignore any folders starting with an underscore, so they end up not being copied to the APK. It must be the There must be a way to define a different ignore pattern for your Android project, and figuring it out is on our list of TODOs. In the meanwhile, I hope this was helpful and please let us know if you find a solution and if you're on react-native, cordova or pluginless scenario. |
I'll add the workaround that was found for @antoniuschan99 case here. If someone knows of a better/distinct solution that could possibly be made to work just from the plugin, we'd appreciate if you could leave a comment. Thank you, in advance. As a workaround for the react-native plugin, it's possible to get the paths starting with underscore to be included in the APK, by overriding the Android Asset Packaging Tool ignore pattern for both the react-native application and the plugin, by adding the following:
inside The files have similar structures that look something like this:
It may be necessary to do a proper gradle clean after these changes before running the application. From the react-native project folder, run:
This workaround isn't a permanent solution for the plugin. While one of the gradle files involved in the workaround is inside the plugin, the application gradle file is created by react-native, so we'll still have to look for a more permanent solution that doesn't involve editing that file manually. |
confirmed this fixes it :) |
Just wanted to leave noted here the pattern suggested by @jaimecbernardo that worked for me to get scuttlebot working:
|
In @luandro 's case ( #60 (comment) ), he had issues with directories starting with underscore (
The correct pattern to use depends on the files that are causing issues. |
I confirm that this issue still is the case in 2019, however the workaround still works! Thanks! |
This stills happens at of now (2020). It would be nice to include the fix, having to manually change |
I am having to make this fix inside node_modules in 2023. |
Still required in 2024 to make use of the openai library. Alas couldn't get it working as the gradle files have changed format apparently so rolled my own openai api. |
I am able to get iOS working for a project but have much trouble getting Android working.
It successfully builds, but it seems to not be able to read a file in node_modules which causes the app to crash after launch. The files are there in node_modules too. It seems to have to do with the
_generated_
folder?Here is the log in logcat
Node assets copy failed at com.janeasystems.rn_nodejs_mobile.RNNodeJsMobileModule$1.run(RNNodeJsMobileModule.java:86) at java.lang.Thread.run(Thread.java:764) Caused by: java.io.FileNotFoundException: nodejs-project/node_modules/node-opcua-service-read/_generated_/_auto_generated_ReadValueId.js
The text was updated successfully, but these errors were encountered: