ArcDexx
ArcDexx

Reputation: 483

Ads not showing up in release mode

I have an app which is supposed to show some ads. In debug mode, everything runs fine, ads are showing up as they should be.

But in release mode, nothing happens, even though the exact same code is running (and the same URLs are used). I also have multiple environments (test/production), it works fine in test/debug and production/debug but fails in both test/release and production/release.

Note that everything else is working fine in release mode. No relevant topic were found anywhere about this kind of bug.

Upvotes: 4

Views: 3122

Answers (1)

Gil Moshayof
Gil Moshayof

Reputation: 16761

As you confirmed, this is a Proguard issue.

Proguard's main function is to minify your code, replacing function names such as "doImportantThing" to "a" etc, making it more light weight and harder to reverse engineer.

A quick fix would be to disable minification by setting minifyEnabled to false in the gradle release block, however this would mean that Proguard is disabled and does not perform the important functions mentioned earlier.

The real fix would be to edit your proguard-rules file, and make sure Proguard excludes certain classes from the minification process.

Here is a small guide on how to use & configure Proguard, but you can find a lot more content on the web.

Hope this helps.

Upvotes: 3

Related Questions