Skip to content

tns run android just starts emulator but does not deploy app on it #1576

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DeepakDonde opened this issue Mar 8, 2016 · 24 comments
Closed
Assignees
Labels
Milestone

Comments

@DeepakDonde
Copy link

Hello @rosen-vladimirov ,
I have recently get rid of this issue.

Now I am getting issue while running the app.
when I run "tns run android" from cmd, emulator gets started and nothing happens after it launches.
Earlier when I have connected android device and run the same command I was getting following error.
Processing node_modules failed. TypeError: Invalid Version: 1.?2.0 (in red color on cmd)
Sending exception report (press Ctrl+C to stop).....

Also please find attached log file for log trace.
log.txt

Please help.
Thanks in advance.

@rosen-vladimirov rosen-vladimirov changed the title Processing node_modules failed. TypeError: Invalid Version: 1.?2.0 Error while running android app nativescript tns run android just starts emulator but does not deploy app on it Mar 9, 2016
@rosen-vladimirov rosen-vladimirov added this to the 1.7.0 milestone Mar 9, 2016
@rosen-vladimirov rosen-vladimirov self-assigned this Mar 9, 2016
@rosen-vladimirov
Copy link
Contributor

I confirm this is a bug on our side and it should be fixed in our next release.
Meanwhile you can use tns emulate android instead :)

@rosen-vladimirov
Copy link
Contributor

Steps to reproduce:

  1. Make sure you do not have any emulator started or any device attached.
  2. Call tns run android inside project.

@DeepakDonde
Copy link
Author

@rosen-vladimirov ,
What am I supposed to do to reflect this change at my side ?
I am still facing same issue while running app. :(
please help.

@rosen-vladimirov
Copy link
Contributor

@DeepakDonde you'll have to wait for our next release in order to get it working. Meanwhile you can use the suggested workaround - start the emulator before calling tns run android.

@DeepakDonde
Copy link
Author

@rosen-vladimirov

I have tried the workaround but I am getting following error -
Command platforms\android\gradlew.bat failed with exit code 1
Attaching log file for your reference.
log.txt

@rosen-vladimirov
Copy link
Contributor

@DeepakDonde Please navigate to <project dir>\platforms\android and execute: ./gradelw clean
After that try tns run android again (from your project dir). If it still fails, navigate back to <project dir>\platforms\android and execute ./gradelw build -S and send us the output.

@DeepakDonde
Copy link
Author

@rosen-vladimirov
Still the build failed..

A problem occurred evaluating root project 'sampleGroceries'.
Could not find method compile() for arguments [com.android.support:appcompat-v
7:22.2.0] on DefaultExternalModuleDependency{group='com.android.support', name='
support-v4', version='22.2.0', configuration='default'}.

Find log here -
log.txt

@ghost
Copy link

ghost commented Mar 21, 2016

this is also happens with genymotion based device too.

@rosen-vladimirov
Copy link
Contributor

@vyscond have you updated your CLI to 1.7.0 ? In case not, can you try updating it and see if it works :)

@ghost
Copy link

ghost commented Mar 21, 2016

Running 1.7.0 version. But i think i "solved" my issue. I realized this morning that you guys are supporting (by default) the level 17 as minimum API and i current use a level 16.

@Gaseema
Copy link

Gaseema commented Jun 21, 2016

Hi :)
I'm having issues every time i try to run my application on an emulator or my android phone. This is what it displays. SOS
gaz@gaz-HP-ProBook-430-G2:/Desktop/groceries/sample-Groceries$ tns device
iTunes is not available for this operating system. You will not be able to work with connected iOS devices.
┌───┬─────────────┬──────────┬───────────────────┬────────┬─────────────┐
│ # │ Device Name │ Platform │ Device Identifier │ Type │ Status │
│ 1 │ │ Android │ D511C1ZR5A299032 │ Device │ Unreachable │
└───┴─────────────┴──────────┴───────────────────┴────────┴─────────────┘
gaz@gaz-HP-ProBook-430-G2:
/Desktop/groceries/sample-Groceries$ tns run android
Executing before-prepare hook from /home/gaz/Desktop/groceries/sample-Groceries/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 1.8.10
Project successfully prepared

:config phase: createDefaultIncludeFiles
+found plugins: tns-core-modules-widgets
{
"F0" {
dimension "tnscoremoduleswidgets"
}
} }
:config phase: createPluginsConfigFile
Creating product flavors include.gradle file in /home/gaz/Desktop/groceries/sample-Groceries/platforms/android/configurations folder...

:config phase: pluginExtend
+applying configuration from: /home/gaz/Desktop/groceries/sample-Groceries/platforms/android/configurations/tns-core-modules-widgets/include.gradle
+applying configuration from: /home/gaz/Desktop/groceries/sample-Groceries/platforms/android/configurations/include.gradle

:config phase: copyAarDependencies

:config phase: addAarDependencies
+adding dependency: /home/gaz/Desktop/groceries/sample-Groceries/platforms/android/libs/aar/widgets-release.aar
:preBuild UP-TO-DATE
:preF0DebugBuild UP-TO-DATE
:checkF0DebugManifest
:preF0ReleaseBuild UP-TO-DATE
:prepareComAndroidSupportAnimatedVectorDrawable2340Library
:prepareComAndroidSupportAppcompatV72340Library
:prepareComAndroidSupportSupportV42340Library
:prepareComAndroidSupportSupportVectorDrawable2340Library
:prepareWidgetsReleaseLibrary
:prepareF0DebugDependencies
:compileF0DebugAidl
:compileF0DebugRenderscript
:generateF0DebugBuildConfig
:cleanLocalAarFiles
:ensureMetadataOutDir
:collectAllJars
:setProperties
:asbg:generateInterfaceNamesList
:asbg:runAstParser UP-TO-DATE
:asbg:generateBindings UP-TO-DATE
:generateF0DebugAssets UP-TO-DATE
:mergeF0DebugAssets
:generateF0DebugResValues UP-TO-DATE
:generateF0DebugResources
:mergeF0DebugResources
:processF0DebugManifest
:processF0DebugResources
:generateF0DebugSources
:compileF0DebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:compileF0DebugNdk UP-TO-DATE
:compileF0DebugSources
:buildMetadata UP-TO-DATE
:transformClassesWithDexForF0Debug
:mergeF0DebugJniLibFolders
:transformNative_libsWithMergeJniLibsForF0Debug
:processF0DebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForF0Debug
:validateDebugSigning FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':validateDebugSigning'.

    Unable to create debug keystore in "/home/gaz/.android" because it is not writable.

  • 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: 1 mins 16.409 secs
Command /home/gaz/Desktop/groceries/sample-Groceries/platforms/android/gradlew failed with exit code 1

run android

┌────────────────┬──────────────────────────────────────────────────────────┐
│ Usage │ Synopsis │
│ Run on all │ $ tns run android [--key-store-path --key │
│ connected │ -store-password --key-store-alias - │
│ devices and │ -key-store-alias-password ] [--release] [- │
│ running │ -justlaunch] │
│ emulators │ │
│ Run on a │ $ tns run android --device [--key-store-path │
│ selected │ --key-store-password --key-store │
│ connected │ -alias --key-store-alias-password ] [- │
│ device or │ -release] [--justlaunch] │
│ running │ │
│ emulator │ │
│ Start an │ $ tns run android --emulator [] [--key │
│ emulator and │ -store-path --key-store-password │
│ run the app │ --key-store-alias --key-store-alias-password │
│ inside it │ ] [--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.

Options

* --device - Specifies a connected device 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.

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

@aplut
Copy link

aplut commented Oct 4, 2016

Hi,

I face this problem still. Additionally the option --watch doesn't work too. I see in log that app has been deployed or refreshed but the app is only deployed on a phone but not started. I have tried with API 23 and 24.

All NativeScript components versions information
┌──────────────────┬───────────────────────┬────────────────┬─────────────┐
│ Component │ Current version │ Latest version │ Information │
│ nativescript │ 2.3.0 │ 2.3.0 │ Up to date │
│ tns-core-modules │ 2.4.0-2016-09-30-4270 │ 2.3.0 │ Up to date │
│ tns-android │ 2.3.0 │ 2.3.0 │ Up to date │
│ tns-ios │ 2.4.0-2016.9.16.4 │ 2.3.0 │ Up to date │

Cheers,
Adrian

@nmandyam
Copy link

I have a variation of this: my setup USED to work OK till recently. Over the last week or so, it fails to start the app on the emulator. It does deploy, though: I can click on the app in the emulator and run the version that was just deployed. But this means I can't DEBUG - in fact, on Windows, the debug browser window comes up, but shows no code.
The changes over the last week or so have all been in my code, nothing in the environment.
Any suggestions on how to fix this?

@LiveLikeLastDay
Copy link

@Shyam-Chen
Copy link

Shyam-Chen commented Dec 13, 2016

$ tns run android
Starting Android emulator with image Emulator-Api23-Default
Cannot run your app in the native emulator. Increase the timeout of the operation with the --timeout 
option or try to restart your adb server with 'adb kill-server' command. Alternatively, run the Android Virtual 
Device manager and increase the allocated RAM for the virtual device.

@grimaldodev
Copy link

grimaldodev commented Dec 19, 2016

Im with the same problem

Cannot run your app in the native emulator. Increase the timeout of the operation 
with the --timeout option or try to restart your adb server with 'adb kill-server' 
command. Alternatively, run the Android Virtual Device manager and increase 
the allocated RAM for the virtual device.

I ran the ´´´´tns doctor´´´´and didn't find any issue

@wilk
Copy link

wilk commented Dec 23, 2016

I had the same problem with Mac OS X, so I tried to launch the AVD directly from the AVD Manager and there was an error.
So I stopped Docker for Mac and it worked.
Related article: http://stackoverflow.com/a/39142955/916784
Hope it helped.

@joney000
Copy link

Worked for me after closing Docker on Mac.

@rsaf
Copy link

rsaf commented Mar 11, 2017

I think the emulator somehow conflicts with Docker on Mac. I faced the same issue, and just like @joney000 , i solved it by closing Docker.

@kylerjensen
Copy link

I'm still experiencing this issue, and I don't have Docker, Parallels, or VirtualBox running.

@rosen-vladimirov
Copy link
Contributor

@Kjens93 and other that experience the same issue, can you try reproducing it with CLI's 3.0.0.rc1 version?
Also can you send us logs from:

$ tns run android --log trace --timeout 600

So we'll see where the process is hanging

@kylerjensen
Copy link

Never mind, turns out the system image for my emulator was missing.

@ashishetech
Copy link

When i run app by using command 'tns run android' , emulator launches but app not deploy also command got terminate. u can see code below

etech@etech-406:/var/www/html/nativeApp/HelloWorld$ tns run android
Support for Node.js 8.0.0 is not verified. This CLI might not install or run properly.

Searching for devices...
Starting Android emulator with image testAVD
etech@etech-406:/var/www/html/nativeApp/HelloWorld$

@ClaseVIvas
Copy link

Good companions

I have a big problem:

I want to run an application from VS Code with Nativescript.

I use "adb devices" and visualize my physical device or emulator ...

But if I use "tns devices" it tells me that it does not find anything.

When doing "tns run android":
tns run android Skipping node_modules folder! Use the syncAllFiles option to sync files from this folder. Searching for devices... Starting Android emulator with image 60d0f537-0e95-4ab2-8fd7-9c7ee02bf8c4 Cannot find connected devices. Emulator start failed with: Cannot run the app in the selected native emulator. Try to restart the adb server by running the adb kill-servercommand in the Command Prompt, or increase the allocated RAM of the virtual device through the Android Virtual Device manager. NativeScript CLI users can try to increase the timeout of the operation by adding the--timeout flag. To list currently connected devices and verify that the specified identifier exists, run 'tns device'. To list available emulator images, run 'tns device <Platform> --available-devices'.

And I'm desperate ... it's like there's a conflict with my adb and tns

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

No branches or pull requests