-1

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).....

2 Answers2

0

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

Nick Iliev
  • 9,610
  • 3
  • 35
  • 89
0

You need not delete node_modules and hooks, just deleting platforms and rebuilding should be fine.

rm -rf platforms
tns run android
ishandutta2007
  • 16,676
  • 16
  • 93
  • 129