batoulapps / adhan-kotlin

High precision Islamic prayer time library for Java
MIT License
157 stars 47 forks source link

version 1.2.0 on Maven Central shouldn't require Java 11 #28

Closed ahmedre closed 3 years ago

ahmedre commented 3 years ago

a bit too late to fix this now for 1.2.0 itself, but should fix this in 1.2.1 to make sure it requires java 8 and above instead of java 11 and above (though it's not an unreasonable stretch given that the latest Canary Android Studio requires Java 11 for builds anyhow and anyone working on a server or desktop environment shouldn't use such old versions of Java anyway).

mobile/prayertimes/core/PrayerTimesFinderKt.java:9: error: cannot access Prayer
    private static final mobile.prayertimes.core.Prayer toPrayer(com.batoulapps.adhan.Prayer $this$toPrayer) {
                                                                                                ^
  bad class file: /root/.gradle/caches/transforms-3/19b789d3a98be555dc1399d0c9ec80ba/transformed/jetified-adhan-1.2.0.jar(com/batoulapps/adhan/Prayer.class)
    class file has wrong version 55.0, should be 52.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.

two workarounds for people hitting this in the meanwhile:

  1. recommended approach - update to Java 11 or above.
  2. alternative approach - use the version on jcenter (exact same, but shouldn't have this problem) - this solution will only work until jcenter goes down next year. you can use the jcenter version by doing:
maven {
    url "https://dl.bintray.com/batoulapps/adhan"       
 }
freehussain commented 3 years ago

hello,

i have the same issue here, the second workaround doesn't work, but how to update to java 11

ahmedre commented 3 years ago

for the second workaround, try it again (adding those 3 lines in your main build.gradle, and then do a ./gradlew --refresh-dependencies.

for the first one, just install java 11 on your machine and set it as the default jdk and build with it.

ahmedre commented 3 years ago

i pushed 1.2.1 that should fix this now.