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
🐞[iOS] MissingPluginException in example app #189
Comments
I have the same issue, I just read over the apple's https://developer.apple.com/documentation/backgroundtasks doc, I think the example missing the "Permitted background task scheduler identifiers" part,will test this tomorrow |
As I understood, those identifiers are only needed for the API that was introduced in iOS 13 (Background Task API), which lets you specify tasks similar to Android's WorkManager. But for simple Background Fetch, those identifiers should not be needed. |
Indeed, the identifier isn’t necessary because the plug-in uses the older background fetch API, not the iOS 13 task based API. I’ll look into this next week. |
@Kymer This iOS issue is not related to the example app only, I'm facing it in my app after implementation for the whole functionality, and when I tried with the example app I found it happening there also. |
Same problem here. |
Please just thumb up the initial bug report instead of posting "Same here". This only pollutes the conversation and makes tracing important questions/answers difficult. Thanks! |
Finally i have found solution: Make sure you have the followings in ios/Runner/GeneratedPluginRegistrant.m #if __has_include(<workmanager/WorkmanagerPlugin.h>) and inside (void)registerWithRegistry:(NSObject*) function: Keep in mind that ios/Runner/GeneratedPluginRegistrant.m file resets after every clean and build, so make sure that above is present before running app. Also enable debug mode, when simulating background fetch from xcode. |
I can confirm this works in XCode. Thanks! However....If we run it from another IDE such as AS, GeneratedPluginRegistrant.m is automatically rebuilt, even without clean, so the workaround fails. I don't know enough to correct this at the plugin level. |
You can do it from another IDE as well, after run wait for pod install to finish, then manually edit GeneratedPluginRegistrant.m before build has been finished. |
Found better and permanent solution: add following inside AppDelegate.swift WorkmanagerPlugin.register(with: self.registrar(forPlugin: "be.tramckrijte.workmanager.WorkmanagerPlugin")) this is how my ios/Runner/AppDelegate.swift looks like:
|
Thanks @mamedshahmaliyev. Extending your results to AppDelegate.m (Obj-C), add:
and
AppDelegate.m ends up like this
All seems to be good so far. |
@mamedshahmaliyev's solution for swift works like a charm, thank you a lot! |
Based on your solution I get "No such module 'workmanager'. Do you know why? Thanks alot! |
Same issue as @gareth-del. I would like to add that even if I already try to delete |
@ivanjpg same issue here.Did you get the solution? |
@mamedshahmaliyev please give me a solution for no such module |
@suhail-zartek , unfortunately i have no such problem, the only thing that comes to my mind is, make sure that there is workmanager folder inside ios/.symlinks/plugins folder, i think import module_name should be the same as in ios/.symlinks/plugins folder. If there is no such ios/.symlinks/plugins/workmanager folder search for similar name otherwise it means pod install does not install the workmanager plugin... |
I have the same problem with unavailable |
Try running |
It doesn't work. |
It's also not contained in |
same here, happens after upgraded Flutter from 1.17.5 to 1.20 |
Agree. I upgraded to 1.20.x and ended up with so many problems I went back to 1.17.x. |
Small fix on my side was to force the register as non optional ! as the plugin expects. It appears on 1.20 this self.registrar returns optional ? WorkmanagerPlugin.register(with: self.registrar(forPlugin: "be.tramckrijte.workmanager.WorkmanagerPlugin")!) |
@2math |
for some reason after upgrading again to 1.20 I had the plugin. Need to
mention that this time didn't call rm ios/Podfile
Now when I run the project from android studio it hangs on sync with device
for 5-6 min :) , when I run from XCode is OK, but not hot reload there. I'm
right before releasing to production and can not afford v1.20+ :(
…On Wed, Aug 19, 2020 at 5:18 PM Yaroslav Pronin ***@***.***> wrote:
@2math <https://github.com/2math>
But this will not solve the problem of missing
.symlink/plugins/workmanager dir
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#189 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AG5B7J2YQZHFHJSUA2VNPQDSBPNLBANCNFSM4O3BPGKA>
.
--
Regards,
Galeen
|
Is this a podfile related issue associated with flutter 1.20.x?. Creating a new podfile ( I dont know enough to say how this should be resolved but it seems the new podfile format works fine for most of the plugins I am using just not workmanager so could this be resolved by a plugin fix? For reference I am still using mamedshahmaliyev's fix to make this work also. |
@cormalenv: Can described confirm your behaviour. New Podfile breaks compatibility with Workmanager. Using Podfile from Flutter 1.17 resolves the issue. However, Flutter 1.20 also seems to break compatibility with @mamedshahmaliyev fix. |
@gebsl Ill run some more tests tomorrow and get back to you. Reading your flutter 1.20 thread, it looks like we are now hitting the same issue. @mamedshahmaliyev's fix is a workaround for the original bug here which still exists so it shouldnt be closed but the thread seems to be migrating now to a 1.20 issue so we probably can move over to there. |
If anyone needs old Podfile (before Flutter 1.20 version) you can look to example app's Podfile. |
@gebsl the only modification I made to @mamedshahmaliyev 's fix was @2math 's addition to register as non-optional
Relevant sections of flutter doctor for reference in case.
I still think everything here might be workarounds given I am not seeing these same issue in other plugins. If I get time I will look further at PR options. |
@cormalenv: Thanks for the hint! Build seems to work on my side. Summing up:
This seems to do the trick. But totally agree with you, @cormalenv, this can only be temporary hacks for the plugin. Unfortunately I'm too unexperienced in iOS development, so I won't be able to assist in finding the underlying problem in this plugin. Really appreciate your efforts! |
This issue is also with the |
When I add
Anyone has the same issue? |
@barrinhos123 |
Problem solved thank you! |
For me, the code bellow appeared in
More specifically I executed the next command after changing the dependencies inside
===== [My Environments]
|
In addition, I will share my I add the
|
I've tried all suggestions above to no avail. |
I tried this PR and it works for me. #218 |
That PR does not work for me.. Same "no such module.... " error on xcode.. May I ask how you're using it @ngothanhtai ? I've done the following on pubspec.yaml:
Then remove pods and |
@MiguelSOliveira I specified the commit ref in the pubspec
|
I am getting a permission error when trying to get this PR: `pub get failed (server unavailable) -- attempting retry 6 in 32 seconds... Git error. Command: stdout: stderr: Cloning into bare repository '/Users/ux/work/flutter/.pub-cache/git/cache/flutter_workmanager-b145eb908d4135eaccf9e2d27cfe2100402b3876'... git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.` |
Hi @ujnamss: You can avoid that error if you change the I hope this helps. |
Doesn't seem to work @ivanjpg - i still get Exception |
"One Off Tasks" and "Periodic Tasks" only works on Android. See https://github.com/fluttercommunity/flutter_workmanager/blob/master/IOS_SETUP.md As @ngothanhtai said, this is the fix for now:
|
I was pushed to migrate into new iOS build system and confirm this is the only solution for now to have workmanager in the symlink
|
Can you please share the GeneratedPluginRegistrant.m file. |
Since the WorkManager is described in this way: "Flutter WorkManager is a wrapper around Android's WorkManager and iOS' performFetchWithCompletionHandler" and performFetchWithCompletionHandler is deprecated for apps supporting iOS 13 and higher (replaced by BGAppRefreshTask), am I correct that there is no way for implementing WorkManager on iOS 13 and higher, because it uses the wrong/outdated API? |
Why is there no |
Version
Describe the error
When running the example app on a real iOS device through XCode (by pressing the "Run" icon), the app throws an exception when pressing the "Start the Flutter background service" button. Subsequently, background fetch won't work and the dispatch method is never called.
The exception in XCode's console is:
Unfortunately I can not provide any debug information, when starting the app through
flutter run
, as there seems to be a bug with iOS hiding important exceptions from frameworks like flutter (see flutter/flutter#41133), so the only way to fetch information (at least the one I know about) is through XCode.Except from running
flutter pub get
andflutter build ios
(to resolve initial build error in XCode) I didn't changed anything in the example app.Though, there is one thing I noticed that's different from the iOS setup guide: After unchecking and re-checking the capability "Background fetch" in XCode, following block is not added to file
project.pbxproj
(which, as I understood, should be added automatically by XCode):Unfortunately, adding it manually does not seem to have any effect.
Output of
flutter doctor -v
The text was updated successfully, but these errors were encountered: