-
-
Notifications
You must be signed in to change notification settings - Fork 141
Description
Environment
Provide version numbers for the following components (information can be retrieved by running tns info
in your project folder or by inspecting the package.json
of the project):
- CLI: 5.2.0
- Cross-platform modules: 5.2.1
- Android Runtime: 5.2.0
- iOS Runtime (if applicable): Not applicable
- Plugin(s): nativescript-feedback 1.3.6, but check steps to reproduce when you should add it to your project.
Describe the bug
In case you have build your application and add new plugin with native code after that, rebuilding of app does not use the new plugin's aar, so native methods cannot be called from application's code.
I.e. when you create an application and build it, after that you add a plugin, which has native code and run the application on device/emulator (NOTE: you have not deleted the platforms dir), the application runs fine, but the plugin's code is not working as JS code cannot call the native methods.
To Reproduce
You can use the project from this repository: https://github.com/rosen-vladimirov/app-feedback-plugin-issue
As described in its README.md, steps to reproduce are:
- Clone this repository:
git clone https://github.com/rosen-vladimirov/app-feedback-plugin-issue.git
- Get to the project dir:
cd app-feedback-plugin-issue
- Build the project:
tns build android
- Now add
nativescript-feedback
plugin:npm i --save nativescript-feedback
- Open
app/main-view-model.js
and uncomment the commented sections. This way once you tap on the button, you will see a notification. - Run
tns run android
- Tap the button - no notification is shown.
- Stop
tns run android
command with Ctrl + C - Delete
platforms
directory:rm -rf platforms
- Run
tns run android
again. - Once application is running, tap the button on device - you should see the notification now.
Expected behavior
Users should be able to add plugins and the build process should respect them no matter if application has been build before that.
Sample project
https://github.com/rosen-vladimirov/app-feedback-plugin-issue
Additional context
It seems the problem is in extractAllJars
gradle task which is reported as UP-TO-DATE, no matter we've just added a new .aar
file to the project.
Seems related to: #1257