Git Product home page Git Product logo

Unable to resume activity - java.lang.SecurityException: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts about react-native-square-reader-sdk HOT 4 OPEN

fobos531 avatar fobos531 commented on September 6, 2024
Unable to resume activity - java.lang.SecurityException: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts

from react-native-square-reader-sdk.

Comments (4)

Armaxis avatar Armaxis commented on September 6, 2024 1

Hello!
Thank you, we confirmed that this crash is happening when targetSdkVersion=34 and device is running Android 14 (api 34).
We’re currently working on a proper fix in Reader SDK library, but don’t have an ETA on when it will be ready.
Meanwhile you can use following workaround to fix the issue:

In your custom Application class - the one that calls ReaderSdk.initialize(this) - add following

  @Override
  public Intent registerReceiver(@Nullable BroadcastReceiver receiver, IntentFilter filter) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU
        && receiver != null
        && receiver.getClass().getName().startsWith("com.squareup.")) {
      // Hotfix for Reader SDK not working on Android 14. Always use RECEIVER_EXPORTED.
      return super.registerReceiver(receiver, filter, RECEIVER_EXPORTED);
    } else {
      return super.registerReceiver(receiver, filter);
    }
  }

from react-native-square-reader-sdk.

fobos531 avatar fobos531 commented on September 6, 2024

@fka3 I believe this is an issue upstream in Square's implementation. Can this be fixed upstream? I would very much like to target SDK 34.

from react-native-square-reader-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.