Skip to content

[Camera Plugin] should be installable on api 16+ even if it will not work #30854

@jaumard

Description

@jaumard

I saw that issue that is to make camera plugin compatible with api 16 and more #19083

My use case is a bit different and maybe easier to fix.

My app is compatible android 16+ and I need camera for a small feature. So I want to provide this feature only for android 21+. Problem is that the camera plugin doesn't allow me to compile and android 16 at all.

It should allow me to install it. As there will be no problem until I use it, which will be not the case as I'll check the android version to prevent this feature.

For now I'm getting:

04-10 16:03:52.714 3013-3013/com.jaumard.test W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/hardware/camera2/CameraManager;)
04-10 16:03:52.714 3013-3013/com.jaumard.test E/dalvikvm: Could not find class 'android.hardware.camera2.CameraManager', referenced from method io.flutter.plugins.camera.CameraPlugin.registerWith
04-10 16:03:52.714 3013-3013/com.jaumard.test W/dalvikvm: VFY: unable to resolve check-cast 227 (Landroid/hardware/camera2/CameraManager;) in Lio/flutter/plugins/camera/CameraPlugin;
04-10 16:03:52.714 3013-3013/com.jaumard.test D/dalvikvm: VFY: replacing opcode 0x1f at 0x001c
04-10 16:03:52.714 3013-3013/com.jaumard.test W/dalvikvm: VFY: unable to resolve exception class 219 (Landroid/hardware/camera2/CameraAccessException;)
04-10 16:03:52.714 3013-3013/com.jaumard.test W/dalvikvm: VFY: unable to find exception handler at addr 0x9b
04-10 16:03:52.714 3013-3013/com.jaumard.test W/dalvikvm: VFY:  rejected Lio/flutter/plugins/camera/CameraPlugin;.onMethodCall (Lio/flutter/plugin/common/MethodCall;Lio/flutter/plugin/common/MethodChannel$Result;)V
04-10 16:03:52.714 3013-3013/com.jaumard.test W/dalvikvm: VFY:  rejecting opcode 0x0d at 0x009b
04-10 16:03:52.714 3013-3013/com.jaumard.test W/dalvikvm: VFY:  rejected Lio/flutter/plugins/camera/CameraPlugin;.onMethodCall (Lio/flutter/plugin/common/MethodCall;Lio/flutter/plugin/common/MethodChannel$Result;)V
04-10 16:03:52.714 3013-3013/com.jaumard.test W/dalvikvm: Verifier rejected class Lio/flutter/plugins/camera/CameraPlugin;

If someone can tell me how fix this or what to change on the camera plugin I can do a PR for that.

[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.14.4 18E226, locale fr-FR)
    • Flutter version 1.2.1 at /Users/jaumard/flutter
    • Framework revision 8661d8aecd (8 weeks ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/jaumard/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2, Build version 10E125
    • ios-deploy 1.9.4
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 34.0.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2018.3.4)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 32.0.3
    • Dart plugin version 183.5429.25

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions