-
-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Adding file to Android build at app/src/main/assets for getAssets()
#700
Comments
Any news on this? |
@vjoao , @Pip3r4o , I created a small hook to avoid this issue: https://github.com/rhanb/nativescript-dev-assets/ Hope it can help 😄 |
Addressed by introducing the |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
@bradmartin commented on Thu Feb 02 2017
Please, provide the details below:
Trying to build a plugin which is calling the following code:
The public method to get to that ^^^ is just accepting a string for the
fileName
argument. The README for the android lib says to put the file atapp/src/main/assets
. I've tried creating anassets
folder in app_resources which obviously doesn't package up there. I've tried at the root of theapp
folder and no good. So is there some way to add files (this is a .json file) to that location for an android build with NS. The android code callinggetAssets()
returns the AssetManager and is callingopen()
with the given file name. So how do we get files to be accessible with this in a NS app is the question now that I think about it 😄Did you verify this is a real problem by searching Stack Overflow and the other open issues in this repo?
Yes.
Which platform(s) does your issue occur on?
Android
Please provide the following version numbers that your issue occurs with:
NS 2.5 everything - just updated.
Please tell us how to recreate the issue in as much detail as possible.
Create an app, try to create an .apk with a file located in
app/src/main/assets
at the output I suppose.Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
No, just wrapping a lib.
@bradmartin commented on Thu Feb 02 2017
There is another method to go about, but was hoping to access the simplest of them with just passing the file name 👍
@bradmartin commented on Thu Feb 02 2017
And opening up
platforms/android/src/main/assets
and placing the .json file isn't really a good solution for new NS devs or anyone since it'll be blasted during a build/platform clean. Doing this does work, so the native lib is expecting the file to be located in theassets
folder.The text was updated successfully, but these errors were encountered: