[英]java.lang.NoClassDefFoundError on Mixpanel bindings
I'm trying to integrate Mixpanel into my Xamarin.Android project. 我正在尝试将Mixpanel集成到我的Xamarin.Android项目中。 But when I'm calling
Com.Mixpanel.Android.Mpmetrics.MixpanelAPI.GetInstance()
, java.lang.NoClassDefFoundError
exception is thrown with message com/mixpanel/android/mpmetrics/MixpanelAPI . 但是当我调用
Com.Mixpanel.Android.Mpmetrics.MixpanelAPI.GetInstance()
,消息com / mixpanel / android / mpmetrics / MixpanelAPI引发了java.lang.NoClassDefFoundError
异常。
I've just built MixpanelAPI.jar, then created "Android Java Bindings Library" project, added jar as InputJar (also tried EmbeddedJar), then built dll and imported it into my project. 我刚刚构建了MixpanelAPI.jar,然后创建了“ Android Java绑定库”项目,将jar添加为InputJar(也尝试了EmbeddedJar),然后构建了dll并将其导入到我的项目中。
jar tf MixpanelAPI.jar
shows all classes, javap
shows valid class interfaces. jar tf MixpanelAPI.jar
显示所有类, javap
显示有效的类接口。 Assembly Browser also shows all classes. 程序集浏览器还显示所有类。 But when it comes to
class_ref
get
, exception is thrown. 但是当涉及到
class_ref
get
,将引发异常。
I can't get what I am doing wrong. 我做错了我。
Stacktrace: 堆栈跟踪:
[MonoDroid] UNHANDLED EXCEPTION: Java.Lang.NoClassDefFoundError: Exception of type 'Java.Lang.NoClassDefFoundError' was thrown. [MonoDroid] at Android.Runtime.JNIEnv.FindClass (string) [0x00087] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.0-branch/b76e8ec4/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:287 [MonoDroid] at Android.Runtime.JNIEnv.FindClass (string,intptr&) [0x00014] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.8.0-branch/b76e8ec4/source/monodroid/src/Mono.Android/src/Runtime/JNIEnv.cs:300 [MonoDroid] at Com.Mixpanel.Android.Mpmetrics.MixpanelAPI.get_class_ref () [0x00000] in /path/to/mixpanel/bindings/project/Mixpanel/Mixpanel/obj/Release/generated/src/Com.Mixpanel.Android.Mpmetrics.MixpanelAPI.cs:1047 [MonoDroid] at Com.Mixpanel.Android.Mpmetrics.MixpanelAPI.GetInstance (Android.Content.Context,string) [0x00014] in /path/to/mixpanel/bindings/project/Mixpanel/Mixpanel/obj/Release/generated/src/Com.Mixpanel.Android.Mpmetrics.MixpanelAPI.cs:1199
Mixpanel bindings (65 KB) and Test project for bindings (7 KB) Mixpanel绑定(65 KB)和绑定的测试项目(7 KB)
Right click on project and its intermeadiate project if any. 右键单击项目及其中间项目(如果有)。 Go to Properties->Java Build Path->Libraries-> The removed androied dependecies and android private libraries.
转到“属性”->“ Java构建路径”->“库”->“已删除并依赖的依赖项和android私有库”。 Clean projects.
清洁项目。 It should remove classDefNotFound exception.
它应该删除classDefNotFound异常。
Sounds like the lib/jar you have generated is possibly referencing a class which is now not in scope. 听起来您生成的lib / jar可能引用了一个不在范围内的类。 I would suggest revisiting the binding project to ensure that everything is being referenced correctly.
我建议重新访问绑定项目,以确保正确引用所有内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.