gpt4 book ai didi

Android - Nougat 上的 IllegalAccessError

转载 作者:行者123 更新时间:2023-11-29 19:35:25 26 4
gpt4 key购买 nike

我的应用程序在 5+ 和 6+ 上完美运行,但在 7 上却不行。当应用程序尝试登录服务器时抛出此异常:

09-01 09:52:53.821 2654-2718/com.pipodi.italiansubsmobileclient E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #1
Process: com.pipodi.italiansubsmobileclient, PID: 2654
java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:318)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:761)
Caused by: java.lang.IllegalAccessError: Method 'void org.jdom2.ContentList.sort(java.util.Comparator)' implementing interface method 'void java.util.List.sort(java.util.Comparator)' is not public (declaration of 'org.jdom2.ContentList' appears in /data/data/com.pipodi.italiansubsmobileclient/files/instant-run/dex/slice-jdom-2.0.5_82fed81e6dd7ad54ef864ead3d2cf112380d9d58-classes.dex)
at dalvik.system.DexFile.defineClassNative(Native Method)
at dalvik.system.DexFile.defineClass(DexFile.java:299)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:292)
at dalvik.system.DexPathList.findClass(DexPathList.java:418)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
at com.android.tools.fd.runtime.IncrementalClassLoader$DelegateClassLoader.findClass(IncrementalClassLoader.java:90)
at com.android.tools.fd.runtime.IncrementalClassLoader.findClass(IncrementalClassLoader.java:62)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:367)
at java.lang.ClassLoader.loadClass(ClassLoader.java:367)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at org.jdom2.Document.<init>(Document.java:83)
at org.jdom2.Document.<init>(Document.java:154)
at org.jdom2.DefaultJDOMFactory.document(DefaultJDOMFactory.java:190)
at org.jdom2.input.sax.SAXHandler.reset(SAXHandler.java:228)
at org.jdom2.input.sax.SAXHandler.<init>(SAXHandler.java:208)
at org.jdom2.input.sax.DefaultSAXHandlerFactory$DefaultSAXHandler.<init>(DefaultSAXHandlerFactory.java:76)
at org.jdom2.input.sax.DefaultSAXHandlerFactory.createSAXHandler(DefaultSAXHandlerFactory.java:82)
at org.jdom2.input.SAXBuilder.buildEngine(SAXBuilder.java:848)
at org.jdom2.input.SAXBuilder.getEngine(SAXBuilder.java:904)
at org.jdom2.input.SAXBuilder.build(SAXBuilder.java:1091)
at com.pipodi.italiansubsmobileclient.connections.Connection.connectToAPIURL(Connection.java:20)
at com.pipodi.italiansubsmobileclient.connections.LoginVariables.getAuthCode(LoginVariables.java:39)
at com.pipodi.italiansubsmobileclient.connections.ItaSALogin.doInBackground(ItaSALogin.java:69)
at com.pipodi.italiansubsmobileclient.connections.ItaSALogin.doInBackground(ItaSALogin.java:38)
at android.os.AsyncTask$2.call(AsyncTask.java:304)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 
at java.lang.Thread.run(Thread.java:761) 

我已经在我的模拟器上试过了,总是在 Nougat 上崩溃,但在任何以前版本的 Android 上都没有崩溃。

他们是否在分子水平上改变了什么?

这是抛出异常的类:

public class Connection extends Thread {

public static Document connectToAPIURL(String url, Context context) {
try {
Log.i("URLApi", url);
if (checkInternetConnection(context)) {
return new SAXBuilder().build(HTTPS.getInstance().connection(url));
}
} catch (Exception e) {
e.printStackTrace();
return null;
}
return null;
}

public static boolean checkInternetConnection(Context context) {
ConnectivityManager conMgr = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = conMgr.getActiveNetworkInfo();
if (activeNetwork != null && activeNetwork.isConnected()) {
return true;
}
return false;
}

你能帮我解决这个问题吗?

谢谢!

最佳答案

我遇到了同样的问题。升级到 JDOM 2.0.6 即可解决问题。

来自 JDOM 发行说明:“修复问题 129 - Java 8 在 List 接口(interface)上引入了公共(public)排序方法。这与 ContentList 上的 protected 排序冲突”

关于Android - Nougat 上的 IllegalAccessError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39268486/

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