wonday / react-native-pdf

A <Pdf /> component for react-native
MIT License
1.58k stars 540 forks source link

error: method does not override or implement a method from a supertype #743

Open feralxan opened 1 year ago

feralxan commented 1 year ago

What react-native version are you using?

0.69.10

What react-native-pdf version are you using?

6.6.2

What platform does your issue occur on? (android/ios/both)

android

Describe your issue as precisely as possible : 1) Steps to reproduce the issue or to explain in which case you get the issue when yarn run

android

2) Interesting logs

Task :react-native-pdf:compileDebugJavaWithJavac FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

Execution optimizations have been disabled for 5 invalid unit(s) of work during this build to ensure correctness. Please consult deprecation warnings for more details. 408 actionable tasks: 12 executed, 396 up-to-date /Users/rakhmanuye/projects/thg-mobile/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/PdfManager.java:29: error: PdfManager is not abstract and does not override abstract method showsVerticalScrollIndicator(PdfView,boolean) in RNPDFPdfViewManagerInterface public class PdfManager extends SimpleViewManager implements RNPDFPdfViewManagerInterface { ^ /Users/rakhmanuye/projects/thg-mobile/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/PdfManager.java:97: error: method does not override or implement a method from a supertype @Override ^ /Users/rakhmanuye/projects/thg-mobile/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/PdfManager.java:102: error: method does not override or implement a method from a supertype @Override ^ Note: /Users/rakhmanuye/projects/thg-mobile/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/PdfView.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 3 errors

FAILURE: Build failed with an exception.

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

BUILD FAILED in 35s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 /Users/rakhmanuye/projects/thg-mobile/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/PdfManager.java:29: error: PdfManager is not abstract and does not override abstract method showsVerticalScrollIndicator(PdfView,boolean) in RNPDFPdfViewManagerInterface public class PdfManager extends SimpleViewManager implements RNPDFPdfViewManagerInterface { ^ /Users/rakhmanuye/projects/thg-mobile/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/PdfManager.java:97: error: method does not override or implement a method from a supertype @Override ^ /Users/rakhmanuye/projects/thg-mobile/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/PdfManager.java:102: error: method does not override or implement a method from a supertype @Override ^ Note: /Users/rakhmanuye/projects/thg-mobile/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/PdfView.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 3 errors

FAILURE: Build failed with an exception.

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

BUILD FAILED in 35s

at makeError (/Users/rakhmanuye/projects/thg-mobile/node_modules/execa/index.js:174:9)
at /Users/rakhmanuye/projects/thg-mobile/node_modules/execa/index.js:278:16
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runOnAllDevices (/Users/rakhmanuye/projects/thg-mobile/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
at async Command.handleAction (/Users/rakhmanuye/projects/thg-mobile/node_modules/@react-native-community/cli/build/index.js:192:9)

info Run CLI with --verbose flag for more details. error Command failed with exit code 1.

Join a screenshot or video of the problem on the simulator or device?

Show us the code you are using?

pipo151086 commented 1 year ago

same here

OPEN-9 commented 1 year ago

the same problem,react-native@0.64.4

OPEN-9 commented 1 year ago

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.7/userguide/command_line_interface.html#sec:command_line_warnings 387 actionable tasks: 387 executed 注: /Users/open/Documents/www/sjlinkapp/node_modules/@notifee/react-native/android/src/main/java/io/invertase/notifee/NotifeeInitProvider.java使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: /Users/open/Documents/www/sjlinkapp/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStorageModule.java使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: /Users/open/Documents/www/sjlinkapp/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java使用了未经检查或不安全的操作。 注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: /Users/open/Documents/www/sjlinkapp/node_modules/@react-native-clipboard/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: [2] Wrote GeneratedAppGlideModule with: [com.bumptech.glide.integration.okhttp3.OkHttpLibraryGlideModule, com.dylanvann.fastimage.FastImageOkHttpProgressGlideModule] 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: /Users/open/Documents/www/sjlinkapp/node_modules/@react-native-firebase/crashlytics/android/src/main/java/io/invertase/firebase/crashlytics/ReactNativeFirebaseCrashlyticsModule.java使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: 某些输入文件使用了未经检查或不安全的操作。 注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: /Users/open/Documents/www/sjlinkapp/node_modules/react-native-image-picker/android/src/main/java/com/imagepicker/Utils.java使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 注: /Users/open/Documents/www/sjlinkapp/node_modules/react-native-localize/android/src/main/java/com/zoontek/rnlocalize/RNLocalizeModule.java使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。 /Users/open/Documents/www/sjlinkapp/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/PdfManager.java:29: 错误: PdfManager不是抽象的, 并且未覆盖RNPDFPdfViewManagerInterface中的抽象方法showsVerticalScrollIndicator(PdfView,boolean) public class PdfManager extends SimpleViewManager implements RNPDFPdfViewManagerInterface { ^ /Users/open/Documents/www/sjlinkapp/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/PdfManager.java:97: 错误: 方法不会覆盖或实现超类型的方法 @Override ^ /Users/open/Documents/www/sjlinkapp/node_modules/react-native-pdf/android/src/main/java/org/wonday/pdf/PdfManager.java:102: 错误: 方法不会覆盖或实现超类型的方法 @Override ^ 3 个错误

FAILURE: Build failed with an exception.

vibrich commented 11 months ago

To solve the problem follow this steps:

  1. In /node_modules/react-native-pdf/android/src/paper/java/com/facebook/react/viewmanagers/RNPDFPdfViewManagerDelegate.java remove the @Overrides on the setProperty and receiveCommand function
  2. Now in your project remove this import 'import org.wonday.RTCPdfView;' on MainApplication.java