VSCODE Ubuntu can't see $ANDROID_HOME

0

I am new here, and I decided to switch to Ubuntu full time to develop app as a hobbie.

Since I have a AMD CPU "RYZEN" emulation was kind of work or won't so found out in Ubuntu works nice since it has hardware emulation, then went ahead and installed Android Studio and such, Java and set up the environment variables..

then installed NativeScript, and run environment test tns doctor and the result is this:

✔ Getting environment information 

No issues were detected.
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
✔ Getting NativeScript components versions information...
✔ Component nativescript has 6.0.3 version and is up to date.

Then I installed VSCODE then created a test Nativescript project and was created correctly, opened it in VSCODE and create a debug configuration

then initiate an Android emulator and then try to run id did Launch on Android and got

WARNING: The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android. 
 To be able to perform Android build-related operations, set the `ANDROID_HOME` variable to point to the root of your Android SDK installation directory. 


WARNING: WARNING: adb from the Android SDK is not installed or is not configured properly.  
 For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements 

WARNING: WARNING: The Android SDK is not installed or is not configured properly. 
 You will not be able to run your apps in the native emulator. To be able to run apps
in the native Android emulator, verify that you have installed the latest Android SDK 
and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements 

WARNING: Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 28 or later. 
 Run `$ sdkmanager` to manage your Android SDK versions. 

WARNING: You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=28'. 
 Run `$ sdkmanager` from your command-line to install required `Android Build Tools`. In case you already have them installed, make sure `ANDROID_HOME` environment variable is set correctly. 

Javac is installed and is configured properly.
The Java Development Kit (JDK) is installed and is configured properly.
Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.

if I ran the in terminal as normal user tns run the app get created and gets attached to the Android Emulator.

The same issues I have in Cordova, gave similar error $ANDROID_HOME is not set correctly error, whilst I still can run invoking "cordova emulate android".

My suspect is that VSCODE is not able to see the Enviroment Correctly or is the Extensions having issues or a bug?

Appreciate any help giving.

UTAN

Posted 2019-08-18T23:51:48.923

Reputation: 1

Answers

0

Ok, I found something interesting while searching for, "set enviroment variable for all user in Ubuntu" and got this website

Then I followed its instructions, set the ANDROID_HOME there and rebooted system.. and. now NativeScript found the environment and ran the the project in running emulator..

Also, cordova was able to find the environment too, but got me a different issue.

Will post another question if I can find the answer for cordova.

Three day I been breaking my head... to set this up correctly.

UTAN

Posted 2019-08-18T23:51:48.923

Reputation: 1