A note of what I was addicted to when using registerTorchCallback
A method that can be used only at API level 23 (Android6) or later.
Since I originally created a project that can support up to Android 5.1 (API level 22), "There is a terminal that can support the method you are trying to use and the API level that you set. Please fix it. If you're Nao, don't build it. "
When I read it again, it says, "Write the minimum API level you want to support
First, write the following in the manifest file.
AndroidManifest.xml
<uses-sdk minSdkVersion="23" />
The error does not go away even if I execute it. An error occurs again "Write minSdkVersion in the manifest file. After all, overwrite from the gradle file"
Say that from the beginning! So, when I checked the build.gradle (module: app), I found the following description. Was this a mess?
build.gradle(module_app)
android{
...
defaultConfig{
minSdkVersion 22//← Corrected to 23
...
}
}
After the correction, the error disappeared when the item was deleted from the manifest file. However, it is compatible with Android 6 and earlier. Well for personal use.
https://developer.android.com/reference/android/hardware/camera2/CameraManager.TorchCallback.html
Recommended Posts