简体   繁体   English

无法导入android.hardware.camera2.params.StreamConfiguration

[英]Can't import android.hardware.camera2.params.StreamConfiguration

  1. In Android API 21 they added android.hardware.camera2.params.StreamConfiguration but for some reason Android Studio can't find it. 他们在Android API 21中添加了android.hardware.camera2.params.StreamConfiguration但由于某些原因,Android Studio无法找到它。

  2. Also this class ( android.hardware.camera2.params.StreamConfigurationMap ) has a public constructor and yet it says I can't create an instance of it outside its package. 另外,此类( android.hardware.camera2.params.StreamConfigurationMap )具有公共构造函数,但它说我无法在其包之外创建其实例。 Why?! 为什么?!

Tried this: 试过这个:

StreamConfigurationMap map = new StreamConfigurationMap();  //Says can only be instantiated in its package
StreamConfiguration map = new StreamConfiguration();   //can't find StreamConfiguration

StreamConfigurationMap does not have a public constructor. StreamConfigurationMap没有公共的构造函数。

The android.hardware.camera2.params package does not expose the StreamConfiguration class. android.hardware.camera2.params包未公开StreamConfiguration类。 StreamConfigurationMap does allow you to use a StreamConfiguration to obtain a configuration- the configurations available are documented here . StreamConfigurationMap确实允许您使用StreamConfiguration来获取配置- 此处记录可用的配置。

The StreamConfiguration class and the StreamConfigurationMap constructor are hidden from the public Android API using the @hide annotation, so you cannot use them. 使用@hide注释从公共Android API中隐藏了StreamConfiguration类和StreamConfigurationMap构造函数,因此您不能使用它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我应该导入android.graphics.camera或android.hardware.camera吗? - Should I import android.graphics.camera or android.hardware.camera? 我们如何使用android硬件camera2创建后台相机服务 - How we can create a Background camera service using android hardware camera2 Android Volley忽略参数无法连接 - Android Volley ignoring params can't connect 如何检查android.hardware.Camera是否已发布? - How to check if android.hardware.Camera is released? 我无法导入或使用Android版AdView - I can't import or use AdView for android Torch / Flashlight应用程序(不推荐使用android.hardware.camera) - Torch / Flashlight app (android.hardware.camera is deprecated) Android Camera:尝试在空对象引用上的android.hardware.Camera.getParameters()'上调用虚拟方法Android Camera Parameters - Android Camera: Attempt to invoke virtual method Android Camera Parameters on android.hardware.Camera.getParameters()' on a null object reference 无法将.jar导入Eclipse Android项目 - Can't import .jar into Eclipse Android Project 无法在Android Studio中导入CardboardActivity? - Can't import CardboardActivity in Android Studio? Eclipse android 项目 - 无法导入库 - Eclipse android project - can't import libraries
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM