Android Question Is it possible to get around the "Too many method references" problem yet

Brian Robinson

Active Member
Licensed User
Longtime User
Hi All,

I am getting this error again after excluding what Erel suggested on Google Play Services .Jar file.

B4A version: 5.80
Parsing code. (0.11s)
Compiling code. (0.35s)
Compiling layouts code. (0.02s)
Generating R file. (0.67s)
Compiling generated Java code. (3.02s)
Convert byte code - optimized dex. Error
trouble writing output: Too many method references: 73236; max is 65536.
You may try using --multi-dex option.

The problem is that I have tried to integrate Appodeal into my app, which uses a lot of libraries from all the big Ad networks.

I did manage to exclude enough to get it down below the threshold (Excluding Amazon adverts was a big one), which I guess is a good thing as it tightens up the final .APK file, but I am wondering whether we will get to the stage of actually requiring that many method calls? After all, maybe I would like to display ads from Amazon.

Any thoughts?

Brian
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

Brian Robinson

Active Member
Licensed User
Longtime User
Hi DonManfred,

Thanks for your reply. I have upgraded to 5.8 as you can see at the top of my post where the output of the build is.

As I said, I managed to exclude enough classes to bring it down to below the level, but I do wonder if anyone has hit that limit, and found another way around it?

My exclusion list looks like this:

B4X:
    #ExcludeClasses: .games, .drive, .fitness, .wearable, .measurement, .cast, .auth, .nearby, com.amazon.device.ads
#ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm, ru.mail, com.facebook, android.support.v4.media.session
Cheers
Brian
 
Upvote 0

johndb

Active Member
Licensed User
Longtime User
Hi DonManfred,

Thanks for your reply. I have upgraded to 5.8 as you can see at the top of my post where the output of the build is.

As I said, I managed to exclude enough classes to bring it down to below the level, but I do wonder if anyone has hit that limit, and found another way around it?

My exclusion list looks like this:

B4X:
    #ExcludeClasses: .games, .drive, .fitness, .wearable, .measurement, .cast, .auth, .nearby, com.amazon.device.ads
#ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm, ru.mail, com.facebook, android.support.v4.media.session
Cheers
Brian
I also hit the limit on 2 of my largest projects but was able to reduce the limit by excluding the google classes as you had done. I hope I don't exceed the limit again :(

John
 
Upvote 0
Top