kryssi
Junior Member
Posts: 19
|
Post by kryssi on Feb 26, 2024 12:29:48 GMT
Dear team,
Now I'm wanted to add fcm-push to my project but after doing that I'm unable to build since max class limit of single dex file is reached.
From build tools 33.0.2 I get the following message:
Error: Cannot fit requested classes in a single dex file (# fields: 66336 > 65536). Try supplying a main-dex list
Compilation failed
From build tools 30.0.3 I get:
trouble writing output: Too many field references to fit in one dex file: 66337; max is 65536.
You may try using multi-dex. If multi-dex is enabled then the list of classes for the main dex list is too large.
Any ideas how to go around this limitation?
|
|
|
Post by Alex Epifanov on Feb 27, 2024 10:00:28 GMT
|
|
kryssi
Junior Member
Posts: 19
|
Post by kryssi on Feb 27, 2024 11:00:23 GMT
Alex Epifanov This is exactly the issue I'm experiencing, I wanted to try out push notifications and then I would brake the limit. I can't take really anything else out of this project. Is is possible to take out libraries partially like Zing library but leave Zebra barcode support?
|
|
kryssi
Junior Member
Posts: 19
|
Post by kryssi on Feb 27, 2024 11:04:03 GMT
Alex Epifanov here is the breakdown of the symbol references by packages and classes: trouble writing output: Too many field references to fit in one dex file: 66337; max is 65536.
You may try using multi-dex. If multi-dex is enabled then the list of classes for the main dex list is too large.
References by package:
3 android.accounts
40 android.app
1 android.content
42 android.content.pm
17 android.content.res
3 android.database
102 android.graphics
5 android.hardware
3 android.net
36 android.os
3 android.print
10 android.provider
6 android.support.v4.app
12 android.support.v4.os
1 android.system
11 android.text
1 android.text.util
17 android.util
21 android.view
17 android.view.accessibility
6 android.view.inputmethod
1 android.view.textclassifier
8 android.webkit
17 android.widget
1994 androidx.activity
2 androidx.activity.contextaware
43 androidx.activity.result
8 androidx.activity.result.contract
22 androidx.annotation
3 androidx.annotation.experimental
1954 androidx.appcompat
397 androidx.appcompat.app
6 androidx.appcompat.content.res
109 androidx.appcompat.graphics.drawable
1954 androidx.appcompat.resources
1 androidx.appcompat.text
85 androidx.appcompat.view
265 androidx.appcompat.view.menu
898 androidx.appcompat.widget
11 androidx.arch.core.executor
14 androidx.arch.core.internal
75 androidx.collection
1954 androidx.core
11 androidx.core.accessibilityservice
629 androidx.core.app
34 androidx.core.content
44 androidx.core.content.pm
36 androidx.core.content.res
103 androidx.core.graphics
70 androidx.core.graphics.drawable
3 androidx.core.hardware.display
6 androidx.core.hardware.fingerprint
11 androidx.core.internal.view
57 androidx.core.location
14 androidx.core.net
32 androidx.core.os
96 androidx.core.provider
79 androidx.core.text
31 androidx.core.text.util
45 androidx.core.util
394 androidx.core.view
168 androidx.core.view.accessibility
3 androidx.core.view.animation
32 androidx.core.view.inputmethod
125 androidx.core.widget
23 androidx.cursoradapter.widget
1954 androidx.customview
3 androidx.customview.view
61 androidx.customview.widget
9 androidx.documentfile.provider
1954 androidx.drawerlayout
84 androidx.drawerlayout.widget
1954 androidx.fragment
597 androidx.fragment.app
5 androidx.interpolator.view.animation
3 androidx.legacy.content
1954 androidx.legacy.coreutils
129 androidx.lifecycle
1954 androidx.lifecycle.runtime
1954 androidx.lifecycle.viewmodel
1954 androidx.lifecycle.viewmodel.savedstate
1954 androidx.loader
16 androidx.loader.app
60 androidx.loader.content
17 androidx.localbroadcastmanager.content
44 androidx.print
1967 androidx.savedstate
6 androidx.tracing
1954 androidx.vectordrawable
1954 androidx.vectordrawable.animated
210 androidx.vectordrawable.graphics.drawable
69 androidx.versionedparcelable
1954 androidx.viewpager
155 androidx.viewpager.widget
14 com.google.android.datatransport
6 com.google.android.datatransport.backend.cct
51 com.google.android.datatransport.cct
161 com.google.android.datatransport.cct.internal
69 com.google.android.datatransport.runtime
30 com.google.android.datatransport.runtime.backends
23 com.google.android.datatransport.runtime.scheduling
78 com.google.android.datatransport.runtime.scheduling.jobscheduling
77 com.google.android.datatransport.runtime.scheduling.persistence
3 com.google.android.datatransport.runtime.time
2 com.google.android.datatransport.runtime.util
20 com.google.android.gms.actions
47 com.google.android.gms.auth.api.signin
10 com.google.android.gms.auth.api.signin.internal
1954 com.google.android.gms.base
50 com.google.android.gms.clearcut
71 com.google.android.gms.cloudmessaging
2093 com.google.android.gms.common
101 com.google.android.gms.common.api
357 com.google.android.gms.common.api.internal
18 com.google.android.gms.common.config
43 com.google.android.gms.common.data
44 com.google.android.gms.common.images
201 com.google.android.gms.common.internal
3 com.google.android.gms.common.internal.constants
1 com.google.android.gms.common.internal.safeparcel
5 com.google.android.gms.common.internal.service
4 com.google.android.gms.common.logging
1 com.google.android.gms.common.providers
4 com.google.android.gms.common.server
12 com.google.android.gms.common.server.converter
53 com.google.android.gms.common.server.response
1 com.google.android.gms.common.sqlite
39 com.google.android.gms.common.stats
49 com.google.android.gms.common.util
10 com.google.android.gms.common.util.concurrent
5 com.google.android.gms.common.wrappers
25 com.google.android.gms.dynamic
21 com.google.android.gms.dynamite
2 com.google.android.gms.dynamite.descriptors.com.google.android.gms.flags
12 com.google.android.gms.flags
16 com.google.android.gms.flags.impl
30 com.google.android.gms.internal.base
1860 com.google.android.gms.internal.clearcut
6 com.google.android.gms.internal.cloudmessaging
6 com.google.android.gms.internal.common
12 com.google.android.gms.internal.firebase_messaging
4 com.google.android.gms.internal.flags
21 com.google.android.gms.internal.phenotype
812 com.google.android.gms.internal.vision
63 com.google.android.gms.phenotype
6 com.google.android.gms.security
18 com.google.android.gms.signin
18 com.google.android.gms.signin.internal
27 com.google.android.gms.stats
66 com.google.android.gms.tasks
73 com.google.android.gms.vision
132 com.google.android.gms.vision.barcode
11 com.google.android.gms.vision.clearcut
65 com.google.android.gms.vision.face
32 com.google.android.gms.vision.face.internal.client
1 com.google.android.gms.vision.internal
11 com.google.android.gms.vision.text
74 com.google.barcodereader
67 com.google.barcodereader.ui.camera
2044 com.google.firebase
15 com.google.firebase.analytics.connector
83 com.google.firebase.components
1961 com.google.firebase.datatransport
2 com.google.firebase.emulators
4 com.google.firebase.encoders
26 com.google.firebase.encoders.json
2 com.google.firebase.events
30 com.google.firebase.heartbeatinfo
73 com.google.firebase.iid
2021 com.google.firebase.installations
1960 com.google.firebase.installations.interop
41 com.google.firebase.installations.local
60 com.google.firebase.installations.remote
1 com.google.firebase.installations.time
6 com.google.firebase.internal
2283 com.google.firebase.messaging
9 com.google.firebase.platforminfo
2 com.google.firebase.provider
54 com.google.zxing
104 com.google.zxing.client.android
40 com.google.zxing.client.android.camera
74 com.google.zxing.client.result
18 com.google.zxing.client.result.optional
42 com.google.zxing.common
7 com.google.zxing.common.detector
11 com.google.zxing.common.reedsolomon
2 com.google.zxing.datamatrix
29 com.google.zxing.datamatrix.decoder
6 com.google.zxing.datamatrix.detector
3 com.google.zxing.multi
1 com.google.zxing.multi.qrcode
6 com.google.zxing.multi.qrcode.detector
74 com.google.zxing.oned
32 com.google.zxing.oned.rss
27 com.google.zxing.oned.rss.expanded
52 com.google.zxing.oned.rss.expanded.decoders
2 com.google.zxing.pdf417
39 com.google.zxing.pdf417.decoder
8 com.google.zxing.pdf417.detector
3 com.google.zxing.qrcode
43 com.google.zxing.qrcode.decoder
28 com.google.zxing.qrcode.detector
27 com.google.zxing.qrcode.encoder
1510 com.rho.barcode
416 com.rho.barcode.emdk3
229 com.rho.camera
8 com.rho.emdk3
34 com.rho.intent
62 com.rho.keycapture
33 com.rho.nativetabbar
24 com.rho.nativetoolbar
3 com.rho.network
104 com.rho.notification
70 com.rho.videocapture
161 com.rho.webview
2240 com.rhomobile.rhodes
41 com.rhomobile.rhodes.api
38 com.rhomobile.rhodes.datetime
48 com.rhomobile.rhodes.event
63 com.rhomobile.rhodes.extmanager
8 com.rhomobile.rhodes.fcm
9 com.rhomobile.rhodes.file
33 com.rhomobile.rhodes.geolocation
84 com.rhomobile.rhodes.mainview
105 com.rhomobile.rhodes.mapview
4 com.rhomobile.rhodes.nativeview
15 com.rhomobile.rhodes.osfunctionality
25 com.rhomobile.rhodes.phonebook
36 com.rhomobile.rhodes.socket
32 com.rhomobile.rhodes.ui
14 com.rhomobile.rhodes.uri
15 com.rhomobile.rhodes.util
93 com.rhomobile.rhodes.webview
3 com.symbol.emdk
295 com.symbol.emdk.barcode
30 dagger.internal
1954 is.edico.delivery
1 java.io
13 java.lang
13 java.lang.annotation
2 java.nio
1 java.nio.channels
1 java.security.cert
1 java.security.spec
13 java.util
6 java.util.concurrent
3 java.util.logging
2 javax.crypto.spec
9 javax.net.ssl
1 kotlin
651 org.conscrypt
72 org.conscrypt.ct
rake aborted!
Error running DEX builder
|
|
|
Post by Alex Epifanov on Feb 27, 2024 11:19:30 GMT
As per google doc suggests: developer.android.com/build/multidexNote: If your minSdkVersion is set to 21 or higher, multidex is enabled by default and you don't need the multidex library. What's your min SDK? Can you make it 21+? >Is is possible to take out libraries partially like Zing library but leave Zebra barcode support? It is possible but it would need a team effort to refactor the extension code, we don't have it currently in our plans.
|
|
kryssi
Junior Member
Posts: 19
|
Post by kryssi on Feb 27, 2024 12:14:09 GMT
The sad thing is that minSDK in this project is 22. I also tried to add this flag in Android settings: multiDexEnabled: true but it doesn't fix it.
It looks like we're hitting the condition nr. 2 of the error message:
If multi-dex is enabled then the list of classes for the main dex list is too large.
So the next question is if we can control what goes into "main dex list" ?
|
|
|
Post by Alex Epifanov on Feb 27, 2024 16:00:11 GMT
> So the next question is if we can control what goes into "main dex list" ? That's basically combined from the Java code entities ( properties, members etc ) totally packaged in your app. So it can be controlled by reducing/optimizing Java dependencies and Java code in Rhodes.
We only had this reported once, before you posted. I wonder what can be unoptimized in your config. Especially about references to GMS. Would you share your build.yml and final AndroidManifest.xml located in bin/tmp after you build the app?
|
|
kryssi
Junior Member
Posts: 19
|
Post by kryssi on Feb 28, 2024 12:37:43 GMT
|
|
|
Post by Alex Epifanov on Mar 5, 2024 13:06:28 GMT
We seem to have found a resolution for that and will make a patch soon.
|
|
|
Post by Dmitriy Zhigulskiy on Mar 5, 2024 15:33:47 GMT
|
|
|
Post by Alex Epifanov on Mar 12, 2024 13:02:32 GMT
kryssi, did you have a chance to try the patch? Was it helpful?
|
|
|
Post by Alex Epifanov on Apr 10, 2024 11:16:31 GMT
|
|
kryssi
Junior Member
Posts: 19
|
Post by kryssi on Apr 10, 2024 11:27:12 GMT
I was actually on vacation when you did the fix, I will test the latest master soon.
|
|