How to fix "Call requires API level 26 (current min is 25) " error in Android

Anna :

I know this question may be duplicated but I didn't find any answer for my problem, I'm using LocalDateTime in my Android app that requires API 26 and my device's API is 25.

What can I do? Your help will be very appreciated.

ישו אוהב אותך :

You need to use https://github.com/JakeWharton/ThreeTenABP to be able using LocalDateTime with Android API < 26.

Add the dependencies to your project (please follow the project README):

implementation 'com.jakewharton.threetenabp:threetenabp:1.2.1'

Then change your LocalDateTime import from:

import java.time.LocalDateTime;

to:

import org.threeten.bp.LocalDateTime;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=122463&siteId=1