AppsFlyerSDK / appsflyer-flutter-plugin

Flutter Plugin for AppsFlyer SDK
MIT License
142 stars 111 forks source link

java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference #322

Open Yograj-Work opened 1 month ago

Yograj-Work commented 1 month ago

Describe the bug Failed to handle method call E/MethodChannel#af-api(32515): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

To Reproduce Steps to reproduce the behavior:

  1. initialize appsflyerSdk
  2. generate deep link using generateInviteLink() method
  3. here is whole erroe log: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference

Expected behavior should generate deep link for my app

Screenshots Screenshot 2024-05-09 at 5 30 03 PM

Desktop (please complete the following information):

Additional context I have declair appsflyerSdk in main.dart file before runApp(). Using its instance for generating deeplink for my application throws this error while generating deeplink.

Here is my flutter doctor -v commad respose: macmini3@macmini3s-Mini ~ % flutter doctor -v [✓] Flutter (Channel stable, 3.16.4, on macOS 14.2.1 23C71 darwin-arm64, locale en-US) • Flutter version 3.16.4 on channel stable at /Users/macmini3/development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 2e9cb0aa71 (9 weeks ago), 2023-12-11 14:35:13 -0700 • Engine revision 54a7145303 • Dart version 3.2.3 • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/macmini3/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • ANDROID_HOME = /Users/macmini3/Library/Android/sdk • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15C65 • CocoaPods version 1.15.1

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.86.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.42.0

[✓] Connected device (3 available) • iPhone 15 Pro Max (mobile) • F776AE18-4237-4A5C-972D-3910C417F98C • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator) • macOS (desktop) • macos • darwin-arm64 • macOS 14.2.1 23C71 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 121.0.6167.160

[✓] Network resources • All expected network resources are available.

• No issues found!

wiktoriasobczyk commented 1 month ago

I'm experiencing similar bug in version 6.14.2 that was previously fixed in 6.11.3 https://github.com/AppsFlyerSDK/appsflyer-flutter-plugin/issues/109. Could this be a regression? Any insight or further investigation would be appreciated. Thank you!

dhimanrascon commented 1 month ago

I'm also experiencing the similar issue in Version 6.13.2+1. Should I revert to Version 6.11.3? Please suggest.

wiktoriasobczyk commented 3 weeks ago

Is there any update with this issue?:)

HatsuneMikuV commented 1 day ago

Suspected to be the same issue.

          Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void i10.l.a(i10.l$d, java.lang.Object, java.lang.String)' on a null object reference
       at io.flutter.plugin.common.MethodChannel.invokeMethod(MethodChannel.java:12)
       at com.appsflyer.appsflyersdk.AppsflyerSdkPlugin$5$1.run(AppsflyerSdkPlugin.java:12)
       at android.os.Handler.handleCallback(Handler.java:958)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:230)
       at android.os.Looper.loop(Looper.java:319)
       at android.app.ActivityThread.main(ActivityThread.java:8893)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
[!] Flutter (Channel [user-branch], 3.19.6, on macOS 14.5 23F79 darwin-arm64, locale en-US)
    ! Flutter version 3.19.6 on channel [user-branch] at /Users/anglemiku/Documents/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
    • Framework revision 54e66469a9 (2 months ago), 2024-04-17 13:08:03 -0700
    • Engine revision c4cd48e186
    • Dart version 3.3.4
    • DevTools version 2.31.1
    • Pub download mirror https://pub.dev
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/anglemiku/Library/Android/sdk
    • Platform android-34, build-tools 33.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.90.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • angle’s iPhone (mobile) • 00008030-000965040A98402E • ios            • iOS 17.5.1 21F90
    • macOS (desktop)         • macos                     • darwin-arm64   • macOS 14.5 23F79 darwin-arm64
    • Chrome (web)            • chrome                    • web-javascript • Google Chrome 126.0.6478.127

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.

appsflyer_sdk: ^6.14.3