Do you use any self-hosted service which uses a self-signed certificate? Android is behind the Java development. Eugene Kartoyev Eugene Kartoyev 4 4 silver badges 9 9 bronze badges. Shawon Barua Shawon Barua 33 9 9 bronze badges.
Can we use JDK 11? Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Podcast Quality code is the easiest to delete. Upcoming Events.
Featured on Meta. Now live: A fully responsive profile. Candidate changes in Moderator Election — review your ballot. Viewed 23k times. The error is: Could not find method java. Improve this question.
Andreas Andreas 7, 6 6 gold badges 38 38 silver badges 80 80 bronze badges. Add a comment. Active Oldest Votes. Is there an overview which clearly shows which Android versions come with which Java version In terms of language features e. Improve this answer. CommonsWare CommonsWare k gold badges silver badges bronze badges. So how can I make sure the Java code works on older Android versions too? That's a little disturbing. Andreas: "So how can I make sure the Java code works on older Android versions too?
Plus, have thorough test suites. Well, but minSdkVersion is set to 14 in my build. Andreas: Sure. You're not referencing ReflectiveOperationException directly, so there is nothing for Lint to complain about. It would appear that there is some bug in your particular device that you're tripping over, because somebody didn't expect you to be doing what you're doing.
This will happen when you try to use reflection to access things outside of the Android SDK. This answer refers to Dalvik in the context of the bytecode format, which is still used. Show 2 more comments. Sign up or log in Sign up using Google. Sign up using Facebook. Note: When developing apps for Android, using Java 8 language features is optional. You can keep your project's source and target compatibility values set to Java 7, but you still need to compile using JDK 8.
The Android Gradle plugin provides built-in support for using certain Java 8 language features and third-party libraries that use them. Figure 1. Java 8 language feature support using desugar bytecode transformations. To start using supported Java 8 language features, update the Android plugin to 3. After that, for each module that uses Java 8 language features either in its source code or through dependencies , update the module's build. When building your app using Android Gradle plugin 3.
The following language features are now available on any API level:. In addition to the Java 8 language features above, plugin versions 3. Desugar currently doesn't support MethodHandle. If your source code or one of your module dependencies use one of these methods you need to specify minSdkVersion 26 or higher. Otherwise, you get the following error:. In some cases, your module may not be using the invoke or invokeExact methods even when they're included in a library dependency.
So, to keep using that library with minSdkVersion 25 or lower, enable code shrinking to remove unused methods. If that doesn't work, consider using an alternative library that doesn't use the unsupported methods. If you're building your app using Android Gradle plugin 4. This additional support for older platform versions is possible because plugin 4.
0コメント