Android L Developer Preview包丢失了吗? [英] Android L Developer Preview packages missing?
问题描述
我正在尝试使用Android L Developer Preview SDK,特别是Bluetooth Low Energy类.我设置了compileSdkVersion 'android-L'
,minSdkVersion 'L'
和targetSdkVersion 'L'
.我可以在外部库"下看到L平台SDK,但是当我去查看android.jar中的内容时,缺少android.bluetooth.le包.因此,我不能使用任何Bluetooth LE类,例如BluetoothLeScanner和ScanCallback.有人知道如何解决这个问题吗?
I'm trying to use the Android L Developer Preview SDK, specifically the Bluetooth Low Energy classes. I set compileSdkVersion 'android-L'
, minSdkVersion 'L'
, and targetSdkVersion 'L'
. I can see the L platform SDK under "External Libraries", but when I go to see what is inside the android.jar, the android.bluetooth.le package is missing. Thus, I cannot use any of the Bluetooth LE classes such as BluetoothLeScanner and ScanCallback. Does anyone know how to fix this?
推荐答案
我想这是Android Studio中的一个错误(也有一些其他API对此有报道)...
I would guess this is a bug in Android Studio (there are some other APIs for which this has been reported too)...
如果您编写类似这样的内容:
If you write something like:
BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();
android.bluetooth.le.BluetoothLeScanner scanner = adapter.getBluetoothLeScanner();
然后在Android Studio中确实将其报告为错误.但是,使用gradlew build
时,它可以构建正常.
then this is indeed reported as an error in Android Studio. However, it does build ok when using gradlew build
.
简而言之,您可以使用它,但这确实很尴尬.我希望这个问题会尽快解决.
In short, you can use it, but it's really awkward. I hope this will be fixed soon.
这篇关于Android L Developer Preview包丢失了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!