react / react/react-native

I have issue in using react-native-document-picker

Open
#56,433 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Component: Picker Needs: Triage :mag:
Dominant language
C++
Stars
127k
Forks
25.3k
Avg merge
1d 23h
Merged PRs (30d)
4

Description

Description

error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:21: error: cannot find symbol
import com.facebook.react.bridge.GuardedResultAsyncTask; ^ symbol: class GuardedResultAsyncTask location: package com.facebook.react.bridge C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:232: error: cannot find symbol private static class ProcessDataTask extends GuardedResultAsyncTask { ^ symbol: class GuardedResultAsyncTask location: class RNDocumentPickerModule C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:226: error: cannot find symbol new ProcessDataTask(getReactApplicationContext(), uris, copyTo, promise).execute(); ^ symbol: method execute() location: class ProcessDataTask C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:246: error: method does not override or implement a method from a supertype @Override ^ C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:255: error: method does not override or implement a method from a supertype @Override ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 5 errors FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-document-picker:compileDebugJavaWithJavac'. > Compilation failed; see the compiler output below. Note: Recompile with -Xlint:deprecation for details. C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:21: error: cannot find symbol import com.facebook.react.bridge.GuardedResultAsyncTask; ^ symbol: class GuardedResultAsyncTask location: package com.facebook.react.bridge C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:232: error: cannot find symbol private static class ProcessDataTask extends GuardedResultAsyncTask { ^ symbol: class GuardedResultAsyncTask location: class RNDocumentPickerModule Note: Some input files use or override a deprecated API. C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:246: error: method does not override or implement a method from a supertype @Override ^ C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:255: error: method does not override or implement a method from a supertype @Override ^ C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:226: error: cannot find symbol new ProcessDataTask(getReactApplicationContext(), uris, copyTo, promise).execute(); ^ symbol: method execute() location: class ProcessDataTask 5 errors * Try: > Check your code and dependencies to fix the compilation error(s) > Run with --scan to generate a Build Scan (Powered by Develocity). BUILD FAILED in 7s.
info Run CLI with --verbose flag for more details.

Steps to reproduce

1.Install the react-native-document-picker.
2. Import DocumentPicker from "react-native-document-picker";
3. It produces that above error

React Native Version

0.83.1

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info
info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.26200
  CPU: (16) x64 13th Gen Intel(R) Core(TM) i5-13400F
  Memory: 16.98 GB / 31.84 GB
Binaries:
  Node:
    version: 20.19.4
    path: C:\nvm4w\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 8.19.4
    path: C:\nvm4w\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "33"
      - "34"
      - "35"
      - "36"
    Build Tools:
      - 30.0.3
      - 34.0.0
      - 35.0.0
      - 36.0.0
      - 36.1.0
    System Images:
      - android-36.1 | Google Play Intel x86_64 Atom
      - android-36 | Google APIs Intel x86_64 Atom
    Android NDK: Not Found
  Windows SDK: Not Found
IDEs:
  Android Studio: AI-252.27397.103.2522.14617522
  Visual Studio: Not Found
Languages:
  Java:
    version: 17.0.17
    path: C:\Program Files\Eclipse Adoptium\jdk-17.0.17.10-hotspot\bin\javac.EXE
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli":
    installed: 20.0.0
    wanted: 20.0.0
  react:
    installed: 19.2.0
    wanted: 19.2.0
  react-native:
    installed: 0.83.1
    wanted: 0.83.1
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

info React Native v0.85.1 is now available (your project is running on v0.83.1).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.85.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.83.1&to=0.85.1
info For more info, check out "https://reactnative.dev/docs/upgrading?os=windows".
PS C:\Users\Pc\React Native Projects\EzWealth>
Stacktrace or Logs
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:21: error: cannot find symbol
import com.facebook.react.bridge.GuardedResultAsyncTask; ^ symbol: class GuardedResultAsyncTask location: package com.facebook.react.bridge C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:232: error: cannot find symbol private static class ProcessDataTask extends GuardedResultAsyncTask<ReadableArray> { ^ symbol: class GuardedResultAsyncTask location: class RNDocumentPickerModule C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:226: error: cannot find symbol new ProcessDataTask(getReactApplicationContext(), uris, copyTo, promise).execute(); ^ symbol: method execute() location: class ProcessDataTask C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:246: error: method does not override or implement a method from a supertype @Override ^ C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:255: error: method does not override or implement a method from a supertype @Override ^ Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 5 errors FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-document-picker:compileDebugJavaWithJavac'. > Compilation failed; see the compiler output below. Note: Recompile with -Xlint:deprecation for details. C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:21: error: cannot find symbol import com.facebook.react.bridge.GuardedResultAsyncTask; ^ symbol: class GuardedResultAsyncTask location: package com.facebook.react.bridge C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:232: error: cannot find symbol private static class ProcessDataTask extends GuardedResultAsyncTask<ReadableArray> { ^ symbol: class GuardedResultAsyncTask location: class RNDocumentPickerModule Note: Some input files use or override a deprecated API. C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:246: error: method does not override or implement a method from a supertype @Override ^ C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:255: error: method does not override or implement a method from a supertype @Override ^ C:\Users\Pc\React Native Projects\EzWealth\node_modules\react-native-document-picker\android\src\main\java\com\reactnativedocumentpicker\RNDocumentPickerModule.java:226: error: cannot find symbol new ProcessDataTask(getReactApplicationContext(), uris, copyTo, promise).execute(); ^ symbol: method execute() location: class ProcessDataTask 5 errors * Try: > Check your code and dependencies to fix the compilation error(s) > Run with --scan to generate a Build Scan (Powered by Develocity). BUILD FAILED in 7s.
info Run CLI with --verbose flag for more details.
MANDATORY Reproducer

https://github.com/ananya-techculture/EzWealth

Screenshots and Videos

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with node_modules/react-native-document-picker/android/src/main/java/com/reactnativedocumentpicker/RNDocumentPickerModule.java and the reported :react-native-document-picker:compileDebugJavaWithJavac task. Reproduce it using the EzWealth repository with React Native 0.83.1 and the documented Android setup. Done means the dependency compiles and the Android app builds successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, react-native
Domain
build-system, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.