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

Namespace and hashValues Compatibility Issues #1361

Open
Tepehan opened this issue Dec 14, 2024 · 0 comments
Open

Namespace and hashValues Compatibility Issues #1361

Tepehan opened this issue Dec 14, 2024 · 0 comments
Assignees
Labels
new issue New issue which has not been checked yet

Comments

@Tepehan
Copy link

Tepehan commented Dec 14, 2024

Description

Problem Description:

While using the Better Player package with Flutter Version: [ 3.27.0] and Dart Version: [3.6.0], I encountered the following issues:

  1. Namespace Issue: The build.gradle file requires a namespace to be specified. Without this, the package fails to build.
  2. Deprecated hashValues Method: The usage of hashValues in drm_init_data.dart and scheme_data.dart files results in errors because this method is no longer supported in the newer Dart versions.

Temporary Solution:

To resolve these issues, I made the following manual changes:

[ ] - Added a namespace to the build.gradle file.
[ ] - Replaced all instances of hashValues with Object.hash. For example:

_int get hashCode => Object.hash(schemeType, schemeData);_
However, these fixes require manual intervention and are not ideal for all users.

Environment Details:

Flutter Version: [ 3.27.0]
Dart Version: [3.6.0]
Better Player Version: [0.0.84]

ERROR LOGS
Incorrect package="com.jhomlala.better_player" found in source AndroidManifest.xml: C:\Users\devoloper\AppData\Local\Pub\Cache\hosted\pub.dev\better_player-0.0.84\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.jhomlala.better_player" from the source AndroidManifest.xml: C:\Users\devoloper\AppData\Local\Pub\Cache\hosted\pub.dev\better_player-0.0.84\android\src\main\AndroidManifest.xml.

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':better_player:processDebugManifest'.

../../../AppData/Local/Pub/Cache/.../drm_init_data.dart:22:23: Error: The method 'hashValues' isn't defined for the class 'DrmInitData'.
Try correcting the name to the name of an existing method, or defining a method named 'hashValues'.

Suggested Fixes

  1. Update the package to include a default namespace in the build.gradle file.
  2. Replace all instances of hashValues with Object.hash or Object.hashAll to ensure compatibility with Dart's latest versions.
@Tepehan Tepehan added the new issue New issue which has not been checked yet label Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new issue New issue which has not been checked yet
Projects
None yet
Development

No branches or pull requests

2 participants