Mopub issue with proguard - NativeVideoController

mopub
android

#1

Hi

I am having an issue with mopub and proguard on android. For some reason it is giving me the following issue:

Warning: com.mopub.nativeads.NativeVideoController: can’t find referenced method ‘MediaCodecVideoTrackRenderer(com.google.android.exoplayer.SampleSource,int,long,android.os.Handler,com.google.android.exoplayer.MediaCodecVideoTrackRenderer$EventListener,int)’ in program class com.google.android.exoplayer.MediaCodecVideoTrackRenderer
Warning: com.mopub.nativeads.NativeVideoController: can’t find referenced method ‘MediaCodecAudioTrackRenderer(com.google.android.exoplayer.SampleSource)’ in program class com.google.android.exoplayer.MediaCodecAudioTrackRenderer

Can anyone please point me in the right direction as to what I would need to add to proguard to remove this warning?


#2

After some more investigation I don’t think the issue is proguard.

I am using the following:

compile(‘com.mopub:mopub-sdk:4.4.1@aar’) {
transitive = true
}
compile 'com.google.android.gms:play-services-base:8.4.0’
compile ‘com.google.android.gms:play-services-ads:8.4.0’

Also please take note that my app is a radio streaming app and I am using ExoPlayer was the audio player.
I am using v1.5.6 of the ExoPlayer. It seems that the same version of ExoPlayer is also being used by the MoPub sdk. Which is good :slight_smile:

If you look closely though the Warning says the following:

com.mopub.nativeads.NativeVideoController: can’t find referenced method ‘MediaCodecVideoTrackRenderer(com.google.android.exoplayer.SampleSource,int,long,android.os.Handler,com.google.android.exoplayer.MediaCodecVideoTrackRenderer$EventListener,int)’

There is no constructor that looks like this. The MoPub NativeVideoController is referencing this method, but it does not exist. If I navigate to the NativeVideoController class at line 420 there is the following:

mVideoTrackRenderer = new MediaCodecVideoTrackRenderer(
sampleSource, MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT_WITH_CROPPING,
0, mHandler, null, 10);

Android Studio is showing an error saying that that constructor does not exist. All the constructors in the MediaCodecVideoTrackRenderer take Context as the first parameter. I don’t actually know how this code was compiled because it is a compile time error.

On another note, the line right after that:

mAudioTrackRenderer = new MediaCodecAudioTrackRenderer(sampleSource);

The same issue is prevalent here. MediaCodecAudioTrackRenderer has to take Context as the first parameter.

If I am barking up the wrong tree and there is no issue here please let me know what I have been doing wrong, but this really does not make any sense to me.


#3

Hey, I am facing the same issue. Please help to resolve this.


#4

Hi @richardkuiper and @sakshamkeshri,

Thanks for reaching out about this! We updated support from Exoplayer 1.4.2 to 1.5.6 in MoPub SDK version 4.5.1. Can you try updating to the latest version of the MoPub SDK to see if that resolves the issue?

If you continue to have trouble, please feel free to reach out to our Support Team at support@mopub.com with the details of your issue and someone on the team will be able to help you troubleshoot this further.

Thanks!