Software Archive
Read-only legacy content
17061 Discussions

XDK Error - associated with 64K Reference Limit (I think?)

Luke_H_2
Beginner
829 Views

Hello I was hoping somebody could help me resolve a problem with my XDK game build. 

I have made a game in Construct 2. It builds perfectly in XDK by itself. 

I am currently testing to try and get Google Analytics and Ads into my game. I have used two 3rd party plugins:

For Google Analytics I have used the Cranberrygame Google Analytics Plugin and added the associated plugin to XDK:
https://github.com/AndreasReitberger/google-analytics-plugin.git

For ads I have tried to use Appodeal, adding the associated plugin to XDK:
https://github.com/Tamplier/cordova-plugin.git

Both of these plugins work perfectly when they are installed by themselves in XDK. But as soon as I have them both installed in the same XDK project, I get an error (I have attached whole log of the build to this post):

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexIndexOverflowException:

After doing some research I found that this error is apparently related to a '64K reference limit'. I read about this on developer.android.com. Here is a link to the article... 

I dont really know what to do from here... It seems that both these plugins work very well on their own, so I *should* be able to get them to work together? Im not sure why they would conflict?

Thanks for any advice on this.
 

0 Kudos
11 Replies
Luke_H_2
Beginner
829 Views

Adding additional info to my original post. I received the following advice from a user on another forum:

"...The issue comes up if two or more plugins are using same libaries, but in a diffrent version..."

"...For cocoon you can set an option called "Multidex enabled" to "yes". Then you can build with both plugins.
I'm not using Intel XDK anymore, so I can't say if there is a similar option to check."

So is there an option that allows me to 'enable multidex' with XDK? I guess there isn't because I cant find anything about it online. 

Alternatively, if the problem is that the two plugins are using different versions of the same library, is it possible to remove one library?

Otherwise, is there anything I can do, or ill need to stop using one of the plugins.

Thanks

 

 

0 Kudos
PaulF_IntelCorp
Employee
829 Views

Luke -- if the two plugins are trying to load different versions of the same plugin that is a problem with the plugins that the XDK build system cannot fix, it must be fixed in the plugins. Sorry, but not familiar with "enable multidex" so I cannot help with regard to that question. Since the XDK app is a standard Cordova app, you can always build it using Cordova CLI. Instructions on how to go about doing that can be found here > https://software.intel.com/en-us/forums/intel-xdk/topic/685326#comment-1885369

0 Kudos
Luke_H_2
Beginner
829 Views

Thanks for the reply Paul. 

Paul F. (Intel) wrote:

"...if the two plugins are trying to load different versions of the same plugin that is a problem with the plugins that the XDK build system cannot fix..."

Is that a typo? You mean to say, if the two plugins are trying to load different versions of same library right?

I'll speak to the creators of the plugins and see if I can get help from them and post any advice I get.

0 Kudos
PaulF_IntelCorp
Employee
829 Views

Yes, sorry, I meant library not plugin.

0 Kudos
Luke_H_2
Beginner
829 Views

Paul. How would you interpret this error:

UNEXPECTED TOP-LEVEL EXCEPTION:
      com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzls;

I have removed what I thought was the problematic plugin, but I am still getting this error. 

I have attached the full log to this post. Any chance you could take a look and advise what I could do to fix this? 

Would you advise to try building with Cordova CLI? Would that make a difference in this case?

0 Kudos
PaulF_IntelCorp
Employee
829 Views

Luke -- how large is your www folder + plugins folder + package-assets folder? Above ~400MB starts to cause space build problems in our build system.

0 Kudos
Luke_H_2
Beginner
829 Views

Paul -- The combined size of those folders is less than 100MB. 

The plugins account for most of that (~90MB) while the www folder + images folder + media folder are less than ~10MB together.

***When you say 'package-assets folder' you mean the 'images' and 'media' folders? There are no other folders inside my project.

thanks for the help. 

0 Kudos
PaulF_IntelCorp
Employee
829 Views

Luke -- not clear on precisely what's causing the problem. Might be a plugin that requires a version of a library file that's not on our build system. Certainly worth trying to build with CLI. Use these instructions to convert your app to a CLI app > https://software.intel.com/en-us/forums/intel-xdk/topic/685326#comment-1885369

0 Kudos
Luke_H_2
Beginner
829 Views
Paul -- ok thanks for the info. I'm gearing up to try with CLI. I haven't used it before so I'll need to learn. When you say one of the plugins might use a library not on your build system. Is that something I can fix? What would I need to do? Or is it something that the plugin dev would need to rectify?
0 Kudos
PaulF_IntelCorp
Employee
829 Views

Unfortunately, updating libraries on our build system is not something you can fix, it's something that we need to update. I've requested an update.
 

0 Kudos
PaulF_IntelCorp
Employee
829 Views

Luke -- some additional info from one of our Cordova experts...

UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzls; 

...is probably being caused by two plugins that are referencing Google Services. In this case it looks like you are using the Intel XDK Google Play Services plugin as well as an analytics plugin. Try removing all plugins that might reference google services and see if it resolves the build issue, then add them back, one-at-a-time, to isolate the conflict.

0 Kudos
Reply