Closed droidmonktutorials closed 4 years ago
Does the error go away if you use the same version number for all the modules?
Yes it works, and I have realized that if I want to use exoplayer-core:2.10.7 then I can clone the ExoPlayer repository and depend on the module locally. But it would have been great if we could use the latest version of exoplayer_core with extension_ima without cloning the repository. Is that not possible?
It shouldn't be necessary to clone the sources. It looks like the maven repository has both exoplayer-core:2.10.7 and extension-ima:2.10.7. Could you give some more details on what goes wrong if you try to depend on those?
My bad, it works. I am extremely sorry.
While displaying ads with IMA extension and the ProgressiveMediaSource, I am getting the following error. The app crashed just after the preroll ad completes. On navigating to the class ImaAdsLoader I get the error "Library source does not match the bytecode for class ImaAdsLoader"
java.lang.NoSuchMethodError: No virtual method getAdGroupIndexAfterPositionUs(J)I in class Lcom/google/android/exoplayer2/source/ads/AdPlaybackState; or its super classes (declaration of 'com.google.android.exoplayer2.source.ads.AdPlaybackState' appears in /data/app/com.example.exomedia-pEwo-P6MjYGRL3PeKbTLiw==/base.apk) at com.google.android.exoplayer2.ext.ima.ImaAdsLoader.getContentProgress(ImaAdsLoader.java:758) at com.google.ads.interactivemedia.v3.internal.iu.a(IMASDK:4) at com.google.ads.interactivemedia.v3.internal.jh.handleMessage(IMASDK:27) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6692) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Steps to reproduce : Use the following dependenciesimplementation 'com.google.android.exoplayer:exoplayer-core:2.10.7' implementation 'com.google.android.exoplayer:exoplayer-ui:2.10.7' implementation 'com.google.android.exoplayer:extension-ima:2.9.6'
And initiate the playback with the following code:
` player=ExoPlayerFactory.newSimpleInstance(this,DefaultTrackSelector()) player_view.player=player adsLoader?.setPlayer(player)
The works without any error with the following versions of the libraries and using ExtractorMediaSource:
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.6' implementation 'com.google.android.exoplayer:exoplayer-ui:2.9.6' implementation 'com.google.android.exoplayer:extension-ima:2.9.6'