Closed Blasanka closed 4 years ago
@Blasanka this might sound dumb, but have you tried to flutter clean
and then flutter build
again after upgrading?
I highly doubt that a hotfix could introduce breaking changes at plugin's implementation, but...
Yes, even tried pub cache repair
, cleaning building android directory with AS also did not work.
@Blasanka this looks like project related, otherwise I would say it would not work for everyone as it's complaining to dependencies not found. I'm still at hotfix.8, could you downgrade to hotfix.8 and let me know if it works for you?
Could it be that hotfix.9 introduced breaking changes?
Same issue with the eariler version ^1.4.3+2
.
@Blasanka no, I'm suggesting 1.5.1
and Flutter stable version 1.12.13+hotfix.8
Im on it. Can I know your Dart SDK version? My project version is sdk: ">=2.6.0 <3.0.0"
This is where I'm currently at:
✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.4 19E266,
locale pt-PT)
• Flutter version 1.12.13+hotfix.8 at /Users/miguelruivo/devtools/flutter
• Framework revision 0b8abb4724 (7 weeks ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
I had a similar a problem, i tried to downgrade the flutter version to 1.12.13+hotfix.8 . But i still have the same error. The result of building with file_picker: ^1.4.0:
Deprecated` Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings 17 actionable tasks: 1 executed, 16 up-to-date
C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:12: error: cannot find symbol import androidx.lifecycle.DefaultLifecycleObserver; ^ symbol: class DefaultLifecycleObserver location: package androidx.lifecycle C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:19: error: cannot find symbol import io.flutter.embedding.engine.plugins.lifecycle.FlutterLifecycleAdapter; ^ symbol: class FlutterLifecycleAdapter location: package io.flutter.embedding.engine.plugins.lifecycle C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:35: error: cannot find symbol implements Application.ActivityLifecycleCallbacks, DefaultLifecycleObserver { ^ symbol: class DefaultLifecycleObserver location: class FilePickerPlugin C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:42: error: method does not override or implement a method from a supertype @Override ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:46: error: method does not override or implement a method from a supertype @Override ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:50: error: method does not override or implement a method from a supertype @Override ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:54: error: method does not override or implement a method from a supertype @Override ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:58: error: method does not override or implement a method from a supertype @Override ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:63: error: method does not override or implement a method from a supertype @Override ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:253: error: cannot find symbol this.lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(activityBinding); ^ symbol: variable FlutterLifecycleAdapter location: class FilePickerPlugin C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:254: error: incompatible types: FilePickerPlugin.LifeCycleObserver cannot be converted to LifecycleObserver this.lifecycle.addObserver(this.observer); ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:262: error: incompatible types: FilePickerPlugin.LifeCycleObserver cannot be converted to LifecycleObserver this.lifecycle.removeObserver(this.observer); ^ Note: C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerDelegate.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 12 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 3s
**The plugin file_picker could not be built due to the issue above.
and my flutter doctor output:**
C:\flutter\bin\flutter.bat doctor --verbose [√] Flutter (Channel unknown, v1.12.13+hotfix.8, on Microsoft Windows [Versión 10.0.18362.720], locale es-ES) • Flutter version 1.12.13+hotfix.8 at C:\flutter • Framework revision 0b8abb4724 (8 weeks ago), 2020-02-11 11:44:36 -0800 • Engine revision e1e6ced81d • Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at C:\Users\LBO880\AppData\Local\Android\Sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • ANDROID_HOME = C:\Users\LBO880\AppData\Local\Android\Sdk • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04) • All Android licenses accepted.
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime
Environment (build 1.8.0_212-release-1586-b04)
[√] Connected device (1 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• No issues found! Process finished with exit code 0
@oumi there must be something on your machine that results in this. Maybe gradle version incompatibility? I’m trying to figure what but I can’t seem to be able to replicate the issue as it always builds successfully.
Mind to try the example project provided with the plugin?
Thank you.
@oumi mind to try the solution described here on the Wiki troubleshooting? Thank you.
I have the same issue.
When building the app I get an error specifying that FilePickerDelegate.java uses a deprecated API. And when I want to show the window to select the file, I get the following error:
I/flutter (20357): [FilePicker] Unsupported operation. Method not found. The exception thrown was: MissingPluginException(No implementation found for method ANY on channel file_picker)
E/flutter (20357): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: MissingPluginException(No implementation found for method ANY on channel file_picker)
Plug-in version: 1.6.2 My Flutter version:
Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18363.720], locale en-US)
• Flutter version 1.12.13+hotfix.9 at
• Framework revision f139b11009 (10 days ago), 2020-03-30 13:57:30 -0700
• Engine revision af51afceb8
• Dart version 2.7.2
In the GeneratedPluginRegistrant.java I can't find the plugin. I tried the solution from the Wiki section, and multiple cleans and builds, but nothing worked.
@phillausofia looks like you are still invoking FilePicker.ANY
instead of FilePicker.any
so I believe that this is some cached package issue (from previous versions).
Make sure you are calling using camelCase enum.
Eventually I found the glitch:
the previous developer copied the file_picker.dart file from the plugin and added it directly to the code, so all the classes where imported from that file. I've deleted that file and all the previous cached versions of the plug-in (there were quite a few) and now it works.
I have the same problem with Flutter 1.12.13+hotfix.9 and file_picker 1.6.2 . I can't build now
@cavinpabua post your logs please.
I had a similar a problem, i tried to downgrade the flutter version to 1.12.13+hotfix.8 . But i still have the same error. The result of building with file_picker: ^1.4.0:
Deprecated` Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings 17 actionable tasks: 1 executed, 16 up-to-date
C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:12: error: cannot find symbol import androidx.lifecycle.DefaultLifecycleObserver; ^ symbol: class DefaultLifecycleObserver location: package androidx.lifecycle C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:19: error: cannot find symbol import io.flutter.embedding.engine.plugins.lifecycle.FlutterLifecycleAdapter; ^ symbol: class FlutterLifecycleAdapter location: package io.flutter.embedding.engine.plugins.lifecycle C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:35: error: cannot find symbol implements Application.ActivityLifecycleCallbacks, DefaultLifecycleObserver { ^ symbol: class DefaultLifecycleObserver location: class FilePickerPlugin C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:42: error: method does not override or implement a method from a supertype @override ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:46: error: method does not override or implement a method from a supertype @override ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:50: error: method does not override or implement a method from a supertype @override ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:54: error: method does not override or implement a method from a supertype @override ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:58: error: method does not override or implement a method from a supertype @override ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:63: error: method does not override or implement a method from a supertype @override ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:253: error: cannot find symbol this.lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(activityBinding); ^ symbol: variable FlutterLifecycleAdapter location: class FilePickerPlugin C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:254: error: incompatible types: FilePickerPlugin.LifeCycleObserver cannot be converted to LifecycleObserver this.lifecycle.addObserver(this.observer); ^ C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:262: error: incompatible types: FilePickerPlugin.LifeCycleObserver cannot be converted to LifecycleObserver this.lifecycle.removeObserver(this.observer); ^ Note: C:\flutter.pub-cache\hosted\pub.dartlang.org\file_picker-1.5.1\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerDelegate.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 12 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 3s
**The plugin file_picker could not be built due to the issue above.
and my flutter doctor output:**
C:\flutter\bin\flutter.bat doctor --verbose [√] Flutter (Channel unknown, v1.12.13+hotfix.8, on Microsoft Windows [Versión 10.0.18362.720], locale es-ES) • Flutter version 1.12.13+hotfix.8 at C:\flutter • Framework revision 0b8abb4724 (8 weeks ago), 2020-02-11 11:44:36 -0800 • Engine revision e1e6ced81d • Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at C:\Users\LBO880\AppData\Local\Android\Sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • ANDROID_HOME = C:\Users\LBO880\AppData\Local\Android\Sdk • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04) • All Android licenses accepted.
[√] Android Studio (version 3.6) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 44.0.2 • Dart plugin version 192.7761 • Java version OpenJDK
Runtime
Environment (build 1.8.0_212-release-1586-b04)[√] Connected device (1 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• No issues found! Process finished with exit code 0
I have the exact same logged errors as @oumi but with version 1.6.2
@cavinpabua this looks like the project needs to me migrated to support v2 (probably that’s a project that started sometime ago). Check the troubleshooting section on the Wiki for Android.
@miguelpruivo I started this project just last month and upon seeing the troubleshooting section all is in order. I have v2 still the error persist. I'm focusing on error: cannot find symbol import androidx.lifecycle.DefaultLifecycleObserver; maybe it gives some lead. maybe this can help
@cavinpabua this os odd as if it were because of that, it should happen to everyone that uses the plugin (including myself).
Could you please run the example app provided with the package and let me know if it worked for you?
Thank you.
@cavinpabua after further investigation, and based on your logs, you are using a cached version of 1.5.1. Please, update the plugin to the latest version and see if it still happens for you (you might need to completely remove the cache from your .pub_cache folder).
Also, to all in this thread, please check this answer and see if it helps.
Thank you.
@miguelpruivo I have moved my version to 1.6.2 which is the latest and still got the error below:
C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:10: error: cannot find symbol import androidx.lifecycle.DefaultLifecycleObserver; ^ symbol: class DefaultLifecycleObserver location: package androidx.lifecycle C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:20: error: cannot find symbol import io.flutter.embedding.engine.plugins.lifecycle.FlutterLifecycleAdapter; ^ symbol: class FlutterLifecycleAdapter location: package io.flutter.embedding.engine.plugins.lifecycle C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:36: error: cannot find symbol implements Application.ActivityLifecycleCallbacks, DefaultLifecycleObserver { ^ symbol: class DefaultLifecycleObserver location: class FilePickerPlugin C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:43: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:47: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:51: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:55: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:59: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:64: error: method does not override or implement a method from a supertype @Override ^ C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:251: error: cannot find symbol this.lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(activityBinding); ^ symbol: variable FlutterLifecycleAdapter location: class FilePickerPlugin C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:252: error: incompatible types: FilePickerPlugin.L ifeCycleObserver cannot be converted to LifecycleObserver this.lifecycle.addObserver(this.observer); ^ C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:260: error: incompatible types: FilePickerPlugin.L ifeCycleObserver cannot be converted to LifecycleObserver this.lifecycle.removeObserver(this.observer); ^ Note: C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerDelegate.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 12 errors
I also have repeatedly deleted the pub.dartlang.org folder manually to ensure clear cache but the error still persist. Am I doing something wrong?
After some investigation with reference to stackoverflow and android jetpack I manually added the following to flutter_file_picker android/build.gradle and reduced the error from 12 to 1 error:
REMAINING ERROR
C:\Users\user\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\file_picker-1.6.2\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:20: error: cannot find symbol import io.flutter.embedding.engine.plugins.lifecycle.FlutterLifecycleAdapter; ^ symbol: class FlutterLifecycleAdapter location: package io.flutter.embedding.engine.plugins.lifecycle 1 error
ADDED TO BUILD.GRADLE implementation "androidx.lifecycle:lifecycle-runtime:2.2.0" implementation "androidx.lifecycle:lifecycle-extensions:2.2.0" annotationProcessor "androidx.lifecycle:lifecycle-compiler:2.2.0" implementation "androidx.lifecycle:lifecycle-common-java8:2.2.0"
@cavinpabua thank you for the effort. Like I said, you shouldn’t need that dependency at all, otherwise it would be happen to all plugin users including myself since V2 support was added.
We need to dig in the origin cause. Have you checked this?
@miguelpruivo yes my whole project is in androidx now. my project:
android/app/build.gradle compileSdkVersion 28 targetSdkVersion 28
android/gradle.properties org.gradle.jvmargs=-Xmx1536M android.enableR8=true android.useAndroidX=true android.enableJetifier=true
This is one of those Android mysterious things @cavinpabua, it's not easy specially when I can't replicate it, but I might have found something relevant.
If this is not happening to everyone, leads me to the conclusion that it has to be with Flutter engine itself differences on different versions — and so it seems, like in this open issue.
Basically, some people report to have the same problem with other packages due to some version, and, the one thing that I found in common with all of you on this issue, is that you are running on Windows, while I'm on a Mac, so that's probably something related to the engine + OS platform.
Could you please try to flutter clean
then project and then switch to flutter channel master
and rebuild it again?
Thank you!
@miguelpruivo Tried flutter clean
and flutter channel master
with flutter upgrade
and upon rebuilding the issue still remains. You mentioned that you're on Mac, I will try to make some virtual machine with Ubuntu Linux and will try to build my project in there. I will get back on this thread.
@cavinpabua that's quite an effort, but should point us toward the right direction if that works.
Thank you.
@miguelpruivo I took me sometime to setup the environment but the issues still persist. The logs are as follows:
/home/cavin/Downloads/flutter_linux_v1.12.13+hotfix.9-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.6.2/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:10: error: cannot find symbol import androidx.lifecycle.DefaultLifecycleObserver; ^ symbol: class DefaultLifecycleObserver location: package androidx.lifecycle /home/cavin/Downloads/flutter_linux_v1.12.13+hotfix.9-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.6.2/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:20: error: cannot find symbol import io.flutter.embedding.engine.plugins.lifecycle.FlutterLifecycleAdapter; ^ symbol: class FlutterLifecycleAdapter location: package io.flutter.embedding.engine.plugins.lifecycle /home/cavin/Downloads/flutter_linux_v1.12.13+hotfix.9-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.6.2/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:36: error: cannot find symbol implements Application.ActivityLifecycleCallbacks, DefaultLifecycleObserver { ^ symbol: class DefaultLifecycleObserver location: class FilePickerPlugin /home/cavin/Downloads/flutter_linux_v1.12.13+hotfix.9-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.6.2/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:43: error: method does not override or implement a method from a supertype @Override ^ /home/cavin/Downloads/flutter_linux_v1.12.13+hotfix.9-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.6.2/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:47: error: method does not override or implement a method from a supertype @Override ^ /home/cavin/Downloads/flutter_linux_v1.12.13+hotfix.9-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.6.2/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:51: error: method does not override or implement a method from a supertype @Override ^ /home/cavin/Downloads/flutter_linux_v1.12.13+hotfix.9-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.6.2/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:55: error: method does not override or implement a method from a supertype @Override ^ /home/cavin/Downloads/flutter_linux_v1.12.13+hotfix.9-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.6.2/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:59: error: method does not override or implement a method from a supertype @Override ^ /home/cavin/Downloads/flutter_linux_v1.12.13+hotfix.9-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.6.2/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:64: error: method does not override or implement a method from a supertype @Override ^ /home/cavin/Downloads/flutter_linux_v1.12.13+hotfix.9-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.6.2/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:251: error: cannot find symbol this.lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(activityBinding); ^ symbol: variable FlutterLifecycleAdapter location: class FilePickerPlugin /home/cavin/Downloads/flutter_linux_v1.12.13+hotfix.9-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.6.2/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:252: error: incompatible types: FilePickerPlugin.LifeCycleObserver cannot be converted to LifecycleObserver this.lifecycle.addObserver(this.observer); ^ /home/cavin/Downloads/flutter_linux_v1.12.13+hotfix.9-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.6.2/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:260: error: incompatible types: FilePickerPlugin.LifeCycleObserver cannot be converted to LifecycleObserver this.lifecycle.removeObserver(this.observer); ^ Note: /home/cavin/Downloads/flutter_linux_v1.12.13+hotfix.9-stable/flutter/.pub-cache/hosted/pub.dartlang.org/file_picker-1.6.2/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerDelegate.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 12 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.
@cavinpabua does that happen when you run the example app from the plugin?
@miguelpruivo aaaaand yeah the example app from the plugin builds without a problem. I just wonder why me and @oumi have the same problem where in fact we just use the plugin as usual. I also want to mention that my project's android language is Kotlin while the example app, I believe, is in Java. Could it be a reason?
@cavinpabua hum, could it be related? I don't know. But I'll try to create an empty project with Kotlin as Android support and see if I can replicate it (I wish I could, worse that errors, are those that you can't replicate in order to implement a fix).
Sorry for not replying before. Now, i downloaded for the second time the example of @miguelpruivo and it worked without doing anything else (the same example didn't work two weeks before). And i used the last version of file picker on my project also and it worked. I have to say also that i'm using windows. I don't know what's new in this last version... Any way, many thanks guys!!. If you need me to check something to help you to find the problem, tell me please.
This still looks like cache issues conflicts to me @oumi, which makes it harder to address. Have you updated your Flutter version in the meantime? Thanks!
Actually, last week i tried a lot of things like upgrading gradle (now i have 5.6.4 version) and i don't think that i did anything else. May be the combination of the new version of the plugin and the gradle 5.6.4 worked. Anyway, this is the result of my flutter doctor:
[√] Flutter (Channel unknown, v1.12.13+hotfix.8, on Microsoft Windows [Versión 10.0.18362.778], locale es-ES) • Flutter version 1.12.13+hotfix.8 at C:\flutter • Framework revision 0b8abb4724 (10 weeks ago), 2020-02-11 11:44:36 -0800 • Engine revision e1e6ced81d • Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2) • Android SDK at C:\Users\LBO880\AppData\Local\Android\Sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-29, build-tools 29.0.2 • ANDROID_HOME = C:\Users\LBO880\AppData\Local\Android\Sdk • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04) • All Android licenses accepted.
[√] Android Studio (version 3.6) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 44.0.2 • Dart plugin version 192.7761 • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[√] Connected device (1 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• No issues found!
@cavinpabua would you mind to set your gradle version to 5.6.4 to see if it might be related and actually provide a fix? 🕵️♂️
Thanks @oumi.
@miguelpruivo The same issue here
[✓] Flutter (Channel beta, v1.17.0, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
gradle 5.6.4
flutter_file_picker/example
works fine
If example works fine, maybe you can try to see what dependencies have differences on both? Looks like an Android dependencies issue to me.
I've switched to 1.4.3+2 and now everything works. I haven't noticed much difference between android folder in example and android folder in my project. The main difference is that my project uses kotlin.
@marchellodev it looks like this is affecting users with Kotlin projects, I'll keep you updated. Switching to 1.4.3 you'll be losing some of the new features such as multiple file extension filters and so on, but if you don't need them as of now, stick with it for now.
I have the similar issue when i add android:requestLegacyExternalStorage="true"
this line to Androidmainfest.xml.The logs are as follows:
/Users/qitianle/Desktop/flutter/.pub-cache/hosted/pub.flutter-io.cn/file_picker-1.6.3+1/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:20: 错误: 找不到符号
import io.flutter.embedding.engine.plugins.lifecycle.FlutterLifecycleAdapter;
^
符号: 类 FlutterLifecycleAdapter
位置: 程序包 io.flutter.embedding.engine.plugins.lifecycle
1 个错误
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
@atheist1 also on a Kotlin project?
@atheist1 also on a Kotlin project? I am not sure about it, I am a new developer to flutter.
but i guess it is a pure flutter project cause it's created by android studio onstart a new flutter project
choice.
And its build with no error if i don't add theandroid:requestLegacyExternalStorage="true"
but i can pick pdf file on android Q.
Joining this thread with the same issue.
What I've already checked/tried:
flutter clean
and flutter pub cache repair
android:requestLegacyExternalStorage="true"
in my manifestfile_picker
does work fineI'm on macOS so I don't think the issue lies here. My MainActivity is in Kotlin so this might be a hint.
@miguelpruivo any direction where we could investigate this further?
@jagmit if I have the time, today I'll create a sample project with Kotlin and see if I can replicate it. If so, then that's the main lead. I'll keep in touch.
Just tried with transforming my MainActivity from Kotlin to Java and the issue is still there.
Same with pointing my manifest directly to the FlutterActivity
coming from Flutter itself like:
<activity
android:name="io.flutter.embedding.android.FlutterActivity"
....
@jagmit I believe that it must be some config property, we just need to find which one. Because running the plugin on Java projects works just fine.
Ok, so, basically I created an empty project (with Kotlin support) and was able to immediately build without an error at all (compileSdk: 29
) both with android:requestLegacyExternalStorage="true"
and not.
minSdkVersion 21
targetSdkVersion 29
So, here my files and please, anyone in this thread, can compare and see if anything helps:
gradle.version=5.6.2
android/build.gradle
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Any news on this?
Any news on this? It's works fine if i do not add add
android:requestLegacyExternalStorage="true"
@atheist1 on which version? Then don’t add it at all. That’s only for Android Q versions when your buildSdk is set to 29.
My project is migrated to AndroidX and worked earlier with Flutter version
1.12.13+hotfix.7
and FilePicker version1.4.3+2
Flutter Doctor output:
Error log: