VSCODE Ubuntu não consegue ver $ ANDROID_HOME

VSCODE Ubuntu não consegue ver $ ANDROID_HOME

Sou novo aqui e decidi mudar para o Ubuntu em tempo integral para desenvolver aplicativos como hobby.

Como eu tenho uma emulação de CPU AMD "RYZEN" funcionou ou não, descobri que no Ubuntu funciona bem, pois tem emulação de hardware, então fui em frente e instalei o Android Studio e tal, Java e configurei as variáveis ​​de ambiente.

em seguida, instalei o NativeScript e executei o teste de ambiente tns doctore o resultado é este:

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

Então instalei o VSCODE e criei um projeto Nativescript de teste e foi criado corretamente, abri no VSCODE e criei uma configuração de depuração

em seguida, inicie um emulador Android e tente executar o id, iniciei no Android e obtive

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.

se eu executei o terminal como usuário normal, tns runo aplicativo será criado e anexado ao Android Emulator.

Os mesmos problemas que tenho no Cordova, geraram um erro semelhante $ ANDROID_HOME não está configurado corretamente, enquanto ainda posso executar invocando "cordova emulate android".

Minha suspeita é que o VSCODE não consegue ver o ambiente corretamente ou as extensões estão apresentando problemas ou um bug?

Agradeço qualquer ajuda dada.

Responder1

Ok, encontrei algo interessante enquanto procurava,"definir variável de ambiente para todos os usuários no Ubuntu"e pegouesse site

Então segui suas instruções, configurei o ANDROID_HOMEsistema e reiniciei .. e. agora o NativeScript encontrou o ambiente e executou o projeto no emulador em execução.

Além disso, cordova também conseguiu encontrar o ambiente, mas me trouxe um problema diferente.

Postarei outra pergunta se conseguir encontrar a resposta para cordova.

Há três dias que estou quebrando a cabeça... para configurar isso corretamente.

informação relacionada