Where is java.time in Android Studio 3.0?

前端 未结 1 1552
悲&欢浪女
悲&欢浪女 2020-12-20 01:46

According to Android Studio documentation:

Android Studio 3.0 introduces built-in support for Java 8 libraries

But a huge impro

相关标签:
1条回答
  • 2020-12-20 02:36

    To get Java 8 language feature support running in Android Studio, check these four things:

    1. Make sure you are running the latest version of Android Studio 3.0

    2. Ensure you are using the embedded JDK

    3. Update your the source and target compatibility versions to 1.8 in your project structure.

    4. Ensure you minSdkVersion is 24 (or 26/'O' depending on which method you want to use in the class)

    Once your project complies with those settings, you can add libraries such as: import java.time.LocalDateTime; to your project. Check out this page for more information: https://developer.android.com/studio/preview/features/java8-support.html

    0 讨论(0)
提交回复
热议问题