Closed Orillio closed 5 days ago
ensureInitialized
failed i think it may be the reason of the black screen
can you try the package from github?
dependency_overrides:
media_kit:
git:
url: https://github.com/media-kit/media-kit
path: media_kit
media_kit_video:
git:
url: https://github.com/media-kit/media-kit
path: media_kit_video
media_kit_libs_video:
git:
url: https://github.com/media-kit/media-kit
path: libs/universal/media_kit_libs_video
@abdelaziz-mahdy Nope, same thing happens
This is my pubspec.yaml
file, if you need it
name: mirror
description: "A new Flutter project."
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: '>=3.3.0 <4.0.0'
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^1.0.6
bloc: ^8.1.3
flutter_bloc: ^8.1.4
injectable: ^2.3.5
get_it: ^7.6.7
auto_route: ^7.9.2
hive: ^2.2.3
freezed_annotation: ^2.4.1
flutter_svg: ^2.0.10+1
path_provider: ^2.1.2
flutter_gen: ^5.4.0
flutter_native_splash: ^2.4.0
flutter_launcher_icons: ^0.13.1
flutter_screenutil: ^5.9.0
flutter_multi_formatter: ^2.12.4
dio: ^5.4.3+1
collection: ^1.18.0
smooth_page_indicator: ^1.1.0
intl: ^0.19.0
json_annotation: ^4.8.1
video_thumbnail: ^0.5.3
faker: ^2.1.0
file_picker: ^8.0.0+1
dio_request_inspector: ^3.0.1
image_picker: ^1.0.7
transparent_pointer: ^1.0.0
url_launcher: ^6.2.5
http_parser: ^4.0.2
dio_cookie_manager: ^3.1.1
cookie_jar: ^4.0.8
uuid: ^3.0.7
media_kit: ^1.1.10
media_kit_video: ^1.2.4
media_kit_libs_video: ^1.0.4
media_kit_libs_android_video: ^1.3.6
media_kit_native_event_loop: ^1.0.8
media_kit_libs_ios_video: ^1.1.4
dependency_overrides:
media_kit:
git:
url: https://github.com/media-kit/media-kit
path: media_kit
media_kit_video:
git:
url: https://github.com/media-kit/media-kit
path: media_kit_video
media_kit_libs_video:
git:
url: https://github.com/media-kit/media-kit
path: libs/universal/media_kit_libs_video
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^3.0.0
build_runner: ^2.4.8
injectable_generator: ^2.5.1
auto_route_generator: ^7.3.2
freezed: ^2.4.7
flutter_gen_runner: ^5.4.0
hive_generator: ^2.0.1
json_serializable: ^6.7.1
flutter_gen:
output: lib/presentation/shared/assets/
integrations:
flutter_svg: true
flutter_launcher_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icons/logo/logo.png"
min_sdk_android: 16
flutter:
uses-material-design: true
assets:
- assets/icons/
- assets/docs/
fonts:
- family: Geologica
fonts:
- asset: assets/fonts/Geologica-Black.ttf
- asset: assets/fonts/Geologica-Bold.ttf
- asset: assets/fonts/Geologica-ExtraBold.ttf
- asset: assets/fonts/Geologica-ExtraLight.ttf
- asset: assets/fonts/Geologica-Light.ttf
- asset: assets/fonts/Geologica-Medium.ttf
- asset: assets/fonts/Geologica-Regular.ttf
- asset: assets/fonts/Geologica-SemiBold.ttf
- asset: assets/fonts/Geologica-Thin.ttf
Weird, did you terminate the app and recompile?
Maybe a flutter clean to be sure all is good
Btw
Those are not needed since they are included in the libs before them
media_kit_libs_android_video: ^1.3.6
media_kit_native_event_loop: ^1.0.8
media_kit_libs_ios_video: ^1.1.4
Yep, tried again with flutter clean
. Removed unnecessary packages, recompiled. And still, unfortunately same error is thrown.
@abdelaziz-mahdy Then, tried again with another emulator (Pixel 7 API 33).
ensureInitialized
still fails, but black screen is now gone.
At this point, i dont know what mught be the issue exactly, but maybe your package somehow doesnt support API 34?
@abdelaziz-mahdy Then, tried again with another emulator (Pixel 7 API 33).
ensureInitialized
still fails, but black screen is now gone. At this point, i dont know what mught be the issue exactly, but maybe your package somehow doesnt support API 34?
Well I don't think there should be any problem with API number, but I am not sure
Also these tries with the dependency override? There was a fix I don't think it was released related to the error, this is why I suggested it
note please test on a physical device since simulators are not stable.
Unfortunately, I don’t have physical device on android to test it. But since it worked on another simulator, I guess it should also work on real device. The overrides definitely didn’t help in my case.
Anyways, I appreciate your help
Just a question, do you have catch all the exceptions set to be on
In vscode? I think that's the reason for the ensure error
Yes, they were on. I already figured out that the error is caught on your side. But I’m still frustrated about the reason
Yes, they were on. I already figured out that the error is caught on your side. But I’m still frustrated about the reason
The reason for the error? Is that lib are loaded and some are not based on your configuration and device, so we try to load each of them and if it failed it gets ignored
But if none worked it will throw an exception
I created an empty project to test this problem and it was still. The test image was Android 14.0 (API 34) arm64-v8a
.
The problem seems to only occur on an emulator. It works on my physical device Galaxy S8+ (Android 9.0 API 28).
Emulators are not stable, so as long as the physical device works it's all good
Don't use emulator.
Dont know if its related, but i get this error.
Fix your development environment, don't care about caught exceptions.
When i play media through this plugin on android emulator. Only black screen is shown, but the audio is still playing.
Dont know if its related, but i get this error on
MediaKit.ensureInitialized();
Flutter doctor