CleverTap / clevertap-flutter

CleverTap Flutter SDK
Other
30 stars 43 forks source link

Error while running app #186

Closed innerk closed 1 year ago

innerk commented 1 year ago

Hi, after installing the dependencies for android and running the app in debug mode, i'm having this error

E/MethodChannel#clevertap_plugin/dart_to_native(10970): Failed to handle method call E/MethodChannel#clevertap_plugin/dart_to_native(10970): java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference

PlatformException(CleverTapPlugin, CleverTap Instance is not initialized, null, null)

this is my code:

`late CleverTapPlugin _clevertapPlugin;

@override void initState() { super.initState();

initPlatformState();
activateCleverTapFlutterPluginHandlers();
CleverTapPlugin.setDebugLevel(3);

/* var stuff = ["bags", "shoes"]; var profile = { 'Name': 'Captain America', 'Identity': '100', 'Email': 'captain@america.com', 'Phone': '+14155551234', 'stuff': stuff };

CleverTapPlugin.recordEvent("Send Basic Push", profile); */

}`

is there any step i'm doing wrong?

shivamsharma2710 commented 1 year ago

Hi @innerk

Which version of CleverTap Flutter SDK you're using?

innerk commented 1 year ago

I'm using clevertap_plugin: 1.7.0 with:

[✓] Flutter (Channel stable, 3.0.5, on macOS 12.6 21G115 darwin-x64, locale en-CL) [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) [✓] Xcode - develop for iOS and macOS (Xcode 14.0.1) [✓] Android Studio (version 4.2) [✓] VS Code (version 1.79.2)

innerk commented 1 year ago

downgraded to clevertap_plugin: 1.6.1 and works fine, thanks!