我第一次涉足本机世界,并且我尝试在this article之后从头开始建立Windows开发环境。一切正常,直到我尝试运行react-native run-android
。我已经接受了sdkmanager --licenses
的所有许可证,但仍然出现许可证错误:
> Configure project :app
Checking the license for package Android SDK Build-Tools 27.0.3 in C:\Program Files\Android\Android Studio\licenses
Warning: License for package Android SDK Build-Tools 27.0.3 not accepted.
Checking the license for package Android SDK Platform 27 in C:\Program Files\Android\Android Studio\licenses
Warning: License for package Android SDK Platform 27 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
platforms;android-27 Android SDK Platform 27
build-tools;27.0.3 Android SDK Build-Tools 27.0.3
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
然后我发现this comment的用户建议以下命令:$ANDROID_HOME/tools/bin/sdkmanager "build-tools;26.0.1" "platforms;android-26"
。我以sdkmanager.bat "platforms;android-27" "build-tools;27.0.3"
的身份执行它以匹配环境中的版本,经理确实下载了新许可证,但错误仍然存在。
我不知道如何接受上述许可证。有什么建议吗?
答案 0 :(得分:0)
您可以使用此命令yes | sdkmanager --licenses
或者您可以在Mac yes | sudo ~/Library/Android/sdk/tools/bin/sdkmanager --licenses
上使用此命令
或对于Windows:cmd.exe ""/K"%LocalAppData%\Android\sdk\tools\bin\sdkmanager.bat --licenses"
答案 1 :(得分:0)
打开Android Studio-> SDK管理器,然后选择Android 8.1(Oreo)按“确定”,然后接受许可并安装
答案 2 :(得分:0)
对我来说
如果在启动时遇到REGEX错误(例如Expo),只需进入node_modules \ metro-config \ src \ defaults \ blacklist.js并通过以下方式更改sharedBlacklist的第一行:
*/node_modules[\/\\]react[\/\\]dist[\/\\].*/,*
CLI发出尖叫声是因为每个括号中缺少第一个\。
在CLI中:
我使用Nox Player运行该项目。
对我有用。