supabase / supabase-flutter

Flutter integration for Supabase. This package makes it simple for developers to build secure and scalable products.
https://supabase.com/
MIT License
656 stars 154 forks source link

NoSuchMethodError: Class 'AppLinks' has no instance method 'getInitialAppLink' #941

Closed murshidm closed 1 week ago

murshidm commented 1 week ago

This bug report describes a NoSuchMethodError encountered when using the supabase_flutter package with the AppLinks dependency.

Steps to Reproduce:

Create a Flutter project and include the following dependencies in your pubspec.yaml:

YAML
dependencies:
  supabase_flutter: 2.5.4
  app_links: 6.1.1

Initialize Supabase in your main.dart file:

Dart
void main() async {
  await Supabase.initialize(
    url: 'YOUR_SUPABASE_URL',
    anonKey: 'YOUR_SUPABASE_ANON_KEY',
  );
  runApp(MyApp());
}

Run the application in debug mode with the setting "Capture all exceptions" enabled.

Observe the error in the console:

Exception has occurred.
NoSuchMethodError (NoSuchMethodError: Class 'AppLinks' has no instance method 'getInitialAppLink'.
Receiver: Instance of 'AppLinks'
Tried calling: getInitialAppLink())
Expected Behavior:

Expected Behavior:

The Supabase.initialize call should initialize the Supabase client without errors.

Additional Information:

VSCode Version: 1.89.1 (Universal) Operating System: Apple Silicon macOS Sonoma Supabase Client Version: 2.5.4 AppLinks Version: 6.1.1

Possible Cause:

The getInitialAppLink method might be deprecated in newer versions of the app_links package.

Please note:

I have already tried ignoring debugSdkLibraries and debugExternalPackageLibraries in VSCode settings, but the error persists.

dshukertjr commented 1 week ago

The SDK is working as expected, and the error that you see is being caught within the SDK. Set your VS code to only catch uncaught exceptions, and you will be fine.