如何安装Android SDK平台工具24.0.0?

时间:2022-10-05 17:02:15

I'm following the guide for setting up the Android N Preview https://developer.android.com/preview/setup-sdk.html

我正在遵循安装Android N预览的指南:https://developer.android.com/preview/setup-sdk.html

In "Update or Create a Project" Google says I need to have 24.0.0 platform tools.

在“更新或创建项目”谷歌中,我需要有24.0.0平台工具。

Just be sure that you've updated your project to use Android SDK Build Tools 24.0.0 and Android SDK Platform-Tools 24.0.0.

请确保您已经更新了您的项目以使用Android SDK构建工具24.0.0和Android SDK平台工具24.0.0。

I have installed the new SDK Platform: Android 6.X (N), API Level 24, Revision 1. However when I open SDK Tools the only Android SDK Platform-Tools version is 23.1.

我安装了新的SDK平台:Android 6。X (N), API级别24,修订1。但是,当我打开SDK工具时,唯一的Android SDK平台工具版本是23.1。

如何安装Android SDK平台工具24.0.0?

I have updated my build.gradle for Android 24 and for Jack and Java 8 (see).

我已经更新了我的构建。Android 24和Jack和Java 8的等级(见)。

Everything works great on Android 24 simulator but crashes on a device or simulator running Android 22/23 (less than 24) with the following error:

在Android 24模拟器上一切都很好,但在运行Android 22/23(小于24)的设备或模拟器上崩溃,出现以下错误:

java.lang.NoSuchMethodError: No virtual method stream()Ljava/util/stream/Stream; in class Ljava/util/ArrayList; or its super classes (declaration of 'java.util.ArrayList' appears in /system/framework/core-libart.jar)

. lang。NoSuchMethodError:没有虚拟方法流()Ljava/util/stream/ stream;在课堂上Ljava / util / ArrayList;或者它的超类(“java.util”声明)。ArrayList的出现在/系统/框架/ core-libart.jar)

I suspect the cause is having SDK Platform-Tools version 23.1.0 instead of 24.0.0 but if there is another solution i'd be happy to hear it.

我怀疑原因是SDK平台工具版本23.1.0而不是24.0.0,但如果有其他解决方案,我很乐意听到。

Edit

Installing platform tools 24.0.0 rc1 did not fix the crash. I'm not sure what else to try given that I have followed all the instructions to setup the preview and the Jack compiler.

安装平台工具24.0.0 rc1并没有修复崩溃。我不确定还有什么可尝试的,因为我已经按照所有的指示设置了预览和杰克编译器。

4 个解决方案

#1


4  

but crashes on a device or simulator running Android 22/23 (less than 24) with the following error

但在运行Android 22/23(小于24)的设备或模拟器上出现以下错误时,会发生崩溃。

java.util.stream.Stream was added in API Level 24. This class cannot be used on older devices.

java.util.stream。在API级别24中添加了流。这个类不能在旧设备上使用。

Certain Java 8 features, like lambda expressions, may work on older devices, but not classes that were introduced in Android N.

某些Java 8特性,如lambda表达式,可能适用于较旧的设备,但不适用于Android N中引入的类。

#2


2  

Just select the show package details and then you can find all the versions. Refer to the attached image

只需选择show package details,然后您就可以找到所有的版本。参考所附图像

如何安装Android SDK平台工具24.0.0?

#3


0  

Asuming you have Android Studio 2.1

你有Android Studio 2.1

Launch the standalone SDK manager.

启动独立SDK管理器。

From there Android N API 24 should be available to install

从那里Android N API 24应该可以安装

#4


0  

Your API level 24 app runs OK with Android 24 (virtual) device but doesn't work with pre-24 device - so everything is exactly as one would expect.

你的API级别24的应用程序可以运行Android 24(虚拟)设备,但不能使用前24设备——所以一切都和预期的一样。

#1


4  

but crashes on a device or simulator running Android 22/23 (less than 24) with the following error

但在运行Android 22/23(小于24)的设备或模拟器上出现以下错误时,会发生崩溃。

java.util.stream.Stream was added in API Level 24. This class cannot be used on older devices.

java.util.stream。在API级别24中添加了流。这个类不能在旧设备上使用。

Certain Java 8 features, like lambda expressions, may work on older devices, but not classes that were introduced in Android N.

某些Java 8特性,如lambda表达式,可能适用于较旧的设备,但不适用于Android N中引入的类。

#2


2  

Just select the show package details and then you can find all the versions. Refer to the attached image

只需选择show package details,然后您就可以找到所有的版本。参考所附图像

如何安装Android SDK平台工具24.0.0?

#3


0  

Asuming you have Android Studio 2.1

你有Android Studio 2.1

Launch the standalone SDK manager.

启动独立SDK管理器。

From there Android N API 24 should be available to install

从那里Android N API 24应该可以安装

#4


0  

Your API level 24 app runs OK with Android 24 (virtual) device but doesn't work with pre-24 device - so everything is exactly as one would expect.

你的API级别24的应用程序可以运行Android 24(虚拟)设备,但不能使用前24设备——所以一切都和预期的一样。