夜封雪 2021-04-19 17:45 采纳率: 0%
浏览 95

java.lang.NoClassDefFoundErro

第三方jar引用Character.UnicodeScript,androi.jar和jdk都有这个方法,理论上,第三方jar应该使用的是jdk里的Character.UnicodeScript,但我在studio中使用第三方jar时,可能调用了android.jar里的Character.UnicodeScript。在运行的时候报错java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/Character$UnicodeScript;

 

具体报错如下:

    java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/Character$UnicodeScript;
        at com.itextpdf.layout.renderer.TextRenderer.applyOtf(TextRenderer.java:607)
        at com.itextpdf.layout.renderer.LineRenderer.applyOtf(LineRenderer.java:1240)
        at com.itextpdf.layout.renderer.LineRenderer.layout(LineRenderer.java:162)
        at com.itextpdf.layout.renderer.ParagraphRenderer.directLayout(ParagraphRenderer.java:225)
        at com.itextpdf.layout.renderer.ParagraphRenderer.layout(ParagraphRenderer.java:110)
        at com.itextpdf.layout.renderer.RootRenderer.addChild(RootRenderer.java:136)
        at com.itextpdf.layout.RootElement.createAndAddRendererSubTree(RootElement.java:377)
        at com.itextpdf.layout.RootElement.add(RootElement.java:106)
        at com.itextpdf.layout.Document.add(Document.java:160)
        at com.cq.androidtools.pdf.PDFActivity.onShow(PDFActivity.kt:40)
        at com.cq.androidtools.pdf.PDFActivity.onCreate(PDFActivity.kt:22)
        at android.app.Activity.performCreate(Activity.java:5990)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
        at android.app.ActivityThread.access$800(ActivityThread.java:151)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5254)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "java.lang.Character$UnicodeScript" on path: DexPathList[[zip file "/data/app/com.cq.androidtools-1/base.apk"],nativeLibraryDirectories=[/data/app/com.cq.androidtools-1/lib/x86, /vendor/lib, /system/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
        at com.itextpdf.layout.renderer.TextRenderer.applyOtf(TextRenderer.java:607) 
        at com.itextpdf.layout.renderer.LineRenderer.applyOtf(LineRenderer.java:1240) 
        at com.itextpdf.layout.renderer.LineRenderer.layout(LineRenderer.java:162) 
        at com.itextpdf.layout.renderer.ParagraphRenderer.directLayout(ParagraphRenderer.java:225) 
        at com.itextpdf.layout.renderer.ParagraphRenderer.layout(ParagraphRenderer.java:110) 
        at com.itextpdf.layout.renderer.RootRenderer.addChild(RootRenderer.java:136) 
        at com.itextpdf.layout.RootElement.createAndAddRendererSubTree(RootElement.java:377) 
        at com.itextpdf.layout.RootElement.add(RootElement.java:106) 
        at com.itextpdf.layout.Document.add(Document.java:160) 
        at com.cq.androidtools.pdf.PDFActivity.onShow(PDFActivity.kt:40) 
        at com.cq.androidtools.pdf.PDFActivity.onCreate(PDFActivity.kt:22) 
        at android.app.Activity.performCreate(Activity.java:5990) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) 
        at android.app.ActivityThread.access$800(ActivityThread.java:151) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.app.ActivityThread.main(ActivityThread.java:5254) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) 
    	Suppressed: java.lang.ClassNotFoundException: java.lang.Character$UnicodeScript
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        		... 25 more
     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

求大佬告知如何解决或者思路,感谢

  • 写回答

1条回答 默认 最新

  • 阿部春光 2024-04-28 23:38
    关注

    是不是可以指定类的包名,把路径写全去引用。

    评论

报告相同问题?

悬赏问题

  • ¥15 求京东批量付款能替代天诚
  • ¥15 slaris 系统断电后,重新开机后一直自动重启
  • ¥15 51寻迹小车定点寻迹
  • ¥15 谁能帮我看看这拒稿理由啥意思啊阿啊
  • ¥15 关于vue2中methods使用call修改this指向的问题
  • ¥15 idea自动补全键位冲突
  • ¥15 请教一下写代码,代码好难
  • ¥15 iis10中如何阻止别人网站重定向到我的网站
  • ¥15 滑块验证码移动速度不一致问题
  • ¥15 Utunbu中vscode下cern root工作台中写的程序root的头文件无法包含