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

[ BUG ] : A clear and concise title of the bug #281

Open
Bus42 opened this issue May 9, 2024 · 1 comment
Open

[ BUG ] : A clear and concise title of the bug #281

Bus42 opened this issue May 9, 2024 · 1 comment
Assignees
Labels
Appinio video player This label is used to indicate that this issue belongs to Appinio video player plugin

Comments

@Bus42
Copy link

Bus42 commented May 9, 2024

Plugin name

appinio_video_player

Describe the bug

../storyflix/lib/src/widgets/movie_player.dart:18:8: Error: Type 'CachedVideoPlayerController' not found.
  late CachedVideoPlayerController _videoPlayerController;
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
../storyflix/lib/src/widgets/movie_player.dart:18:8: Error: 'CachedVideoPlayerController' isn't a type.
  late CachedVideoPlayerController _videoPlayerController;
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
../storyflix/lib/src/widgets/movie_player.dart:24:9: Error: The getter 'CachedVideoPlayerController' isn't defined for the class '_MoviePlayerState'.
 - '_MoviePlayerState' is from 'package:storyflix/src/widgets/movie_player.dart' ('../storyflix/lib/src/widgets/movie_player.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'CachedVideoPlayerController'.
        CachedVideoPlayerController.network(widget.videoUrl.toString());
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^

To Reproduce

Steps to reproduce the behavior:

  1. Set up player as per example code in pub.dev
  2. Run the app
  3. Get the error

Expected behavior

the CachedVideoPlayerController class exported by the appinio_video_player package should be available to the consuming app.

Screenshots

N/A - it would only be a picture of the error above

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome 124.0.6367.119
  • Version 22H3

Smartphone (please complete the following information):

  • Device: Pixel 7 Pro
  • OS: Android
  • Browser: stock
  • Version 14

Additional context

This is my implementation:

import 'package:appinio_video_player/appinio_video_player.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';

class MoviePlayer extends StatefulWidget {
  final Uri videoUrl;
  final String title;

  const MoviePlayer({super.key, required this.videoUrl, required this.title});

  @override
  State<MoviePlayer> createState() => _MoviePlayerState();
}

class _MoviePlayerState extends State<MoviePlayer> {
  late CustomVideoPlayerWebController _customVideoPlayerWebController;
  late CustomVideoPlayerController _customVideoPlayerController;
  late CachedVideoPlayerController _videoPlayerController;

  @override
  void initState() {
    super.initState();
    _videoPlayerController =
        CachedVideoPlayerController.network(widget.videoUrl.toString());
    if (kIsWeb) {
      _customVideoPlayerWebController = CustomVideoPlayerWebController(
          webVideoPlayerSettings: CustomVideoPlayerWebSettings(
        src: widget.videoUrl.toString(),
      ));
    } else {
      _customVideoPlayerController = CustomVideoPlayerController(
          context: context, videoPlayerController: _videoPlayerController);
    }
  }

  @override
  void dispose() {
  super.dispose();
    _customVideoPlayerController.dispose();
    _videoPlayerController.dispose();
  }

  @override
  Widget build(BuildContext context) {
    Widget videoPlayer = kIsWeb
        ? CustomVideoPlayerWeb(
            customVideoPlayerWebController: _customVideoPlayerWebController,
          )
        : CustomVideoPlayer(
            customVideoPlayerController: _customVideoPlayerController);

    return Center(
      child: videoPlayer,
    );
  }
}

I don't have any additional relevant information, but I would gladly provide any information needed to fix this.

@Bus42
Copy link
Author

Bus42 commented May 9, 2024

So, I did a little digging and the issue lies with the cached_video_player package. It needs to be updated to be compatible with AGP 8

Incorrect package="com.lazyarts.vikram.cached_video_player" found in source AndroidManifest.xml: C:\Users\gbrew\AppData\Local\Pub\Cache\hosted\pub.dev\cached_video_player-2.0.4\android\src\main\AndroidManifest.xml.
Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
Recommendation: remove package="com.lazyarts.vikram.cached_video_player" from the source AndroidManifest.xml: C:\Users\gbrew\AppData\Local\Pub\Cache\hosted\pub.dev\cached_video_player-2.0.4\android\src\main\AndroidManifest.xml.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cached_video_player:processDebugManifest'.
> A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction
   > Incorrect package="com.lazyarts.vikram.cached_video_player" found in source AndroidManifest.xml: C:\Users\gbrew\AppData\Local\Pub\Cache\hosted\pub.dev\cached_video_player-2.0.4\android\src\main\AndroidManifest.xml.
     Setting the namespace via the package attribute in the source AndroidManifest.xml is no longer supported.
     Recommendation: remove package="com.lazyarts.vikram.cached_video_player" from the source AndroidManifest.xml: C:\Users\gbrew\AppData\Local\Pub\Cache\hosted\pub.dev\cached_video_player-2.0.4\android\src\main\AndroidManifest.xml.

@khanmujeeb687 khanmujeeb687 added the Appinio video player This label is used to indicate that this issue belongs to Appinio video player plugin label Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Appinio video player This label is used to indicate that this issue belongs to Appinio video player plugin
Projects
None yet
Development

No branches or pull requests

2 participants