0

我正在使用 ./gradlew assembleRelease 导出我的 react 本机文件。

我收到以下错误:

  1. 此版本中使用了弃用的 Gradle 功能,使其与 Gradle 7.0 不兼容

  2. 未找到 SDK 位置

我的 gradle 与我安装的 Java 版本不兼容吗?我似乎找不到如何解决这个问题?

下面的完整错误

------------------------------------------------------------
Gradle 6.3
------------------------------------------------------------

Build time:   2020-03-24 19:52:07 UTC
Revision:     bacd40b727b0130eeac8855ae3f9fd9a0b207c60

Kotlin:       1.3.70
Groovy:       2.5.10
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          1.8.0_291 (Oracle Corporation 25.291-b10)
OS:           Mac OS X 10.16 x86_64
* What went wrong:
Could not determine the dependencies of task ':app:compileReleaseJavaWithJavac'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/mattlaszcz/Documents/HearthNative/HearthNative/android/local.properties'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

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.3/userguide/command_line_interface.html#sec:command_line_warnings
4

1 回答 1

0

确保 sdk 路径是 android 根文件夹中的 local.properties 文件,它应该是这样的 sdk.dir=C\:\\Users\\User\\AppData\\Local\\Android\\Sdk

于 2021-06-06T09:58:49.240 回答