Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build fails with register unknown symbol #1645

Open
3 tasks
seankang92129 opened this issue Dec 12, 2024 · 16 comments
Open
3 tasks

build fails with register unknown symbol #1645

seankang92129 opened this issue Dec 12, 2024 · 16 comments
Labels
new issue An issue that hasn't yet been seen from the maintainer

Comments

@seankang92129
Copy link

Describe the bug
On the azure devops pipeline, the build fails -- whereas it did not incur this problem before.

Running: flutter build apk --flavor MyFlavor

Platform

  • [ X] Android
  • iOS
  • Web
  • Desktop

Platform OS version
Running on ubuntu build agent ubuntu-22.04

How are you picking?
on the android build

Details to reproduce the issue
Clean flutter build -- with cleared pub.dev cache

Error Log
/home/vsts/.pub-cache/hosted/pub.dev/file_picker-8.1.5/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:257: error: cannot find symbol
if (registrar != null) {
^
symbol: variable registrar
location: class FilePickerPlugin
/home/vsts/.pub-cache/hosted/pub.dev/file_picker-8.1.5/android/src/main/java/com/mr/flutter/plugin/filepicker/FilePickerPlugin.java:260: error: cannot find symbol
registrar.addActivityResultListener(this.delegate);
^
symbol: variable registrar
location: class FilePickerPlugin

Screenshots and/or video
na

Flutter Version details
3.24.3

Additional context
Add any other context about the problem here.

@seankang92129 seankang92129 added the new issue An issue that hasn't yet been seen from the maintainer label Dec 12, 2024
@dkati
Copy link

dkati commented Dec 12, 2024

same here

@jaimecalderon19
Copy link

I did the same thing with a flutter clean and then a flutter pub get and it stopped working.

@metekaganmusaak
Copy link

metekaganmusaak commented Dec 12, 2024

Duplicated topic. Check #1643

@VimalNovelX
Copy link

same issue

@VimalNovelX
Copy link

FilePickerPlugin.java:257: error: cannot find symbol
if (registrar != null) {
^
symbol: variable registrar
location: class FilePickerPlugin
C:\Users\91963\AppData\Local\Pub\Cache\hosted\pub.dev\file_picker-8.1.5\android\src\main\java\com\mr\flutter\plugin\filepicker\FilePickerPlugin.java:260: error: cannot find symbol
registrar.addActivityResultListener(this.delegate);
^
symbol: variable registrar
location: class FilePickerPlugin

@waslost0
Copy link

I just set in pubspec.yaml

 file_picker: 8.1.2

@VimalNovelX
Copy link

VimalNovelX commented Dec 13, 2024

Replace this line
if (registrar != null) {
// V1 embedding setup for activity listeners.
application.registerActivityLifecycleCallbacks(this.observer);
registrar.addActivityResultListener(this.delegate);
} else {
// V2 embedding setup for activity listeners.
activityBinding.addActivityResultListener(this.delegate);
this.lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(activityBinding);
this.lifecycle.addObserver(this.observer);
}

with this code

if (activityBinding != null) {
// V2 embedding setup for activity listeners.
activityBinding.addActivityResultListener(this.delegate);
this.lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(activityBinding);
if (this.lifecycle != null) {
this.lifecycle.addObserver(this.observer);
}
}
in C:\Users\91963\AppData\Local\Pub\Cache\hosted\pub.dev\file_picker-8.1.5\android\src\main\java\com\mr\flutter\plugin\filepicker/FilepickerPlugin

flutter clear
flutter pub get
Restart windows

this solved for me

@Cat-100
Copy link

Cat-100 commented Dec 13, 2024

Duplicated topic. Check #1643

metekaganmusaak is correct.

And according to waslost0;

I just set in pubspec.yaml

 file_picker: 8.1.2

This works. In the #1643 issue, they reverted to the closest downgrade; 8.1.4

That worked for me, even on flutter 3.27 and gradle of gradle-8.2.1-all.zip.
file_picker: 8.1.4

@sk92129
Copy link

sk92129 commented Dec 13, 2024

I reverted to 8.1.4 since I have a daily pipeline build that worked the day before -- so I knew that it was very recent update from a dependency

@ChegzDev
Copy link

@miguelpruivo @sk92129 @waslost0 For latest Flutter version 3.27.0 . automatically overrider to file_picker: ^8.1.5
so version change is not possible for me. please give the update with fix this issue.

@JayMoliya33
Copy link

JayMoliya33 commented Dec 14, 2024

@miguelpruivo @sk92129 @waslost0 For latest Flutter version 3.27.0 . automatically overrider to file_picker: ^8.1.5 so version change is not possible for me. please give the update with fix this issue.

++ same issue for me
any luck?

@AliHaxxan2004
Copy link

Try file_picker: 8.1.4 without "^" it worked for me..

@ChegzDev
Copy link

@AliHaxxan2004 thanks bro. this is a new info for me. may be in latest version flutter include this feature.
if "^" symnol came then automatically take latest version of that package.
oops!. any way file_picker need to change code for fix this issue @miguelpruivo

@rufus-op
Copy link

you can use this repo i have fixed the issue

https://github.com/rufus-op/file_picker

replace

file_picker: 8.1.5

with

file_picker:
git:
url: https://github.com/rufus-op/file_picker

@ledinhquy123
Copy link

#1643 try this
dependency_overrides:
file_picker:
git:
url: https://github.com/abdelaziz-mahdy/flutter_file_picker
ref: fix-flutter-3.27-compile-error

@ayoubm
Copy link

ayoubm commented Dec 17, 2024

Using the newest version solves this issue: file_picker: ^8.1.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new issue An issue that hasn't yet been seen from the maintainer
Projects
None yet
Development

No branches or pull requests