在使用Android studio导入eclipse工程师报错,因为原工程引用了greendao的第三方工程包

java.lang.NoClassDefFoundError: org.greenrobot.greendao.database.StandardDatabase
at org.greenrobot.greendao.database.DatabaseOpenHelper.wrap(DatabaseOpenHelper.java:70)
......

网上说是在android5.0以下的系统版本就会报出这类错,解决办法即引入multidex的jar包即可:

compile 'com.android.support:multidex:1.0.1'

并在Application类中设置

public class App extends MultiDexApplication {

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }
}

重新build,问题解决

 

相关文章:

  • 2021-11-23
  • 2021-08-27
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2021-11-18
猜你喜欢
  • 2021-10-05
  • 2022-01-08
  • 2021-07-20
  • 2022-01-11
  • 2021-06-29
  • 2021-08-23
  • 2022-12-23
相关资源
相似解决方案