React native RNC滑块lint在上失败。/gradlew clean build and release apk在应用程序启动时崩溃

React native RNC滑块lint在上失败。/gradlew clean build and release apk在应用程序启动时崩溃,react-native,android-gradle-plugin,React Native,Android Gradle Plugin,在组装发行版之前,我试图进行干净的构建,但它抛出了错误并失败了任务。当我在我的LG G4手机上安装了apk(也尝试了三星Galaxy J3)后,它就崩溃了,无法启动 我的应用程序在我的手机上成功地与react native run android配合使用 在组装发布版本之前,我输入了 cd android ./gradlew clean ./gradlew buildcache ./gradlew clean build 最后一个命令总是给出错误 添加后 android { l

在组装发行版之前,我试图进行干净的构建,但它抛出了错误并失败了任务。当我在我的LG G4手机上安装了apk(也尝试了三星Galaxy J3)后,它就崩溃了,无法启动

我的应用程序在我的手机上成功地与
react native run android
配合使用

在组装发布版本之前,我输入了

cd android
./gradlew clean
./gradlew buildcache
./gradlew clean build
最后一个命令总是给出错误

添加后

  android {
      lintOptions {
          abortOnError false
      }
  }
如错误所示,
/gradlew clean build
成功完成其任务。但在生成并安装release apk后,我仍然无法打开该应用程序

/gradlew干净构建
错误:

...
> Task :@react-native-community_slider:lint FAILED
Ran lint on variant release: 3 issues found
Ran lint on variant debug: 3 issues found
Wrote HTML report to file:///D:/React/Pure%20RN/dassist/node_modules/@react-native-community/slider/android/build/reports/lint-results.html
Wrote XML report to file:///D:/React/Pure%20RN/dassist/node_modules/@react-native-community/slider/android/build/reports/lint-results.xml

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':@react-native-community_slider:lint'.
> Lint found errors in the project; aborting build.

  Fix the issues identified by lint, or add the following to your build script to proceed with errors:
  ...
  android {
      lintOptions {
          abortOnError false
      }
  }
  ...

  Errors found:

  D:\React\Pure RN\dassist\node_modules\@react-native-community\slider\android\src\main\java\com\reactnativecommunity\slider\ReactSliderManager.java:68: Error: Value must be ? 0 (was -2) [Range]
              ViewGroup.LayoutParams.WRAP_CONTENT,
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



* 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

BU¦LD FAILED in 35s
163 actionable tasks: 154 executed, 9 up-to-date
这是输出日志中提到的xml报告文件(不包括警告)的一部分:

<issues format="5" by="lint 3.3.1">

    <issue
        id="Range"
        severity="Error"
        message="Value must be ≥ 0 (was -2)"
        category="Correctness"
        priority="6"
        summary="Outside Range"
        explanation="Some parameters are required to in a particular numerical range; this check makes sure that arguments passed fall within the range. For arrays, Strings and collections this refers to the size or length."
        errorLine1="            ViewGroup.LayoutParams.WRAP_CONTENT,"
        errorLine2="            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
        <location
            file="D:\React\Pure RN\dassist\node_modules\@react-native-community\slider\android\src\main\java\com\reactnativecommunity\slider\ReactSliderManager.java"
            line="68"
            column="13"/>
    </issue>

</issues>



运行'/gradlew lintfix',然后执行。/gradlew clean build.@RanjanKumar谢谢您的帮助。但是
/gradlew lintfix
修复了一些其他错误(关于AsyncStorage和NetInfo),而不是滑块的错误。在干净的版本中仍然显示相同的错误。@harky您能解决这个问题吗?我得到了这个错误now@GraemePaul我已经创建了一个新的RN 0.61.2 init并重写了所有代码。它正在工作。运行“./gradlew lintfix”,然后执行。/gradlew clean build。@RanjanKumar感谢您的帮助。但是
/gradlew lintfix
修复了一些其他错误(关于AsyncStorage和NetInfo),而不是滑块的错误。在干净的版本中仍然显示相同的错误。@harky您能解决这个问题吗?我得到了这个错误now@GraemePaul我已经创建了一个新的RN 0.61.2 init并重写了所有代码。它正在工作。