breautek commented on PR #1838: URL: https://github.com/apache/cordova-android/pull/1838#issuecomment-3224267122
I'm keeping this closed for now, because I don't really think removing `removeFirst` is a real solution, even though it may solve this particular instance of the problem. > java.lang.NoSuchMethodError: No static method removeFirst(Ljava/util/List;)Ljava/lang/Object; `java.util.List.removeFirst` as a static method was introduced in API 21. It's not referenced by Cordova directly, likely within the implementation of `LinkedList.removeFirst` instance method. The fact that a core API 1 API is using an JDK 21 API suggest that you may have your java source/target compatibility set to 21+... or it may just be enabled due to targeting API 35, which implies a desugaring issue. In my research I couldn't really find a concrete answer. Your android project should not be using anything higher than JDK 11, which is the default configuration the Android Studio uses when creating new android projects. There are multiple ways to configure the source/target JDK settings: - `AndroidJavaSourceCompatibility` / `AndroidJavaTargetCompatibility` - These preferences are undocumented, but would be recommended to remove these preferences if they are present in your `config.xml`. - Via [gradle arguments](https://cordova.apache.org/docs/en/dev/guide/platforms/android/index.html#configuring-gradle) using `-pJAVA_SOURCE_COMPATIBILITY` / `-pJAVA_TARGET_COMPATIBILITY` - Via hooks to manually manipulate the build gradle configs. Not to confuse Java Source & Target Compatibility settings with Android Compile & Target SDK which is something completely different. If you can, can you confirm that your project is configured to use JDK source/target compatibility 11? The fact that the codebase is trying to JDK 21 API is troublesome and if it's happening inside `removeFirst`, there may be other APIs also using JDK 21 and thus would run into similar situation, which is why there might be a broader issue here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
