llfbandit / app_links

Android App Links, Deep Links, iOs Universal Links and Custom URL schemes handler for Flutter.
https://pub.dev/packages/app_links
Apache License 2.0
220 stars 81 forks source link

Module 'app_links' not found even though project does not use this package #167

Closed muezz closed 2 weeks ago

muezz commented 2 weeks ago

Describe the bug I am not sure if this is even related to this package but I dont know where to turn. The project DOES NOT use app_links for managing deep links. I am doing that through the built-in way in flutter and use AutoRouter to send the user to the right place in the app once a url is clicked on.

But when I try to run the app from Xcode, I get Module 'app_links' not found

If I check the file GeneratedPluginRegistrant.m, I see this at the top:

#if __has_include(<app_links/AppLinksPlugin.h>)
#import <app_links/AppLinksPlugin.h>
#else
@import app_links;
#endif

Why is this here if I am not using app_links?

Also, I have tried flutter clean && flutter pub get, pod install and pod repo update`. It always leads to this.

llfbandit commented 2 weeks ago

One way to check if this package is included into another is from pub.dev https://pub.dev/packages?q=dependency%3Aapp_links

Otherwise, you can also check with flutter pub subcommands to do the same with more precision.

muezz commented 2 weeks ago

@llfbandit Ah. You mean app_links is being "used" as a transitive dependancy. I do use supabase so it makes sense now. But why do I keep getting this "Module not found" in xcode. I have run all the possible commands to clean the project and install the pods from scratch.

Any ideas?

llfbandit commented 2 weeks ago

cocoapods is boring, be sure to not use an old one.

Remove your Podfile.lock file (eventually the ios/flutter folder) pod repo update pod install

There's nothing special here, only your ios platform which is unsynced.

muezz commented 2 weeks ago

@llfbandit I tried what you said (even deleted the ios/Flutter folder. But I still get the same error. The command flutter build ios runs just fine. But if I build using XCode, it fails with that same error still.

And I updated cocoapods too so that should not be the issue.

llfbandit commented 2 weeks ago

I can't reproduce this. Compiling and archiving an external project with XCode run ok on my side. So, I don't know how to help you further.

muezz commented 2 weeks ago

I got so annoyed with it and ended up upgrading my OS, XCode and iOS to the latest version then the issue basically disappeared. I am not sure what the cause was but at least it is not happening now.

Thanks for looking into this for me.