1

I am getting an error after using the file picker package. I searched about this a lot and still can't able to solve the problem. I tried flutter clean also but it also doesn't work.

The error is below: {

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:processDebugResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource linking failed F:\flutter\bit_sms\build\pfile_picker\intermediates\library_manifest\debug\AndroidManifest.xml:9:5-15:15: AAPT: error: unexpected element found in .

  • 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 1m 10s The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility. Building plugin contacts_service... √ Built build\app\outputs\repo. Building plugin flutter_plugin_android_lifecycle... C:\src\flutter\flutter.pub-cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecycle-2.0.0\android\src\main\java\io\flutter\embedding\engine\plugins\lifecycle\FlutterLifecycleAdapter.java:8: error: package androidx.lifecycle does not exist import androidx.lifecycle.Lifecycle; ^ C:\src\flutter\flutter.pub-cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecycle-2.0.0\android\src\main\java\io\flutter\embedding\engine\plugins\lifecycle\FlutterLifecycleAdapter.java:22: error: cannot find symbol public static Lifecycle getActivityLifecycle( ^ symbol: class Lifecycle location: class FlutterLifecycleAdapter 2 errors

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':compileReleaseJavaWithJavac'.

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 5s

Exception: The plugin flutter_plugin_android_lifecycle could not be built due to the issue above. Exited (sigterm) }

Can anyone tell me what is going on and how can I solve this ?

1 Answers1

1

There are 2 solutions they are:

  1. Open Android Studio and click on refactor -> Migrate to androidX

  2. Add implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' in android\app\build.gradle inside dependencies

Joel
  • 180
  • 1
  • 11