Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 5.1 java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/Duration; #666

Open
YanYangTan opened this issue Aug 30, 2024 · 13 comments

Comments

@YanYangTan
Copy link

popup java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/Duration;
when I use upload FTP

@gotev
Copy link
Owner

gotev commented Aug 30, 2024

Please provide also the information requested in the issue template, at least the library version used

@YanYangTan
Copy link
Author

YanYangTan commented Aug 30, 2024

version 4.9.2, I change to 4.8.0 its solve , compileSdk 34
but For Android 14 version 4.8.0 pop another Error

@YanYangTan
Copy link
Author

Error: java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/Duration;
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/Duration;
at org.apache.commons.net.ftp.FTPClient.(FTPClient.java:545)
at net.gotev.uploadservice.ftp.FTPClientWrapper.(FTPClientWrapper.kt:54)
at net.gotev.uploadservice.ftp.FTPUploadTask.upload(FTPUploadTask.kt:23)
at net.gotev.uploadservice.UploadTask.run(UploadTask.kt:144)
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.ClassNotFoundException: Didn't find class "java.time.Duration" on path: DexPathList[[zip file "/data/app/com.itunicode.sqlmpos.Sunmi.debug-1/base.apk"],nativeLibraryDirectories=[/data/app/com.itunicode.sqlmpos.Sunmi.debug-1/lib/arm, /data/app/com.itunicode.sqlmpos.Sunmi.debug-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at org.apache.commons.net.ftp.FTPClient.(FTPClient.java:545) 
at net.gotev.uploadservice.ftp.FTPClientWrapper.(FTPClientWrapper.kt:54) 
at net.gotev.uploadservice.ftp.FTPUploadTask.upload(FTPUploadTask.kt:23) 
at net.gotev.uploadservice.UploadTask.run(UploadTask.kt:144) 
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) 

@YanYangTan
Copy link
Author

And For Android 14 version 4.8.0 will pop Error:
FATAL EXCEPTION: main
Process: com.itunicode.sqlmpos.debug, PID: 14476
java.lang.SecurityException: com.itunicode.sqlmpos.debug: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts
at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
at android.os.Parcel.createException(Parcel.java:3041)
at android.os.Parcel.readException(Parcel.java:3024)
at android.os.Parcel.readException(Parcel.java:2966)
at android.app.IActivityManager$Stub$Proxy.registerReceiverWithFeature(IActivityManager.java:6192)
at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1863)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1803)
at android.app.ContextImpl.registerReceiver(ContextImpl.java:1791)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:766)
at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:766)
at net.gotev.uploadservice.observer.request.BaseRequestObserver.register(BaseRequestObserver.kt:36)
at net.gotev.uploadservice.observer.request.RequestObserver.register(RequestObserver.kt:30)
at net.gotev.uploadservice.observer.request.RequestObserver_LifecycleAdapter.callMethods(RequestObserver_LifecycleAdapter.java:25)
at androidx.lifecycle.SingleGeneratedAdapterObserver.onStateChanged(SingleGeneratedAdapterObserver.kt:22)

@YanYangTan
Copy link
Author

Any details you need more ?

@YanYangTan
Copy link
Author

java.time.Duration
this library maybe cannot use in andoird 5 and below

@gotev
Copy link
Owner

gotev commented Aug 30, 2024

Do you have errors on Android 14 with the latest 4.9.2?

@YanYangTan
Copy link
Author

YanYangTan commented Aug 31, 2024

no errors , Android 14 with the latest 4.9.2 is fine, but low version cannot

@YanYangTan
Copy link
Author

I think just change the java.time.Duration this class usage, will fix .

@YanYangTan
Copy link
Author

YanYangTan commented Sep 2, 2024

any updates , need help for develop?

@YanYangTan
Copy link
Author

inside you use https://commons.apache.org/proper/commons-net/javadocs/api-1.4.1/org/apache/commons/net/ftp/FTPClient.html
this right? I test it in android low version also popup error

@gotev
Copy link
Owner

gotev commented Oct 10, 2024

That part is a dependency of the FTP module and it's not used in the core library. From what I read, with 4.9.2 you're not experiencing any errors on Android 14. The problems you are reporting do happen only on Android 13 or also lower versions?

@YanYangTan
Copy link
Author

I didnt tried Android 13, but no error on Android 14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants