作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
请帮助我理解并修复我的应用程序启动时发生的下一个错误。
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 应用程序代码:
关于android - 如何修复 java.lang.NoClassDefFoundError : Failed resolution of: Lcom/android/installreferrer/api/InstallReferrerStateListener; error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53887666/
请帮助我理解并修复我的应用程序启动时发生的下一个错误。 12-24 09:50:21.073 16050-16050/com.dev.ct.dev I/art: Rejecting re-init o
我是一名优秀的程序员,十分优秀!