NativeScript / plugins

@nativescript plugins to help with your developments.
https://docs.nativescript.org/plugins/index.html
Apache License 2.0
187 stars 104 forks source link

Build failure for latest @nativescript/background-http v6.0.1 #567

Open joshcomley opened 5 months ago

joshcomley commented 5 months ago

When updating to the latest version of background-http I am receiving the following build error:

D:\code\SafeSite\mobile\code\apps\nativescript-safesite\platforms\android\app\src\main\java\com\tns\gen\net\gotev\uploadservice\observer\request\RequestObserverDelegate.java:10: error: cannot access RequestObserverDelegate
        net.gotev.uploadservice.observer.request.RequestObserverDelegate {
                                                ^
  bad class file: C:\Users\joshc\.gradle\caches\transforms-3\6c21abdd05e63a95e1d98494741b42e0\transformed\jetified-uploadservice-4.9.2-api.jar(/net/gotev/uploadservice/observer/request/RequestObserverDelegate.class)
    class file has wrong version 61.0, should be 55.0       
    Please remove or make sure it appears in the correct subdirectory of the classpath.
D:\code\SafeSite\mobile\code\apps\nativescript-safesite\platforms\android\app\src\main\java\com\tns\gen\net\gotev\uploadservice\observer\request\RequestObserverDelegate.java:17: error: cannot access UploadInfo
      android.content.Context param_0, net.gotev.uploadservice.data.UploadInfo param_1) {

       ^
  bad class file: C:\Users\joshc\.gradle\caches\transforms-3\6c21abdd05e63a95e1d98494741b42e0\transformed\jetified-uploadservice-4.9.2-api.jar(/net/gotev/uploadservice/data/UploadInfo.class)
    class file has wrong version 61.0, should be 55.0       
    Please remove or make sure it appears in the correct subdirectory of the classpath.
D:\code\SafeSite\mobile\code\apps\nativescript-safesite\platforms\android\app\src\main\java\com\tns\gen\net\gotev\uploadservice\observer\request\RequestObserverDelegate.java:27: error: cannot access ServerResponse
      net.gotev.uploadservice.network.ServerResponse param_2) {
                                     ^
  bad class file: C:\Users\joshc\.gradle\caches\transforms-3\6c21abdd05e63a95e1d98494741b42e0\transformed\jetified-uploadservice-4.9.2-api.jar(/net/gotev/uploadservice/network/ServerResponse.class)
    class file has wrong version 61.0, should be 55.0       
    Please remove or make sure it appears in the correct subdirectory of the classpath.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors

I can work around this by forcing the uploadServiceVersion to 4.7.0 in before-plugins.gradle:

uploadServiceVersion = "4.7.0"

I am using latest NativeScript v8.6.5 on an Angular project.

To trigger the error, simple use the service in a project created by the latest version of NativeScript.

Thanks!

FerhatKoca commented 5 months ago

Having the same issue

henrychavez commented 5 months ago

Same here but the workaround works!

pavliczandris commented 4 months ago

Which java version are you using? For me, the problem was resolved by updating to JDK 17 from JDK 11

jokkopp commented 3 months ago

Same over here too but the 6.0.0 works fine