得到noclassdeffounderror cordova

时间:2017-09-29 12:16:13

标签: java android cordova

创建cordova插件时遇到问题。我以jar的形式使用api。我在 MeshLibraryManager.class 中调用了一个方法,该方法在内部调用它的构造函数。此构造函数调用 App.class 的方法 我遇到 java.lang.NoClassDefFoundError:com.csr.csrmeshdemo2.App 错误。但是这两个类(MeshLibraryManager.class和App.class)都位于同一个jar中。

以下是 MeshLibraryManager.class

中的方法
public static void initInstance(Context context, MeshChannel channel,LogLevel logLevel) {

    if (mSingleInstance == null) {

        mSingleInstance = new MeshLibraryManager(context, channel,logLevel);
        mSingleInstance.start();
    }
}

这是MeshLibraryManager.class

的构造函数
private MeshLibraryManager(Context context, MeshChannel channel,LogLevel lgLevel) {
    // Log message has a tag and a priority associated with it.
    logLevel= lgLevel;
    App.bus.register(this); // THIS IS WHERE I GET NoClassDefFoundError
    mContext = new WeakReference<Context>(context);
    mCurrentChannel = channel;
    Intent bindIntent = new Intent(mContext.get(), MeshService.class);
    context.bindService(bindIntent, mServiceConnection, Context.BIND_AUTO_CREATE);
}

以下是我获得的errorjar structure

的屏幕截图

如何摆脱这个错误?

0 个答案:

没有答案