首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >fix本机:如何修复Gradle中的版本问题

fix本机:如何修复Gradle中的版本问题
EN

Stack Overflow用户
提问于 2019-06-25 15:00:24
回答 1查看 1.5K关注 0票数 0

我有一个在distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip上的项目

但是我的本地版本是:

代码语言:javascript
复制
------------------------------------------------------------
Gradle 5.4.1
------------------------------------------------------------

Build time:   2019-04-26 08:14:42 UTC
Revision:     261d171646b36a6a28d5a19a69676cd098a4c19d

Kotlin:       1.3.21
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          1.8.0_201 (Oracle Corporation 25.201-b09)
OS:           Mac OS X 10.13.6 x86_64

我认为这将是一个简单的到Android、File -> Project structure并在那里更改Gradle版本的方法,我根据gradle-wrapper.properties distributionUrl=https://services.gradle.org/distributions/gradle-4.10.1-all.zip中的内容将其从5.1.1改为4.10.1,但随后我得到了错误:

错误“最低支持的分级版本是5.1.1。更新android后,当前版本为4.10.1“

这是否意味着我只需要用5.1.1更新所有的东西?如果是这样的话,最好的步骤是让这个遗留的gradle RN项目中的所有东西都跟上5.1.1这里记录的急剧变化:5.0#preamble

我希望有什么文件,有确切的我正在经历,但这将是太容易。

例如,这是我继续遇到的错误之一:

Task 'installDebug' not found in project ':app'. Some candidates are: 'installDevDebug', 'installQaDebug', 'installUaDebug'.

我进入android/并运行gradle installDevDebug,最后得到了以下错误:

代码语言:javascript
复制
Task :react-native-sentry:compileDebugJavaWithJavac FAILED
/Users/danale/Projects/engage-application.mobile/node_modules/react-native-sentry/android/src/main/java/io/sentry/RNSentryModule.java:252: error: incompatible types: ReadableArray cannot be converted to ReadableNativeArray
            addExceptionInterface(eventBuilder, exception.getString("type"), exception.getString("value"), stacktrace.getArray("frames"));
                                                                                                                              ^
Note: /Users/danale/Projects/engage-application.mobile/node_modules/react-native-sentry/android/src/main/java/io/sentry/RNSentryModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-sentry:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* 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 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

我该怎么解决这个问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-06-25 15:35:18

在运行命令时,是否尝试过使用-stacktrace选项?还是在ProjectBuilder.js中更改ProjectBuilder.js?

代码语言:javascript
复制
     var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-5.4.1-all.zip'; <<<<change to 4.10.1 here where the var is set. 
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56756953

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档