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

App not working for android < 26. #5

Closed
raghavpai opened this issue May 8, 2021 · 5 comments
Closed

App not working for android < 26. #5

raghavpai opened this issue May 8, 2021 · 5 comments

Comments

@raghavpai
Copy link

raghavpai commented May 8, 2021

dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.0.9")
}

compileOptions {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
    // Flag to enable support for the new language APIs
    isCoreLibraryDesugaringEnabled = true
}


This is necessary as the app crashes in lower API versions due to as per https://developer.android.com/studio/write/java8-support#library-desugaring

java.lang.NoClassDefFoundError: Failed resolution of: Ljava/time/Instant;
at kotlinx.datetime.Instant.<clinit>(Instant.kt:93)
at kotlinx.datetime.Clock$System.now(Clock.kt:17)

Due to GetCountriesList.kt
Line 13 -> val nowUnixtime = Clock.System.now().epochSeconds
@dbaroncelli
Copy link
Owner

Hi @raghavpai, which of these 3 Android API settings are you referring to?

  • compileSdk
  • minSdk
  • targetSdk

@dbaroncelli
Copy link
Owner

minSdk is set to 21, as this is the requirement for JetpackCompose.
compileSdk and targetSdk are set to the latest (30). Not sure what's the reason you would like to compile or target a lower API.

@raghavpai
Copy link
Author

raghavpai commented May 8, 2021

When you try to use the App in my case I am using Lollipop android version .....I am getting runtime exception....You can try the APP in lower android version (<26 API version)devices.

@raghavpai
Copy link
Author

minSdk is set to 21, as this is the requirement for JetpackCompose.
compileSdk and targetSdk are set to the latest (30). Not sure what's the reason you would like to compile or target a lower API.

No issues here this is fine.

@dbaroncelli
Copy link
Owner

Thanks for pointing this out.
I wasn't aware of this crashing for devices below API 26.
I have now pushed an update.

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