React Native build在错误的文件夹中查找sdk许可证



我目前正试图在CLI中构建我的react本机应用程序,但它给了我这个错误

Observed package id 'platform-tools' in inconsistent location 'D:Androidandroid-sdkplatform-tools' (Expected 'D:Androidandroid-sdkplatform-toolsplatform-tools')
Checking the license for package SDK Patch Applier v4 in D:Androidandroid-sdkplatform-toolslicenses
Warning: License for package SDK Patch Applier v4 not accepted.
Checking the license for package Android Emulator in D:Androidandroid-sdkplatform-toolslicenses
Warning: License for package Android Emulator not accepted.
Checking the license for package Android SDK Tools in D:Androidandroid-sdkplatform-toolslicenses
Warning: License for package Android SDK Tools not accepted.
Checking the license for package Android SDK Build-Tools 30.0.2 in D:Androidandroid-sdkplatform-toolslicenses
Warning: License for package Android SDK Build-Tools 30.0.2 not accepted.
Checking the license for package Android SDK Platform 30 in D:Androidandroid-sdkplatform-toolslicenses       
Warning: License for package Android SDK Platform 30 not accepted.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
patcher;v4 SDK Patch Applier v4
emulator Android Emulator
platforms;android-30 Android SDK Platform 30
build-tools;30.0.2 Android SDK Build-Tools 30.0.2
tools Android SDK Tools
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

但后来我意识到构建实际上是在错误的目录中查找的,这可能就是它给我许可证错误的原因。我的许可证位于android-sdk中,但内部版本正在android-sdk/platform-tools中查找我也拥有的许可证。

Observed package id 'platform-tools' in inconsistent location 'D:Androidandroid-sdkplatform-tools' (Expected 'D:Androidandroid-sdkplatform-toolsplatform-tools')
Checking the license for package SDK Patch Applier v4 in D:Androidandroid-sdkplatform-toolslicenses
Warning: License for package SDK Patch Applier v4 not accepted.
Checking the license for package Android Emulator in D:Androidandroid-sdkplatform-toolslicenses
Warning: License for package Android Emulator not accepted.
Checking the license for package Android SDK Tools in D:Androidandroid-sdkplatform-toolslicenses
Warning: License for package Android SDK Tools not accepted.
Checking the license for package Android SDK Build-Tools 30.0.2 in D:Androidandroid-sdkplatform-toolslicenses
Warning: License for package Android SDK Build-Tools 30.0.2 not accepted.
Checking the license for package Android SDK Platform 30 in D:Androidandroid-sdkplatform-toolslicenses       
Warning: License for package Android SDK Platform 30 not accepted.

如何重新配置构建以查找正确的目录?我可以将许可证文件夹拖动到平台工具文件夹吗?这安全吗?

感谢

我想明白了。我将平台工具剪切粘贴到我的sdk目录中的另一个平台工具目录下,因为它正在那里寻找它。我还将许可证文件夹放置在第二平台工具目录上方的一个文件夹中。

最新更新