@SuppressWarnings("rawtypes")
  public static Class loadPluginClassByName(String clazzName) {

    PluginDescriptor pluginDescriptor = getPluginDescriptorByClassName(clazzName);

    if (pluginDescriptor != null) {

      ensurePluginInited(pluginDescriptor);

      DexClassLoader pluginClassLoader = pluginDescriptor.getPluginClassLoader();

      try {
        Class pluginClazz = ((ClassLoader) pluginClassLoader).loadClass(clazzName);
        LogUtil.d("loadPluginClass Success for clazzName ", clazzName);
        return pluginClazz;
      } catch (ClassNotFoundException e) {
        e.printStackTrace();
      } catch (java.lang.IllegalAccessError illegalAccessError) {
        illegalAccessError.printStackTrace();
        throw new IllegalAccessError(
            "出现这个异常最大的可能是插件dex和" + "宿主dex包含了相同的class导致冲突, " + "请检查插件的编译脚本,确保排除了所有公共依赖库的jar");
      }
    }

    LogUtil.e("loadPluginClass Fail for clazzName ", clazzName);

    return null;
  }
 /**
  * 通过插件Id唤起插件
  *
  * @param pluginId
  * @return
  */
 public static PluginDescriptor initPluginByPluginId(String pluginId) {
   PluginDescriptor pluginDescriptor = getPluginDescriptorByPluginId(pluginId);
   if (pluginDescriptor != null) {
     ensurePluginInited(pluginDescriptor);
   }
   return pluginDescriptor;
 }
  /**
   * 根据插件中的classId加载一个插件中的class
   *
   * @param clazzId
   * @return
   */
  @SuppressWarnings("rawtypes")
  public static Class loadPluginFragmentClassById(String clazzId) {

    PluginDescriptor pluginDescriptor = getPluginDescriptorByFragmenetId(clazzId);

    if (pluginDescriptor != null) {

      ensurePluginInited(pluginDescriptor);

      DexClassLoader pluginClassLoader = pluginDescriptor.getPluginClassLoader();

      String clazzName = pluginDescriptor.getPluginClassNameById(clazzId);
      if (clazzName != null) {
        try {
          Class pluginClazz = ((ClassLoader) pluginClassLoader).loadClass(clazzName);
          LogUtil.d("loadPluginClass for clazzId", clazzId, "clazzName", clazzName, "success");
          return pluginClazz;
        } catch (ClassNotFoundException e) {
          e.printStackTrace();
        }
      }
    }

    LogUtil.e("loadPluginClass for clazzId", clazzId, "fail");

    return null;
  }
  @SuppressWarnings("rawtypes")
  public static Class loadPluginClassByName(String clazzName) {

    PluginDescriptor pluginDescriptor = getPluginDescriptorByClassName(clazzName);

    if (pluginDescriptor != null) {

      ensurePluginInited(pluginDescriptor);

      DexClassLoader pluginClassLoader = pluginDescriptor.getPluginClassLoader();

      try {
        Class pluginClazz = ((ClassLoader) pluginClassLoader).loadClass(clazzName);
        LogUtil.d("loadPluginClass Success for clazzName ", clazzName);
        return pluginClazz;
      } catch (ClassNotFoundException e) {
        e.printStackTrace();
      } catch (java.lang.IllegalAccessError illegalAccessError) {
        illegalAccessError.printStackTrace();
      }
    }

    LogUtil.e("loadPluginClass Fail for clazzName ", clazzName);

    return null;
  }