【问题标题】:E/Parcel: Class not found when unmarshalling: com.kakao.sdk.auth.c$cE/Parcel:解组时找不到类:com.kakao.sdk.auth.c$c
【发布时间】:2021-06-20 09:55:08
【问题描述】:

当我在您的三星手机上下载该应用程序并在将其作为内部测试分发到 Google Play 后尝试登录时发生此错误。

E/Parcel:解组时找不到类:com.kakao.sdk.auth.c$c java.lang.ClassNotFoundException: com.kakao.sdk.auth.c$c

我不知道为什么会出现这些错误。这是我的 MainApplication.java 代码,我应该在这里放什么代码?

    package com.hey;

    import android.app.Application;
    import android.content.Context;
    import com.facebook.react.PackageList;
    import com.facebook.react.ReactApplication;
    import com.facebook.react.ReactInstanceManager;
    import com.facebook.react.ReactNativeHost;
    import com.facebook.react.ReactPackage;
    import com.facebook.soloader.SoLoader;
    import java.lang.reflect.InvocationTargetException;
    import java.util.List;

    public class MainApplication extends Application implements ReactApplication {

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

            @Override
            protected List<ReactPackage> getPackages() {
              @SuppressWarnings("UnnecessaryLocalVariable")
              List<ReactPackage> packages = new PackageList(this).getPackages();
              // Packages that cannot be autolinked yet can be added manually here, for example:
              // packages.add(new MyReactNativePackage());
              return packages;
            }

            @Override
            protected String getJSMainModuleName() {
              return "index";
            }
          };

      @Override
      public ReactNativeHost getReactNativeHost() {
        return mReactNativeHost;
      }

      @Override
      public void onCreate() {
        super.onCreate();
        SoLoader.init(this, /* native exopackage */ false);
        initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
      }

      /**
      * Loads Flipper in React Native templates. Call this in the onCreate method with something like
      * initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
      *
      * @param context
      * @param reactInstanceManager
      */
      private static void initializeFlipper(
          Context context, ReactInstanceManager reactInstanceManager) {
        if (BuildConfig.DEBUG) {
          try {
            /*
            We use reflection here to pick up the class that initializes Flipper,
            since Flipper library is not available in release mode
            */
            Class<?> aClass = Class.forName("com.hey.ReactNativeFlipper");
            aClass
                .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
                .invoke(null, context, reactInstanceManager);
          } catch (ClassNotFoundException e) {
            e.printStackTrace();
          } catch (NoSuchMethodException e) {
            e.printStackTrace();
          } catch (IllegalAccessException e) {
            e.printStackTrace();
          } catch (InvocationTargetException e) {
            e.printStackTrace();
          }
        }
      }
    }

【问题讨论】:

    标签: android reactjs react-native flutter kotlin


    【解决方案1】:

    unmarshalling 错误通常是由错误处理解析Parcelable 对象引起的。试试 to search about it ,然后查看(嵌套的)包 com.kakao.sdk.auth 中的 Parcelable 类以查找错误。

    另一个提示,这可能是由启用 proguard 引起的。因此,您可以尝试为Kakao SDK 添加配置。 (参考the docs here)

    -keep class com.kakao.sdk.**.model.* { <fields>; }
    -keep class * extends com.google.gson.TypeAdapter
    

    【讨论】:

      猜你喜欢
      • 2015-04-19
      • 1970-01-01
      • 2017-06-21
      • 2021-01-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-19
      相关资源
      最近更新 更多