uxcam / flutter-plugin

BSD 3-Clause "New" or "Revised" License
4 stars 7 forks source link

Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference #24

Closed ghost closed 10 months ago

ghost commented 1 year ago

W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference W/System.err: at com.uxcam.internals.hp.a(SourceFile:1) W/System.err: at com.uxcam.internals.ht.b(SourceFile:8) W/System.err: at com.uxcam.UXCam.startWithConfigurationCrossPlatform(SourceFile:3) W/System.err: at com.uxcam.flutteruxcam.FlutterUxcamPlugin.startWithConfig(FlutterUxcamPlugin.java:307) W/System.err: at com.uxcam.flutteruxcam.FlutterUxcamPlugin.onMethodCall(FlutterUxcamPlugin.java:262) W/System.err: at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262) W/System.err: at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295) W/System.err: at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$DartMessenger(DartMessenger.java:319) W/System.err: at io.flutter.embedding.engine.dart.-$$Lambda$DartMessenger$AIEPqY6mWzaNK15HekX9bftoAXs.run(Unknown Source:12) W/System.err: at android.os.Handler.handleCallback(Handler.java:942) W/System.err: at android.os.Handler.dispatchMessage(Handler.java:99) W/System.err: at android.os.Looper.loopOnce(Looper.java:201) W/System.err: at android.os.Looper.loop(Looper.java:288) W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7872) W/System.err: at java.lang.reflect.Method.invoke(Native Method) W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

ghost commented 1 year ago

On flutter only it works, on ios + flutter also works, but in android i get this messages.

Also:

E/flutter: [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value

0 FlutterUxcam.startWithConfiguration (package:flutter_uxcam/flutter_uxcam.dart:75:18)

<asynchronous suspension>
ghost commented 1 year ago

ON FlutterUxcamPlugin.java line 306, avtivity is null.

UXCam.startWithConfigurationCrossPlatform(activity, config);

DFDIEGOH commented 1 year ago

Hey @CarlosAMS123 Diego here from UXCam.

Can you share the following information:

ghost commented 1 year ago

Of course @DFDIEGOH :

class MyApp extends StatelessWidget { const MyApp({super.key});

/// This widget is the root of your application. @override Widget build(BuildContext context) { initUxcam(); return MaterialApp.router( routerConfig: router, title: 'Flutter Demo', localizationsDelegates: AppLocalizations.localizationsDelegates, supportedLocales: const [ /// Spanish (Disabled for english) Locale('es'), ], theme: BaseAppTheme.lightTheme, ); }

void initUxcam() { FlutterUxcam.optIntoSchematicRecordings(); FlutterUxConfig config = FlutterUxConfig( userAppKey: 'XXXXXXXXXX', enableAutomaticScreenNameTagging: false, ); FlutterUxcam.startWithConfiguration(config); } }

ghost commented 1 year ago

@DFDIEGOH hi, it's the any update about the problem?

DFDIEGOH commented 1 year ago

Hey @CarlosAMS123 I'm currently checking this with the team, let me get back to you shortly.

DFDIEGOH commented 1 year ago

In the meantime, are you using any other UXCam methods in your application? or is this happening just with the startWithConfiguration method at the moment of initializing the SDK?

ghost commented 1 year ago

@DFDIEGOH thanks for the time! No, uxcam it's only used there.

DFDIEGOH commented 1 year ago

Hi @CarlosAMS123 Quick question in here - you mentioned that you are switching to Flutter inside Android native. Is it that you have a Android native application with Flutter modules inside? Or can you share more context in this scenario as well? Perhaps a call to understand more about this scenario will also be very helpful

ghost commented 1 year ago

@DFDIEGOH Thats correct, there it's only 1 flutter module, and there it's where we are using uxcam. I think a call would be perfect to show you our arch, can we schedule a meeting?

DFDIEGOH commented 1 year ago

Understand now the problem @CarlosAMS123 - As UXCam needs to start recording as soon as the application is starting (in other words, from your launcher activity) this is creating some problems in this regard. I'm currently checking this with the team on different possibilities but definitely having a call to understand more about this will definitely help. Here you can find my calendar with my availability.

Looking forward to speak with you

ghost commented 1 year ago

@DFDIEGOH thanks! Already shcedule for tomorrow, have a nice day.

DFDIEGOH commented 1 year ago

Quick question @CarlosAMS123 - I've checked that a call has been schedule tomorrow but at 11:15am Central European Time, is this correct? Just want to make sure that you have the correct timezone as well

ghost commented 1 year ago

@DFDIEGOH it's correct! Thank you

ghost commented 1 year ago

@DFDIEGOH sorry! You were right. I don't consider the 24hr clock and thought it was 4 PM. Can we reschedule?

So sorry for the inconveniences!

DFDIEGOH commented 1 year ago

Hey @CarlosAMS123 Sure, No worries at all, we can reschedule - We are currently working in the CET Timezone, you can again check using the link that I shared with you before and pick the best time slot for you

ghost commented 1 year ago

@DFDIEGOH Thanks! i already reschedule, see you tomorrow!

DFDIEGOH commented 10 months ago

This should be fixed in the latest version of the Flutter_UXCam package, version 2.4.6