出现错误:程序类型已经存在:org.objenesis.ObjenesisBase

时间:2019-09-24 08:30:44

标签: java android android-print-framework

我正在使用这两个库,并且相互冲突并得到错误:程序类型已存在:org.objenesis.ObjenesisBase此错误。我该如何解决此错误?

    implementation files('libs/lambdaj-2.4-with-dependencies.jar')
    implementation ('com.github.mazenrashed:Printooth:1.2.1')

为解决我在下面尝试过的问题,已成功编译

    implementation ('com.github.mazenrashed:Printooth:1.2.1'){
    exclude group: 'org.objenesis'
    }

当我尝试使用

    Printooth.INSTANCE.hasPairedPrinter()

我再次遇到错误

     java.lang.NoClassDefFoundError: Failed resolution of: Lsun/reflect/ReflectionFactory;
    at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.<init>(SunReflectionFactoryInstantiator.java:40)
    at org.objenesis.strategy.StdInstantiatorStrategy.newInstantiatorOf(StdInstantiatorStrategy.java:85)
    at com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy.newInstantiatorOf(Kryo.java:1323)
    at com.esotericsoftware.kryo.Kryo.newInstantiator(Kryo.java:1127)
    at com.esotericsoftware.kryo.Kryo.newInstance(Kryo.java:1136)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.create(FieldSerializer.java:562)
    at com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer.read(CompatibleFieldSerializer.java:71)
    at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:734)
    at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125)
    at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:543)
    at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:712)
    at io.paperdb.DbStoragePlainFile.readContent(DbStoragePlainFile.java:307)
    at io.paperdb.DbStoragePlainFile.readTableFile(DbStoragePlainFile.java:285)
    at io.paperdb.DbStoragePlainFile.select(DbStoragePlainFile.java:158)
    at io.paperdb.Book.read(Book.java:73)
    at com.mazenrashed.printooth.data.PairedPrinter$Companion.getPairedPrinter(PairedPrinter.kt:14)
    at com.mazenrashed.printooth.Printooth.hasPairedPrinter(Printooth.kt:58)
    at com.shapemore.btprinterdemo.MainActivity.onCreate(MainActivity.java:42)
    at android.app.Activity.performCreate(Activity.java:6666)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2677)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2789)
    at android.app.ActivityThread.-wrap12(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527)
    at android.os.Handler.dispatchMessage(Handler.java:110)

0 个答案:

没有答案