0

I can check the classes.dex file through analyze apk in Android studio.

For example.

This dex file defines 9214 clasees with 48592 methods, and references 57284 methods.

If the build fails because of a dex error, I will see the following error message.

Too many field references: 70000; max is 65536.
You may try using --multi-dex option.

What exactly does 70000 mean in this error message?
Number of defined method? or Number of referenced Methods?

If the answer is a number of methods, is it possible to do the following result?

This dex file defines 9214 clasees with 60000 methods, and references 70000 methods.

I've already read sentence below.

The Dalvik Executable specification limits the total number of methods that can be referenced within a single DEX file to 65,536

(from Document)

But I don't know exactly what 65536 means.
Please tell me the answer. THX :)

SaeHyun Kim
  • 475
  • 2
  • 8
  • 26

1 Answers1

0

You have to enable multidex for your application. Refer: https://developer.android.com/studio/build/multidex

Guide: How to enable multidexing with the new Android Multidex support library

What exactly does 70000 mean in this error message? Ans: Total methods count in your apk(includes methods count from libraries also).

Harish Jose
  • 326
  • 3
  • 9