gpt4 book ai didi

android - 如何修复 java.lang.NoClassDefFoundError : Failed resolution of: Lcom/android/installreferrer/api/InstallReferrerStateListener; error

转载 作者:行者123 更新时间:2023-11-30 05:10:04 26 4
gpt4 key购买 nike

请帮助我理解并修复我的应用程序启动时发生的下一个错误。

12-24 09:50:21.073 16050-16050/com.dev.ct.dev I/art: Rejecting re-init on previously-failed class java.lang.Class<io.branch.referral.InstallListener$ReferrerClientWrapper$1>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/android/installreferrer/api/InstallReferrerStateListener;
at void io.branch.referral.InstallListener.captureInstallReferrer(android.content.Context, long, io.branch.referral.InstallListener$IInstallReferrerEvents) (InstallListener.java:54)
at void io.branch.referral.Branch.registerAppInit(io.branch.referral.Branch$BranchReferralInitListener, io.branch.referral.ServerRequest$PROCESS_WAIT_LOCK) (Branch.java:2322)
at void io.branch.referral.Branch.initializeSession(io.branch.referral.Branch$BranchReferralInitListener) (Branch.java:2280)
at void io.branch.referral.Branch.initUserSessionInternal(io.branch.referral.Branch$BranchReferralInitListener, android.app.Activity, boolean) (Branch.java:1269)
at boolean io.branch.referral.Branch.initSession(io.branch.referral.Branch$BranchReferralInitListener, android.app.Activity) (Branch.java:931)
at boolean io.branch.referral.Branch.initSession(io.branch.referral.Branch$BranchReferralInitListener) (Branch.java:894)
at void mobile.droid.ctrader.infrastructure.DroidApplication.n_onCreate() (DroidApplication.java:-2)
at void mobile.droid.ctrader.infrastructure.DroidApplication.onCreate() (DroidApplication.java:27)
at void android.app.Instrumentation.callApplicationOnCreate(android.app.Application) (Instrumentation.java:1032)
at void android.app.ActivityThread.handleBindApplication(android.app.ActivityThread$AppBindData) (ActivityThread.java:5876)
at void android.app.ActivityThread.-wrap3(android.app.ActivityThread, android.app.ActivityThread$AppBindData) (ActivityThread.java:-1)
at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1699)
at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
at void android.os.Looper.loop() (Looper.java:154)
at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6682)
at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1520)
at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1410)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.android.installreferrer.api.InstallReferrerStateListener" on path: DexPathList[[zip file "/data/app/com.dev.ct.dev-1/base.apk"],nativeLibraryDirectories=[/data/app/com.dev.ct.dev-1/lib/arm64, /data/app/com.dev.ct.dev-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]
at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
at void io.branch.referral.InstallListener.captureInstallReferrer(android.content.Context, long, io.branch.referral.InstallListener$IInstallReferrerEvents) (InstallListener.java:54)
at void io.branch.referral.Branch.registerAppInit(io.branch.referral.Branch$BranchReferralInitListener, io.branch.referral.ServerRequest$PROCESS_WAIT_LOCK) (Branch.java:2322)
at void io.branch.referral.Branch.initializeSession(io.branch.referral.Branch$BranchReferralInitListener) (Branch.java:2280)
at void io.branch.referral.Branch.initUserSessionInternal(io.branch.referral.Branch$BranchReferralInitListener, android.app.Activity, boolean) (Branch.java:1269)
at boolean io.branch.referral.Branch.initSession(io.branch.referral.Branch$BranchReferralInitListener, android.app.Activity) (Branch.java:931)
at boolean io.branch.referral.Branch.initSession(io.branch.referral.Branch$BranchReferralInitListener) (Branch.java:894)
at void mobile.droid.ctrader.infrastructure.DroidApplication.n_onCreate() (DroidApplication.java:-2)12-24 09:50:21.074 16050-16050/com.dev.ct.dev I/art:
at void mobile.droid.ctrader.infrastructure.DroidApplication.onCreate() (DroidApplication.java:27)
at void android.app.Instrumentation.callApplicationOnCreate(android.app.Application) (Instrumentation.java:1032)
at void android.app.ActivityThread.handleBindApplication(android.app.ActivityThread$AppBindData) (ActivityThread.java:5876)
at void android.app.ActivityThread.-wrap3(android.app.ActivityThread, android.app.ActivityThread$AppBindData) (ActivityThread.java:-1)
at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1699)
at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
at void android.os.Looper.loop() (Looper.java:154)
at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6682)
at java.lang.Object java.lang.reflect.Method.invoke!(java.lang.Object, java.lang.Object[]) (Method.java:-2)
at void com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run() (ZygoteInit.java:1520)
at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:1410)

这是一个 c# xamarin 代码,在 Activity OnStart 上运行

        BranchAndroid.GetAutoInstance(ApplicationContext.Instance);
BranchAndroid.Init(activity, "SOME_KEY", new BranchSessionListener()); // This line fails
BranchXamarinSDK.Branch.GetInstance().SetMaxRetries(5);

BranchSessionListener 只是一个实现 InitSessionComplete 方法的自定义 c# 类。

我不知道解决这个问题的正确方法。请帮忙

最佳答案

对于 Xamarin,您需要在 MainActivity 的 onCreate 中初始化 Branch。有关初始集成步骤的帮助,请参阅我们详细的 Android Xamarin Test Bed 应用程序代码:

https://github.com/BranchMetrics/xamarin-branch-deep-linking/blob/master/Examples/droid_example/Branch_Testbed_Android/MainActivity.cs

关于android - 如何修复 java.lang.NoClassDefFoundError : Failed resolution of: Lcom/android/installreferrer/api/InstallReferrerStateListener; error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53887666/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com