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

DuplicateClass Conflict with com.google.guava.guava-28.1-android.jar and guava-31.1-android.jar #1182

Closed
AshleyTuring opened this issue May 19, 2022 · 2 comments

Comments

@AshleyTuring
Copy link

Describe the issue
Player does not play on Android. Same code works on iOS.

The line of code breaking on Android is:
bool isOpening = videoPlayer.OpenMedia(new MediaPath(videoClipUrls[j], MediaPathType.AbsolutePathOrURL), autoPlay: false);

NOTE:

We had duplicateClass

#630

We solved this by DELETING ONE ONLY of the following jar files:

  1. Assets\Plugins\Android\com.google.guava.guava-28.1-android.jar
    or
  2. \Assets\AVProVideo\Runtime\Plugins\Android\guava-31.1-android.jar

To Reproduce

  1. Install Unity 2020.3.1f1

  2. Install Firebase 7.2.0 SDK all packages

  3. Install AVPro "AVPro Video v2.5.0 - 5 May 2022"

  4. Run this code

    for (int j = 0; j < videoClipUrls.Count; j++)
    {

             _fuckup.text += "Creating media player: " + j;
    
             //Create new Object to hold the Video and the sound then make it a child of this object
             GameObject vidHolder = new GameObject("VP" + j);
    
    
    
    
             MediaPlayer videoPlayer = vidHolder.AddComponent<MediaPlayer>();
             //videoPlayerList.Add(videoPlayer);
    
    
             ////Add VideoPlayer to the GameObject
             //VideoPlayer videoPlayer = vidHolder.AddComponent<VideoPlayer>();
             //    videoPlayerList.Add(videoPlayer);
    
             //Add AudioSource to  the GameObject
             //AudioSource audioSource = vidHolder.AddComponent<AudioSource>();
    
             //Disable Play on Awake for both Video and Audio
             //videoPlayer.playOnAwake = false;
             //audioSource.playOnAwake = false;
    
             videoPlayer.AutoStart = false;
    
             _fuckup.text += "OpenMedia starting: " + videoClipUrls[j];
    
             bool isOpening = videoPlayer.OpenMedia(new MediaPath(videoClipUrls[j], MediaPathType.AbsolutePathOrURL), autoPlay: false);
    
    
             _fuckup.text += "OpenMedia Completed: " + videoClipUrls[j];
    
             //Changing the media hints for content loaded via Path
    
    
             _fuckup.text += "getting hints: ";
    
             MediaHints hints = videoPlayer.FallbackMediaHints;
             hints.stereoPacking = StereoPacking.TopBottom;
    
             _fuckup.text += "settings hints: ";
    
             videoPlayer.FallbackMediaHints = hints;
    
    
             // UNCOMMENT HERE
             ////We want to play from video clip not from url
             //videoPlayer.source = VideoSource.Url;
    
    
    
             ////Set video Clip To Play 
             //videoPlayer.url = videoClipUrls[j];
             ////Set Audio Output to AudioSource
             //videoPlayer.audioOutputMode = VideoAudioOutputMode.Direct;
             //videoPlayer.isLooping = true;
             ////Assign the Audio from Video to AudioSource to be played
             //videoPlayer.EnableAudioTrack(0, true);
             //videoPlayer.SetTargetAudioSource(0, audioSource);
    
    
    
    
             _fuckup.text += "adding Listener: ";
    
             videoPlayer.Events.AddListener(HandleEvent);
    
    
         }
     }
     catch (Exception e)
     {
    
         Settings.LogError(e);
         _fuckup.text += e.ToString();
     }
    
  5. Deploy on iPhone works

  6. Deploy on Android Samsung S10, Pixel 5, all

Logs
See screenshots

Screenshots
PHOTO-2022-05-19-16-55-15

Videos
If applicable, add a copy of your video or the URL

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Instead email the link to us unitysupport@renderheads.com

@AshleyTuring
Copy link
Author

This issue has been resolved.

Steps to solve the problem:

  1. Ensure "Project Settings/Player/Publishing" Minify disabled
  2. Look for alternate .guava.jar files and remove if not in AVPro file

@Ste-RH
Copy link

Ste-RH commented May 20, 2022

Thanks for reporting this @livetreetech. In our last release (v2.5.0) we were forced to upgrade the version of the guava library due to ExoPlayer requiring it. We did put in a pre-build process step to detect and offer removal of the old guava library file found in releases prior to v2.5.0 (guava-27.1-android). But this is limited to AVPro Video plugin files.

It looks in your case like guava.28.1-android was brought in by another plugin (Firebase I assume). This will be the case for any plugins that also use guava I suspect.

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

No branches or pull requests

2 participants