Skip to content

Error on ContextCompat.registerReceiver #52

@matheusbento

Description

@matheusbento

Hey Guys, I'm having the following issue when trying to run yarn Android.

I was using another lib was working, but there was an issue related to slow printing: https://github.com/suraneti/react-native-sunmi-v2-printer

But I installed this one and is having this issue.

Can anyone help?

"react-native": "0.68.2",
"@heasy/react-native-sunmi-printer": "^1.8.3",

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
Warning: elemento inesperado (uri:"", local:"extension-level"). Os elementos esperados são <{}codename>,<{}layoutlib>,<{}api-level>
Warning: elemento inesperado (uri:"", local:"base-extension"). Os elementos esperados são <{}codename>,<{}layoutlib>,<{}api-level>
../node_modules/@heasy/react-native-sunmi-printer/android/src/main/java/com/reactnativesunmiprinter/SunmiScanModule.java:99: error: cannot find symbol
    ContextCompat.registerReceiver(reactContext, receiver, filter, Context.RECEIVER_EXPORTED);
                 ^
  symbol:   method registerReceiver(ReactApplicationContext,BroadcastReceiver,IntentFilter,int)
  location: class ContextCompat
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: ../node_modules/@heasy/react-native-sunmi-printer/android/src/main/java/com/reactnativesunmiprinter/SunmiScanModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

FAILURE: Build failed with an exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions