picker icon indicating copy to clipboard operation
picker copied to clipboard

Error while ./gradlew build

Open adityabohra007 opened this issue 4 years ago • 10 comments

Task :react-native-picker_picker:lint FAILED Ran lint on variant debug: 4 issues found Ran lint on variant release: 4 issues found Wrote HTML report to file:///home/adityabohra/Documents/Dev/TestReact/AwesomeProject/node_modules/@react-native-picker/picker/android/build/reports/lint-results.html Wrote XML report to file:///home/adityabohra/Documents/Dev/TestReact/AwesomeProject/node_modules/@react-native-picker/picker/android/build/reports/lint-results.xml

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':react-native-picker_picker: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:

/home/adityabohra/Documents/Dev/TestReact/AwesomeProject/node_modules/@react-native-picker/picker/android/src/main/java/com/reactnativecommunity/picker/CheckedTextViewImpl.java:7: Error: This custom view should extend androidx.appcompat.widget.AppCompatCheckedTextView instead [AppCompatCustomView] public class CheckedTextViewImpl extends CheckedTextView { ~~~~~~~~~~~~~~~ /home/adityabohra/Documents/Dev/TestReact/AwesomeProject/node_modules/@react-native-picker/picker/android/src/main/java/com/reactnativecommunity/picker/TextViewImpl.java:7: Error: This custom view should extend androidx.appcompat.widget.AppCompatTextView instead [AppCompatCustomView] public class TextViewImpl extends TextView { ~~~~~~~~

adityabohra007 avatar Oct 28 '21 08:10 adityabohra007

got the same error on android when pack, wait to be fixed.

shiqkuangsan avatar Nov 25 '21 14:11 shiqkuangsan

Facing the same issue. Any workaround??

PranatoshRoy avatar Nov 28 '21 16:11 PranatoshRoy

Same

indapublic avatar Jan 13 '22 11:01 indapublic

Repository

How to reproduce from scratch:

npx react-native init testpicker --template react-native-template-typescript --npm
npm install --save @react-native-picker/picker
cd android
./gradlew build

Result:

> Task :react-native-picker_picker:lint FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-picker_picker: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:

  /private/tmp/testpicker/node_modules/@react-native-picker/picker/android/src/main/java/com/reactnativecommunity/picker/CheckedTextViewImpl.java:7: Error: This custom view should extend androidx.appcompat.widget.AppCompatCheckedTextView instead [AppCompatCustomView]
  public class CheckedTextViewImpl extends CheckedTextView {
                                           ~~~~~~~~~~~~~~~
  /private/tmp/testpicker/node_modules/@react-native-picker/picker/android/src/main/java/com/reactnativecommunity/picker/TextViewImpl.java:7: Error: This custom view should extend androidx.appcompat.widget.AppCompatTextView instead [AppCompatCustomView]
  public class TextViewImpl extends TextView {
                                    ~~~~~~~~

indapublic avatar Jan 13 '22 14:01 indapublic

Seems like this will pass lint stage


allprojects {
    ...
    afterEvaluate {
        if (getPlugins().hasPlugin('android') ||
            getPlugins().hasPlugin('android-library')) {
            configure(android.lintOptions) {
                abortOnError false
                checkReleaseBuilds false
            }
        }
    }
}

indapublic avatar Jan 15 '22 12:01 indapublic

any update? I get OP's exact same error

rileycognitv avatar Aug 01 '22 01:08 rileycognitv

I am also facing this issue? Any update?

jasonrajasegaram avatar Sep 18 '22 20:09 jasonrajasegaram

i am also have error while build apk

kamrantg avatar Nov 13 '22 16:11 kamrantg

any progress on this issue please ? facing the same problem from my side

benallamar avatar Feb 18 '23 22:02 benallamar

afterEvaluate { if (getPlugins().hasPlugin('android') || getPlugins().hasPlugin('android-library')) { configure(android.lintOptions) { abortOnError false checkReleaseBuilds false } } }

This fixed my issue

sebasbeleno avatar May 11 '23 21:05 sebasbeleno