
Ich bin neu hier und habe beschlossen, ganz auf Ubuntu umzusteigen, um als Hobby Apps zu entwickeln.
Da ich eine AMD-CPU habe, war die „RYZEN“-Emulation entweder nicht in Ordnung oder nicht, also habe ich herausgefunden, dass es in Ubuntu gut funktioniert, da es über eine Hardware-Emulation verfügt. Dann habe ich Android Studio und dergleichen sowie Java installiert und die Umgebungsvariablen eingerichtet.
Dann habe ich NativeScript installiert und den Umgebungstest ausgeführt. tns doctor
Das Ergebnis ist folgendes:
✔ 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.
Dann habe ich VSCODE installiert, dann ein Nativescript-Testprojekt erstellt und es wurde korrekt erstellt, es in VSCODE geöffnet und eine Debug-Konfiguration erstellt
dann initiieren Sie einen Android-Emulator und versuchen Sie dann, id auszuführen hat auf Android gestartet und bekam
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.
Wenn ich das Terminal als normaler Benutzer ausführe, tns run
wird die App erstellt und an den Android-Emulator angehängt.
Die gleichen Probleme habe ich in Cordova, es trat ein ähnlicher Fehler auf: „$ANDROID_HOME ist nicht richtig eingestellt“, obwohl ich „Cordova emuliert Android“ immer noch aufrufen kann.
Ich vermute, dass VSCODE die Umgebung nicht richtig erkennen kann oder dass es bei den Erweiterungen Probleme oder einen Fehler gibt.
Ich bin für jede Hilfe dankbar.
Antwort1
Ok, ich habe etwas Interessantes gefunden bei der Suche nach,„Umgebungsvariable für alle Benutzer in Ubuntu festlegen“und bekamDiese Internetseite
Dann bin ich den Anweisungen gefolgt, habe es ANDROID_HOME
dort eingerichtet und das System neu gestartet. Und jetzt hat NativeScript die Umgebung gefunden und das Projekt im laufenden Emulator ausgeführt.
Cordova konnte die Umgebung auch finden, verursachte mir aber ein anderes Problem.
Ich werde eine weitere Frage posten, wenn ich die Antwort für Cordova finden kann.
Drei Tage lang habe ich mir den Kopf zerbrochen, um das richtig einzurichten.