
저는 여기에 처음 왔으며 취미로 앱을 개발하기 위해 풀타임으로 Ubuntu로 전환하기로 결정했습니다.
AMD CPU "RYZEN" 에뮬레이션이 작동했거나 작동하지 않았기 때문에 우분투에서는 하드웨어 에뮬레이션이 있기 때문에 잘 작동한다는 것을 알았습니다. 그런 다음 Android Studio 등을 설치하고 Java를 설치하고 환경 변수를 설정했습니다.
그런 다음 NativeScript를 설치하고 환경 테스트를 실행하면 tns doctor
결과는 다음과 같습니다.
✔ 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.
그런 다음 VSCODE를 설치한 다음 테스트 Nativescript 프로젝트를 생성하고 올바르게 생성한 다음 VSCODE에서 열고 디버그 구성을 생성했습니다.
그런 다음 Android 에뮬레이터를 시작한 다음 id를 실행하려고 시도합니다. Android에서 실행되었고
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.
일반 사용자로 터미널을 실행하면 tns run
앱이 생성되고 Android Emulator에 연결됩니다.
Cordova에서 발생한 것과 동일한 문제로 인해 비슷한 오류 $ANDROID_HOME이 올바르게 설정되지 않았습니다. 오류가 발생했지만 여전히 "cordova emulate android" 호출을 실행할 수 있습니다.
내 용의자는 VSCODE가 환경을 올바르게 볼 수 없거나 확장에 문제나 버그가 있는 것입니까?
도움을 주시면 감사하겠습니다.
답변1
알겠습니다. 검색 중에 흥미로운 것을 발견했습니다."Ubuntu의 모든 사용자에 대한 환경 변수 설정"그리고 얻었습니다이 웹사이트
그런 다음 지침에 따라 ANDROID_HOME
거기에 설정하고 시스템을 재부팅했습니다.. 그리고. 이제 NativeScript가 환경을 찾고 에뮬레이터를 실행하면서 프로젝트를 실행했습니다.
또한 cordova도 환경을 찾을 수 있었지만 다른 문제가 발생했습니다.
cordova에 대한 답변을 찾을 수 있으면 다른 질문을 게시하겠습니다.
3일 동안 나는 이것을 올바르게 설정하기 위해 머리를 아프게 했습니다.