gpt4 book ai didi

外部 jar 库上的 JAVA NoClassDefFoundError

转载 作者:行者123 更新时间:2023-12-02 04:41:52 26 4
gpt4 key购买 nike

我正在使用 thisJAVA 中编写 Android 应用程序用于格式化电话号码的库。我收到以下异常:

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/i18n/phonenumbers/PhoneNumberUtil;

这里:

public class InvocationTargetException extends ReflectiveOperationException  {
...
public InvocationTargetException(Throwable exception) {
super(null, exception);
target = exception;
}
...
}

执行命令时:

PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();

我已导入 com.google.i18n.phonenumbers 库,但我无法弄清楚异常描述中的 L 是什么。

最佳答案

L 是为内部 JVM objectype 表示而添加的,但它实际上是在寻找 com/google/i18n/phonenumbers/PhoneNumberUtil 类。

您的运行时类路径中似乎缺少该库。

Field Descriptions Documentation.

关于外部 jar 库上的 JAVA NoClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30086013/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com