android icon indicating copy to clipboard operation
android copied to clipboard

[metadata] not rebuilding on json api usage change

Open farfromrefug opened this issue 5 years ago • 3 comments
trafficstars

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

farfromrefug avatar Feb 16 '20 14:02 farfromrefug

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.

rosen-vladimirov avatar Feb 19 '20 16:02 rosen-vladimirov

@rosen-vladimirov exactly what i am seeing! Thanks

farfromrefug avatar Feb 19 '20 16:02 farfromrefug

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.

vmutafov avatar Feb 19 '20 17:02 vmutafov