代码之家  ›  专栏  ›  技术社区  ›  basavaraj navi

Android Fabric crashlytics问题

  •  -2
  • basavaraj navi  · 技术社区  · 7 年前

    在添加fabric crashlytics后,我遇到了一个错误,因为在android 4.4中没有发现MultiPartBuildEntry的类定义错误

     java.lang.NoClassDefFoundError: org.apache.http.entity.mime.MultipartEntityBuilder
     at clovewearable.commons.social.server.SignUpService.generateMultiPartPayload(SignUpService.java:171)
     at clovewearable.commons.social.server.SignUpService.triggerAPICall(SignUpService.java:110)
     at clovewearable.commons.social.ui.SignUpFragment.triggerAPICall(SignUpFragment.java:585)
     at clovewearable.commons.social.ui.SignUpFragment.validateNormalSignIn(SignUpFragment.java:388)
     at clovewearable.commons.social.ui.SignUpFragment.onClick(SignUpFragment.java:427)
     at android.view.View.performClick(View.java:4640)
     at android.view.View$PerformClick.run(View.java:19421)
     at android.os.Handler.handleCallback(Handler.java:733)
     at android.os.Handler.dispatchMessage(Handler.java:95)
     at android.os.Looper.loop(Looper.java:136)
     at android.app.ActivityThread.main(ActivityThread.java:5476)
     at java.lang.reflect.Method.invokeNative(Native Method)
     at java.lang.reflect.Method.invoke(Method.java:515)
     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268)
     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084)
     at dalvik.system.NativeStart.main(Native Method)
    
    2 回复  |  直到 7 年前
        1
  •  0
  •   Olena Y    7 年前

    Application.class 应扩展自 MultiDexApplication

    android {
    defaultConfig {
    ...
       multiDexEnabled true
    }  
    dependencies {
    ...
       compile 'com.android.support:multidex:1.0.2'
    }
    
        2
  •  0
  •   Vadim Kotov First Zero    7 年前

    要在类内初始化结构,我们必须启动结构催化剂。

    onCreate 要初始化结构:

    Fabric.with(this, new Crashlytics());