Skip to content
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

[metadata] not rebuilding on json api usage change #1589

Closed
farfromrefug opened this issue Feb 16, 2020 · 3 comments
Closed

[metadata] not rebuilding on json api usage change #1589

farfromrefug opened this issue Feb 16, 2020 · 3 comments
Assignees

Comments

@farfromrefug
Copy link
Contributor

i am starting to include native-api-usage.json in my app.
Right now i need to run to see what s being used, update the file, run again.
My issue is that the rebuild of metadata is not triggered on native-api-usage.json, so i need to remove the platforms folder and start again which is slow.

Could you add that feature?
Thanks

@rosen-vladimirov rosen-vladimirov transferred this issue from NativeScript/nativescript-cli Feb 19, 2020
@rosen-vladimirov
Copy link
Contributor

Hey @farfromrefug ,
I've transferred this issue to android-runtime repository as the problem is only for Android. NativeScript CLI detects the change in the native-api-usage.json file and triggers native build, but it seems some of the gradle tasks are not executed in this case.
Steps to reproduce:

tns create myApp --js
cd myApp
touch app/App_Resources/Android/native-api-usage.json
echo '{ "whitelist":["java.util:List"] }' > app/App_Resources/Android/native-api-usage.json
tns run android --justlaunch # app will fail at runtime
echo '{ }' > app/App_Resources/Android/native-api-usage.json
tns run android --justlaunch # app should work, but it still fails at runtime
rm -rf platforms
tns run android --justlaunch # app will work

NOTE: The issue will be reproduced even if you use tns run android and change the native-api-usage.json file.

@farfromrefug
Copy link
Contributor Author

@rosen-vladimirov exactly what i am seeing!
Thanks

@vmutafov
Copy link
Contributor

I made a simple change in the build.gradle of the apps and this should do the trick to run the buildMetadata task. I linked a PR here. I'll test it properly tomorrow as it's getting late now.

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

No branches or pull requests

4 participants