Juan Salvador (14) [Avatar] Offline
#1
I'm trying tu run HelloWorld sample generated, but not running for android platform:

The first problem is the generated HOME_ANDROID environment var as
 ${Env:LOCALAPPDATA}\Android\android-sdk 

it should be
 %LOCALAPPDATA%\Android\sdk 
but still it's not running

I also started the AVM

I'm very new to NativeScript, actually I'm running my first two hours in this platform, so any help is welcome
Juan Salvador (14) [Avatar] Offline
#2
Juan Salvador wrote:I'm trying tu run HelloWorld sample generated, but not running for android platform:

The first problem is the generated HOME_ANDROID generated as
 ${Env:LOCALAPPDATA}\Android\android-sdk 

it should be
 %LOCALAPPDATA%\Android\sdk 
but still it's not running

I also started the AVD

I'm very new to NativeScript, actually I'm running my first two hours in this platform, so any help is welcome


- - - - - - - - - - - - - - - - - - - - -

Now something happening, I choose another device as show in picture

But i got error

Nick (11) [Avatar] Offline
#3
If you use the command "tns doctor" in your console what does it report? Does it report that "no issues detected" or do you get other error messages?

You have already run "tns create HelloTest --template tns-template-hello-world" correct?
Juan Salvador (14) [Avatar] Offline
#4
running ...
[ 209 KB ]
Hi Nick !

It's working now:

1. I already had installed node.js

2. I run the command:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin


3. fixed the ANDROID_ HOME environment variable from
${Env:LOCALAPPDATA}\Android\android-sdk
to
%LOCALAPPDATA%\Android\sdk


4. I run the command:
echo yes | "%ANDROID_HOME%\tools\android" update sdk --filter tools,platform-tools,android-23,build-tools-23.0.3,extra-android-m2repository,extra-google-m2repository,extra-android-support --all --no-ui


4. then:
npm i -g nativescript


5. then created the HelloWorld app
tns create HW --template tns-template-hello-world


6. I wen to "%LOCALAPPDATA%\Android\sdk" and started the AVD manager, I started and AVD (look attached figure)

7. then I run the HelloWorld (HW) App:
tns run android --emulator

I wait for more than two minutes and there was: the application was running, please look the attached image

Is running but I don't know if it is OK ?

Any improvement to this process and better explanation is welcome secially when selecting AVD, thanks in advance
Nick (11) [Avatar] Offline
#5
Yes you are up and running successfully!

I am sorry for all the troubles you have had. We are working on several appendices with tips and tricks to help alleviate some of the troubles that you have had getting up and running with Android.

On some platforms the Android emulator is slow to get up and running unfortunately. One way that you can speed up the Android emulator is by installing Intel HAXM (this is just one tip we will be adding to an Appendix) - https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager

Now that you are up and running you should be able to:
tns run android --emulator
and it will launch the emulator. Hopefully it is faster after you get Intel HAXM installed.

You can run the app for a specific device if you want with
tns run android --emulator --device "deviceName"
and to get the list of devices you can check the android virtual device with
android list avd


As I mentioned we're working on an appendix section with a lot of these tips so let us know if you have more questions or comments.
mikebranstein (12) [Avatar] Offline
#6
I highly recommend installing the GenyMotion Android Emulator from https://www.genymotion.com/. Geny Motion is a free emulator for Android. I've always experienced extreme slowness using the stock Android emulator (avd), and Geny has been much faster for me.

If you do install Geny Motion, here's a few tips: after installed, you'll need to add a virtual device to Geny. Once you've added the virtual device, start it first. Once the emulator is started, then run the NativeScript command "tns run android --emulator" to run your app in Geny Motion.

Another useful command is "tns device", which lists all of the "connected" or "running" devices and emulators on your system. This can let you know if nativeScript will be able to talk to the emulator.
542309 (1) [Avatar] Offline
#7
Thank you so much for all the responses, codes and references. This thread is really helpful for beginner like me smilie


https://getappvalley.com/ https://test-dpc.com/ https://tweakbox.mobi/
553704 (1) [Avatar] Offline
#8