Android `调用Class.forname时调用InvocationTargetException`
我正在使用以下代码:Android `调用Class.forname时调用InvocationTargetException`,android,reflection,invocationtargetexception,Android,Reflection,Invocationtargetexception,我正在使用以下代码: try { Class.forName("android.webkit.WebView") .getMethod("onPause", (Class[]) null) .invoke(myWebView, (Object[]) null); } catch (Exception cnfe) { cnfe.getCause(); Logger.ap
try {
Class.forName("android.webkit.WebView")
.getMethod("onPause", (Class[]) null)
.invoke(myWebView, (Object[]) null);
} catch (Exception cnfe) {
cnfe.getCause();
Logger.appendErrorLog(cnfe.getMessage(), TAG);
}
在执行上述代码时,我得到了
InvocationTargetException
。问题出在哪里?请检查您在pom.xml
中使用的依赖项。可能存在一些相互冲突的依赖项。确保它不是由任何依赖性引起的。发布stacktrace-没有它很难帮助。