Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method 'void com.paypal.pyplcheckout.di.DaggerSdkComponent$Factory.<init>()' is inaccessible to class 'com.paypal.pyplcheckout.di.DaggerSdkComponent' (declaration of 'com.paypal.pyplcheckout.di.DaggerSdkComponent' appears in /data/app/com.marineonline.app-NDFpNmA3WJVGGLKMNiiphA==/base.apk!classes4.dex) #292

Closed
StationChnqoo opened this issue Jan 17, 2024 · 2 comments
Labels

Comments

@StationChnqoo
Copy link

StationChnqoo commented Jan 17, 2024

Before you create a new issue, please search for similar issues. It's possible somebody has encountered this bug already. PLEASE REMOVE THIS LINE TO ACKNOWLEDGE THAT AN ISSUE DOESN'T ALREADY EXIST FOR THIS BUG

Describe the bug
I'm using com.paypal.checkout:android-sdk:1.2.1in React Native project.
I got this exception:

FATAL EXCEPTION: main
  Process: com.marineonline.app, PID: 23263
  java.lang.IllegalAccessError: Method 'void com.paypal.pyplcheckout.di.DaggerSdkComponent$Factory.<init>()' is inaccessible to class 'com.paypal.pyplcheckout.di.DaggerSdkComponent' (declaration of 'com.paypal.pyplcheckout.di.DaggerSdkComponent' appears in /data/app/com.marineonline.app-NDFpNmA3WJVGGLKMNiiphA==/base.apk!classes4.dex)
    at com.paypal.pyplcheckout.di.DaggerSdkComponent.factory(DaggerSdkComponent.java:760)
    at com.paypal.pyplcheckout.di.SdkComponent$Companion.create(SdkComponent.kt:162)
    at com.paypal.checkout.PayPalCheckout.setConfig(PayPalCheckout.kt:52)
    at com.emarineonline.marineonline.MainApplication.initPaypalConfigs(MainApplication.java:167)
    at com.emarineonline.marineonline.MainApplication.onCreate(MainApplication.java:144)
    at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1190)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6582)
    at android.app.ActivityThread.access$1400(ActivityThread.java:224)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1887)
    at android.os.Handler.dispatchMessage(Handler.java:107)
    at android.os.Looper.loop(Looper.java:224)
    at android.app.ActivityThread.main(ActivityThread.java:7562)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

To Reproduce

ext {
    compileSdkVersion = 31
    targetSdkVersion = 31
    minSdkVersion = 21
    buildToolsVersion = "31.0.0"
    googlePlayServicesVersion = "15.0.1"
    supportLibVersion = "30.0.0"
}

Here is my code in MainApplication.java:

public class MainApplication extends Application implements ReactApplication {

    private static MainApplication instance;

    private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
        @Override
        public boolean getUseDeveloperSupport() {
            return BuildConfig.DEBUG;
        }

    public static Application getInstance(){
        return instance;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        initPaypalConfigs();
        SoLoader.init(this, /* native exopackage */ false);
    }
    
    private void initPaypalConfigs() {
        // https://developer.paypal.com/limited-release/paypal-mobile-checkout/initialize-sdk/
        CheckoutConfig config = new CheckoutConfig(
            MainApplication.getInstance(),
            "my-client-id",
            Environment.SANDBOX,
            CurrencyCode.USD,
            UserAction.PAY_NOW,
            PaymentButtonIntent.CAPTURE,
            new SettingsConfig(
                true,
                false
            ),
            new UIConfig(true),
            "my-package-id://paypalpay"
        );
        PayPalCheckout.setConfig(config);
    }
}

Expected behavior
Config successfully.

Screenshots

Smartphone (please complete the following information):

  • Android Version: Android 10
  • Device: MI 8 SE
  • Browser [e.g. chrome, safari] <- only applicable for app switches or fallback situations
  • SDK Version 1.2.1
  • Package name of your app AVNW7-GreRf52q07Rb6n3eZ94Yj50zRO9kFUXaAkdIZXpG7UaHHY83zUS0r71VHxJXLEXp65YhMtN4f_
  • Client ID com.marineonline.app://paypalpay

Additional context
Add any other context about the problem here.

Copy link

Thank you for reaching out to the Native Checkout SDK team. This integration path is now inactive for new merchants.
If you are an existing merchant, please contact us here for further assistance.

New merchants can integrate the Native Checkout experience via the Braintree Android SDK or PayPal Android SDK.
For more information please see their respective developer documentation linked below.

@StationChnqoo
Copy link
Author

StationChnqoo commented Jan 19, 2024

很高兴的告诉各位developer,这个问题已经解决了。
因为目前的项目是ReactNative两年前的版本,所以这中间会涉及到很多三方库的升级和兼容性问题。经过排查新建一个新的Project是没问题的,所以结论是目前的配置有问题。
我尝试依次升级了以下配置:




希望对遇见同样问题的各位有所帮助和启示😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant