Skip to content

camera_utils: 0.1.8 : Android X Compatibility issue #6

@pacifire

Description

@pacifire

When i add camera_utils: 0.1.8, to pubspec.yaml it throws the below error:

Launching lib/main.dart on SM G925I in debug mode...
/Users/pawanshahani/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/camera_utils-0.1.8/android/src/main/java/com/aeologic/camerautils/CameraUtilsPlugin.java:15: error: package android.support.v4.content does not exist
import android.support.v4.content.FileProvider;
                                 ^
/Users/pawanshahani/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/camera_utils-0.1.8/android/src/main/java/com/aeologic/camerautils/CameraUtilsPlugin.java:198: error: cannot find symbol
            uri = FileProvider.getUriForFile(activity, activity.getPackageName() + ".flutter.provider", mediaFile);
                  ^
  symbol:   variable FileProvider
  location: class CameraUtilsPlugin
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':camera_utils:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 52s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin camera_utils...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'camera_utils'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 22s
Exception: The plugin camera_utils could not be built due to the issue above.
Exited (sigterm)

Flutter Doctor goes as below:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.20.0, on Mac OS X 10.15.3 19D76, locale en-IN)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
 
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Android Studio (version 3.6)
[✓] VS Code (version 1.47.3)
[✓] Connected device (1 available)

• 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