Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken Example #104

Open
PhantomKnight287 opened this issue Nov 24, 2024 · 8 comments
Open

Broken Example #104

PhantomKnight287 opened this issue Nov 24, 2024 · 8 comments
Labels
question Further information is requested

Comments

@PhantomKnight287
Copy link

I cloned the repository and tried to run the application inside example folder. The app started but when I clicked on the button to start live activity, I get the error of null check used on a null value. Below is the image and stack trace of the error.

Launching lib/main.dart on iPhone 15 Pro Max in debug mode...
Warning: Missing build name (CFBundleShortVersionString).
Warning: Missing build number (CFBundleVersion).
Action Required: You must set a build name and number in the pubspec.yaml file version field before submitting to the App Store.
Xcode build done.                                           45.9s
Connecting to VM Service at ws://127.0.0.1:50966/6YrRKK_YtDk=/ws
Connected to the VM Service.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
#0      AppGroupsImageService.sendImageToAppGroups (package:live_activities/services/app_groups_image_service.dart:29:41)
app_groups_image_service.dart:29
<asynchronous suspension>
#1      LiveActivities.createActivity (package:live_activities/live_activities.dart:37:5)
live_activities.dart:37
<asynchronous suspension>
#2      _HomeState.build.<anonymous closure> (package:live_activities_example/main.dart:173:40)
main.dart:173
<asynchronous suspension>

image

@istornz istornz added the bug Something isn't working label Nov 26, 2024
@istornz
Copy link
Owner

istornz commented Nov 26, 2024

Thanks for raising an issue, I will check that ASAP

@istornz
Copy link
Owner

istornz commented Nov 27, 2024

Hi, I tried on my side and I can't reproduce it. Maybe do you have a valid App Group registered? (check the following steps here : https://github.com/istornz/flutter_live_activities?tab=readme-ov-file#-native)

@istornz istornz added question Further information is requested and removed bug Something isn't working labels Nov 27, 2024
@PhantomKnight287
Copy link
Author

Yes, I have a valid group id.

image

@istornz
Copy link
Owner

istornz commented Nov 27, 2024

It seems the plugin can't access to your app group in this code :
Directory? sharedDirectory = await FlutterAppGroupDirectory.getAppGroupDirectory( appGroupId!, );

The sharedDirectory return null on your side, maybe an issue by configuring the app group? Do you have added AppGroup for both Runner and your widget extension?

@PhantomKnight287
Copy link
Author

Yes it is configured for both Runner and Widget extension.
image
image

@ahndwon
Copy link

ahndwon commented Jan 25, 2025

have you fixed this??
or a workaround?

@PhantomKnight287
Copy link
Author

have you fixed this?? or a workaround?

No

@istornz
Copy link
Owner

istornz commented Feb 27, 2025

Do you have correctly set the appgroupid for both Swift code and Dart?

let sharedDefault = UserDefaults(suiteName: "REPLACE_HERE")!

_liveActivitiesPlugin.init(
        appGroupId: 'REPLACE_HERE', urlScheme: 'la');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants