How to run nativescript project in another visual studio code - visual-studio-code

I created android app using native script and i am using visual studio code.
so i want to run same project in another laptop using visual studio code.
so please tell me how to run because whenever i am trying to run project,its not able to build.
here is error:
E:\NS-APP\sample-ImageUpload-master>tns run android Skipping prepare.
Searching for devices... Building project...
Configuring > 0/3 projects > root project :config phase: createDefaultIncludeFiles
+found plugins: nativescript-background-http
+found plugins: nativescript-telerik-ui
+found plugins: tns-core-modules-widgets
:config phase: createPluginsConfigFile
Creating product flavors include.gradle file in E:\NS-APP\sample-ImageUpload-master\platforms\android/configurations
folder...
:config phase: pluginExtend
+applying configuration from: E:\NS-APP\sample-ImageUpload-master\platforms\android\configurations\include.gradle
+applying configuration from: E:\NS-APP\sample-ImageUpload-master\platforms\android\configurations\nativescript-background-http\include.gradle
+applying configuration from: E:\NS-APP\sample-ImageUpload-master\platforms\android\configurations\nativescript-telerik-ui\include.gradle
+applying configuration from: E:\NS-APP\sample-ImageUpload-master\platforms\android\configurations\tns-core-modules-widgets\include.gradle
Configuring > 0/3 projects > root project :config phase: addAarDependencies
+adding dependency: E:\NS-APP\sample-ImageUpload-master\platforms\android\libs\aar\Common-2017.1.222-dev-release.aar
+adding dependency: E:\NS-APP\sample-ImageUpload-master\platforms\android\libs\aar\Data-2017.1.222-dev-release.aar
+adding dependency: E:\NS-APP\sample-ImageUpload-master\platforms\android\libs\aar\List-2017.1.222-dev-release.aar
+adding dependency: E:\NS-APP\sample-ImageUpload-master\platforms\android\libs\aar\Primitives-2017.1.222-dev-release.aar
+adding dependency: E:\NS-APP\sample-ImageUpload-master\platforms\android\libs\aar\widgets-release.aar
The JavaCompile.setDependencyCacheDir() method has been deprecated and
is scheduled to be removed in Gradle 4.0. The
TaskInputs.source(Object) method has been deprecated and is scheduled
to be removed in Gradle 4.0. Please use
TaskInputs.file(Object).skipWhenEmpty() instead. Incremental java
compilation is an incubating feature. The Task.leftShift(Closure)
method has been deprecated and is scheduled to be removed in Gradle
5.0. Please use Task.doLast(Action) instead.
at build_1xv9gqucl7v9i0b8ti7pqf8cd.run(E:\NS-APP\sample-ImageUpload-master\platforms\android\build-tools\android-static-binding-generator\build.gradle:126)
:preBuild UP-TO-DATE :preF0F1F2DebugBuild UP-TO-DATE
:checkF0F1F2DebugManifest :preF0F1F2ReleaseBuild UP-TO-DATE
:prepareBackHttpAppRuntimeUnspecifiedLibrary UP-TO-DATE
:prepareComAndroidSupportAnimatedVectorDrawable2531Library UP-TO-DATE
:prepareComAndroidSupportAppcompatV72531Library UP-TO-DATE
:prepareComAndroidSupportDesign2531Library UP-TO-DATE
:prepareComAndroidSupportRecyclerviewV72531Library UP-TO-DATE
:prepareComAndroidSupportSupportCompat2531Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUi2531Library UP-TO-DATE
:prepareComAndroidSupportSupportCoreUtils2531Library UP-TO-DATE
:prepareComAndroidSupportSupportFragment2531Library UP-TO-DATE
:prepareComAndroidSupportSupportMediaCompat2531Library UP-TO-DATE
:prepareComAndroidSupportSupportV42531Library UP-TO-DATE
:prepareComAndroidSupportSupportVectorDrawable2531Library UP-TO-DATE
:prepareComAndroidSupportTransition2531Library UP-TO-DATE
:prepareCommon20171222DevReleaseLibrary UP-TO-DATE
:prepareData20171222DevReleaseLibrary UP-TO-DATE
:prepareList20171222DevReleaseLibrary UP-TO-DATE
:prepareNetGotevUploadservice303Library UP-TO-DATE
:preparePrimitives20171222DevReleaseLibrary UP-TO-DATE
:prepareWidgetsReleaseLibrary UP-TO-DATE
:prepareF0F1F2DebugDependencies :compileF0F1F2DebugAidl UP-TO-DATE
:compileF0F1F2DebugRenderscript UP-TO-DATE
:generateF0F1F2DebugBuildConfig UP-TO-DATE :cleanLocalAarFiles
:ensureMetadataOutDir :collectAllJars :setProperties
:generateTypescriptDefinitions SKIPPED :copyTypings SKIPPED
:asbg:generateInterfaceNamesList :asbg:traverseJsFiles
:asbg:runAstParser UP-TO-DATE :asbg:generateBindings Exception in
thread "main" java.io.IOException: File already exists. This may lead
to undesired behavior. Please change the name of one of the extended
classes.
E:\NS-APP\sample-ImageUpload-master\platforms\android\src\main\java\com\tns\gen\net\gotev\uploadservice\UploadServiceBroadcastReceiver_ftns_modules_nativescript_background_http_background_http_l6_c79__.java
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:60)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:15)
:asbg:generateBindings FAILED
FAILURE: Build failed with an exception.
Where: Build file 'E:\NS-APP\sample-ImageUpload-master\platforms\android\build-tools\android-static-binding-generator\build.gradle'
line: 251
What went wrong: Execution failed for task ':asbg:generateBindings'.
Process 'command 'C:\Program Files\Java\jdk1.8.0_131\bin\java.exe'' finished with non-zero exit value 1
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 14.86 secs Command
E:\NS-APP\sample-ImageUpload-master\platforms\android\gradlew.bat
failed with exit code 1
run android
┌────────────────────────┬─────────────────────────────────────────────────────────────────────────────────────────┐
│ Usage │ Synopsis
│ │ Run on all connected │ $ tns run android [--key-store-path --key-store-password --key │ │ devices and running
│ -store-alias --key-store-alias-password ]
[--release] [--justlaunch] │ │ emulators │
│ │ Run on a selected │ $ tns run android --device
[--key-store-path --key-store │ │ connected device
or │ -password --key-store-alias
--key-store-alias-password ] [- │ │ running emulator │ -release] [--justlaunch] │ │ Start an emulator and │ $ tns run android --emulator [] [--key-store-path --key │ │ run the app inside
it │ -store-password --key-store-alias
--key-store-alias-password │ │ │ ] [--release] [--justlaunch]
│
└────────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────┘
Runs your project on a connected Android device or in a native Android
emulator, if configured. This is shorthand for prepare, build and
deploy. While your app is running, prints the output from the
application in the console and watches for changes in your code. Once
a change is detected, it synchronizes the change with all selected
devices and restarts/refreshes the application.
Options
* --no-watch - If set, changes in your code will not be reflected during the execution of this command.
* --device - Specifies a connected device/emulator on which to run the app.
* --emulator - If set, runs the app in a native emulator for the target platform, if configured. When set, you can also set any other
valid combination of emulator options as listed by $ tns help emulate
android.
* --release - If set, produces a release build. Otherwise, produces a debug build. When set, you must also specify the
--key-store-* options.
* --key-store-path - Specifies the file path to the keystore file (P12) which you want to use to code sign your APK. You can use the
--key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
* --key-store-password - Provides the password for the keystore file specified with --key-store-path. You can use the --key-store-*
options along with --release to produce a signed release build. You
need to specify all --key-store-* options.
* --key-store-alias - Provides the alias for the keystore file specified with --key-store-path. You can use the --key-store-* options
along with --release to produce a signed release build. You need to
specify all --key-store-* options.
* --key-store-alias-password - Provides the password for the alias specified with --key-store-alias-password. You can use the
--key-store-* options along with --release to produce a signed release build. You need to specify all --key-store-* options.
* --justlaunch - If set, does not print the application output in the console.
* --clean - If set, forces rebuilding the native application.
Attributes
* <Device ID> is the index or name of the target device as listed by $ tns device android
* <Emulator Options> is any valid combination of options as listed by $ tns help emulate android
Sending exception report (press Ctrl+C to stop).....

Reset your entire project by deleting node_modules, platforms and hooks folders and then rebuild the project with tns build android or tns run android

You need not delete node_modules and hooks, just deleting platforms and rebuilding should be fine.
rm -rf platforms
tns run android

Related

I cannot initialize my project on Visual Studio Code using the PlatformIO

I am using Visual Studio Code and added the PlatformIO IDE extension along with c/c++ to code for my board, which is a uPesy ESP32 Wrovoer DevKit with a Espressif IoT Developement framework. Everything matches my but when I click finish I get an error message:
The current working directory C:\Users\brownme1\Documents\PlatformIO\Projects\my_project will be used for the project.
The next files/directories have been created in C:\Users\brownme1\Documents\PlatformIO\Projects\my_project
include - Put project header files here
lib - Put here project specific (private) libraries
src - Put project source files here
platformio.ini - Project Configuration File
Resolving upesy_wrover dependencies...
Already up-to-date.
Updating metadata for the vscode IDE...
Error: Processing upesy_wrover (platform: espressif32; board: upesy_wrover; framework: espidf)
--------------------------------------------------------------------------------
Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/upesy_wrover.html
PLATFORM: Espressif 32 (6.0.0) > uPesy ESP32 Wrover DevKit
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-espidf # 3.50000.0 (5.0.0)
- tool-cmake # 3.16.4
- tool-esptoolpy # 1.40400.0 (4.4.0)
- tool-idf # 1.0.1
- tool-mconf # 1.4060000.20190628 (406.0.0)
- tool-ninja # 1.9.0
- toolchain-esp32ulp # 1.23500.220830 (2.35.0)
- toolchain-xtensa-esp32 # 11.2.0+2022r1
Reading CMake configuration...
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/brownme1/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/brownme1/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe
-- Check for working C compiler: C:/Users/brownme1/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe -- broken
-- Configuring incomplete, errors occurred!
See also "C:/Users/brownme1/Documents/PlatformIO/Projects/my_project/.pio/build/upesy_wrover/CMakeFiles/CMakeOutput.log".
See also "C:/Users/brownme1/Documents/PlatformIO/Projects/my_project/.pio/build/upesy_wrover/CMakeFiles/CMakeError.log".
CMake Warning at C:/Users/brownme1/.platformio/packages/framework-espidf/tools/cmake/git_submodules.cmake:4 (message):
Git executable was not found. Git submodule checks will not be executed.
If you have any build issues at all, start by adding git executable to the
PATH and rerun cmake to not see this warning again.
Call Stack (most recent call first):
C:/Users/brownme1/.platformio/packages/framework-espidf/tools/cmake/idf.cmake:41 (include)
C:/Users/brownme1/.platformio/packages/framework-espidf/tools/cmake/project.cmake:12 (include)
CMakeLists.txt:2 (include)
CMake Error at C:/Users/brownme1/.platformio/packages/tool-cmake/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
"C:/Users/brownme1/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/brownme1/Documents/PlatformIO/Projects/my_project/.pio/build/upesy_wrover/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Users/brownme1/.platformio/packages/tool-ninja/ninja.exe cmTC_0ae29 && [1/2] Building C object CMakeFiles\cmTC_0ae29.dir\testCCompiler.c.obj
FAILED: CMakeFiles/cmTC_0ae29.dir/testCCompiler.c.obj
C:\Users\brownme1\.platformio\packages\toolchain-xtensa-esp32\bin\xtensa-esp32-elf-gcc.exe -mlongcalls -Wno-frame-address -o CMakeFiles\cmTC_0ae29.dir\testCCompiler.c.obj -c testCCompiler.c
xtensa-esp32-elf-gcc.exe: fatal error: cannot execute 'c:/users/brownme1/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/11.2.0/../../../../xtensa-esp32-elf/bin/as.exe': CreateProcess: No such file or directory
compilation terminated.
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
C:/Users/brownme1/.platformio/packages/framework-espidf/tools/cmake/project.cmake:342 (__project)
CMakeLists.txt:3 (project)
========================== [FAILED] Took 4.21 seconds ==========================
Please try to read the error carefully. It says you're missing git.
Git executable was not found. Git submodule checks will not be executed.
If you have any build issues at all, start by adding git executable to the
PATH and rerun cmake to not see this warning again.

missing android.jar when I try to run flutter project

Hey I try to run a project but it keeps showing that a android.jar is missing. What can I do ?
Launching lib\main.dart on SM G970F in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:processDebugResources'.
> File 'C:\Users\adamr\AppData\Local\Android\sdk\platforms\android-28\android.jar' specified for property 'androidJar' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 12s
This issue occurs when your platform SDK have missing android.jar file.
Download android.jar file and paste into directory of your plateform SDK from
https://github.com/Sable/android-platforms
It solved my problem in my Linux. Iam sure it will work on Windows as well✌️.
It seems to be a problem with your Android SDK. Try going to Android Studio, Check if you have installed all the required SDK, must times running flutter doctor -v will show you that.
If flutter doctor is fine then I recommend that you uninstall the current android SDK and re-install it.
Your android sdk is incomplete. Try install it from Android Studio SDK manager. The folder should looks like the following:
/Users/shooding/Library/Android/sdk/platforms/android-28/
├── android-stubs-src.jar
├── android.jar
├── build.prop
├── data
├── framework.aidl
├── optional
├── package.xml
├── sdk.properties
├── skins
├── source.properties
├── templates
└── uiautomator.jar

com.android.builder.testing.api.DeviceException: No connected devices

Scanning folders for symlinks in /home/sino/Desktop/we-clone/node_modules (4ms)
Starting JS server...
Building and installing the app on the device (cd android && ./gradlew installDebug)...
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:app:prepareComFacebookFbuiTextlayoutbuilderTextlayoutbuilder100Library UP-TO-DATE
:app:prepareComFacebookFrescoDrawee130Library UP-TO-DATE
:app:prepareComFacebookFrescoFbcore130Library UP-TO-DATE
:app:prepareComFacebookFrescoFresco130Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipeline130Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineBase130Library UP-TO-DATE
:app:prepareComFacebookFrescoImagepipelineOkhttp3130Library UP-TO-DATE
:app:prepareComFacebookReactReactNative0493Library UP-TO-DATE
:app:prepareComFacebookSoloaderSoloader010Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:bundleDebugJsAndAssets SKIPPED
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:transformClassesWithDexForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders UP-TO-DATE
:app:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:app:validateSigningDebug
:app:packageDebug UP-TO-DATE
:app:assembleDebug UP-TO-DATE
:app:installDebug
07:52:34 E/adb: * daemon not running; starting now at tcp:5037
07:52:37 E/adb: * daemon started successfully
:app:installDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No connected devices!
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 8.916 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
If you have android studio installed(if not install it) launch android studio with a dummy project, go to Tools -> AVD Manager. Make sure that you create a virtual device and start it.
Note: To create this virtual device you will need to download and install a compatible OS (compatible with your project's Android SDK version - SDK version can be found inside build.gradle file) on it before launching. AVD Manager will guide you with the process.
Another thing, you may be using a real Android device not an emulator and still get this message. If your device is connected through USB to your laptop you need to first enable the developer options:
If using stock Android, go to Settings > About phone > Build number.
On a Samsung Galaxy device, go to Settings > About device > Build
number. On an HTC device, go to Settings > About > Software
information > More > Build number. On an LG device, go to Settings >
About phone > Software info > Build number. Tap Build number seven
times. After the first few taps, you should see the steps counting
down until you unlock the developer options. Once activated, you will
see a message that reads, “You are now a developer!” Go back to
Settings, where you’ll find a Developer options entry in the menu.
(https://www.digitaltrends.com/mobile/how-to-get-developer-options-on-android/)
Then inside developer options, you should enable USB debugging.
You'll need to have an Android Emulator running or a physical device connected and in usb debugging mode.
See https://facebook.github.io/react-native/docs/getting-started.html#preparing-the-android-device for more information.
Version SDK incompatible check SDK version in build.gradle under android folder
For example
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 16
compileSdkVersion = 29
targetSdkVersion = 29
}
Then download ADV Manager
Select Image API Level 29 (Follow SDK version)
In my case, my usb wasn't connected for some reason, even though it seemed like it was physically connected. I had to change the ports I used.

Android UiAutomator test case jar file is not working

I have been trying to write some instrumental test case of android code using UiAutomator tool. This test cases can be run via android studio without any problem. But now i want to install this test cases into device as a jar file and need to run via command line. I had tried the following link for building and deploying uiautomator tests:
https://stuff.mit.edu/afs/sipb/project/android/docs/tools/testing/testing_ui.html#creating
build.xml is generated but when command "ant build" is executed it shows error:
Android/Sdk/tools/ant/uibuild.xml:198: null returned: 1
After that i have tried to create jar files using gradle build instead of ant build tool using this link
http://wiliamsouza.github.io/#/2013/10/30/android-uiautomator-gradle-build-system
I have run the "gradle build" command from the project directory and output got;
Building dex...
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test
:check
:build
BUILD SUCCESSFUL
Total time: 7.709 secs
but there was no jar file found in "dist" folder. In have installed jar file found in build/libs folder,
adb push sample-0.1.jar /data/local/tmp/
then tried to run the test cases using the command
adb shell uiautomator runtest sample-0.1.jar -c com.test.uiautomator.sample.Sample
But it shows error as:
INSTRUMENTATION_RESULT: shortMsg=java.lang.RuntimeException
INSTRUMENTATION_RESULT: longMsg=Didn't find
class"com.test.uiautomator.sample.Sample"
on path: DexPathList[[zip
file"/system/framework/android.test.runner.jar",
zip file"/system/framework/uiautomator.jar",
zip file"/data/local/tmp/sample-0.1.jar"],
nativeLibraryDirectories=[/vendor/lib, /system/lib]]
INSTRUMENTATION_CODE: 0
Is anyone have any idea on this.. how can i create jar files of my uiautomator test cases and how can i run them via command line..?
Got a Solution !!!
Actually my requirement was to run instrumental test cases (UiAutomator in my case)through command line, for this purpose it is not necessary to generate a jar file of the test classes and install them to devices, instead we can create separate apk file of test case package and install them in the same way as application apk file is installed. And then run adb commands for executing the test cases. Please check the below link which has the detailed explanation.
https://developer.android.com/studio/test/command-line.html#RunTestsCommand

When uninstall nativescript plugin and run 'tns run android' has failed

I'm devloping a nativescript plugin.when I want to change something with the plugin at index.js. so I uninstall the plugin and explanatory note the plugin code in app project.Then I run 'tns run android' ,It's some error display:
...
Merged dex #46 (1 defs/1.3KiB)
Merged dex #47 (1 defs/1.4KiB)
Merged dex #48 (2513 defs/3231.2KiB)
Result is 2560 defs/4103.9KiB. Took 0.1s
:buildMetadata
Exception in thread "main" java.lang.IllegalArgumentException: Class android.support.v7.widget.SnapHelper$2 conflict: D:\app\toast-test\platforms\android\build\intermediates\transforms\dex\F0F1F2\debu
at com.telerik.metadata.ClassRepo.addToCache(ClassRepo.java:21)
at com.telerik.metadata.Builder.build(Builder.java:40)
at com.telerik.metadata.Generator.main(Generator.java:44)
:buildMetadata FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':buildMetadata'.
Process 'command 'C:\Program Files\Java\jdk1.8.0_112\bin\java.exe'' finished with non-zero exit value 1
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 41.154 secs
Command D:\app\toast-test\platforms\android\gradlew.bat failed with exit code 1
How can I rebuild my app success after delete some plugins in project?
and how to update the nativescript plugin to new version?
After removing a plugin with native dependencies in the form of .aar or .jar (those include plugins downloaded through a remote plugin repository like maven) in NativeScript 2.4 you need to re-add the platform.
tns plugin remove nativescript-plugin
tns platform remove android
tns platform add android / tns run/build android
With the coming 2.5 release clearing any traces of the old plugin will be done by the CLI and no manual steps should be required besides simply removing the plugin from your project.