Android Question multi-dex option

SMOOTSARA

Active Member
Licensed User
Longtime User
Hello friends :)

Today, after testing the app on Android versions 4 and 7 and ensuring the functioning of Syh program I wanted to app released.
But I found out that a new post has been released for updates and I updated these libraries and update sdk manager


Dependencies: FirebaseAdmob v1.50+ (https://www.b4x.com/android/forum/threads/updates-to-internal-libraries.59340/#post-590564)

sdk
https://www.b4x.com/android/forum/threads/updates-to-internal-libraries.59340/#post-591400
-------------------------------------------------------------------------
Unfortunately, there were many errors after updating

1-
B4X:
B4A Version: 8.00
Parsing code.    (0.13s)
Compiling code.    (0.44s)
    
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.    (0.06s)
Organizing libraries.    (6.24s)
Generating R file.    (1.56s)
Compiling generated Java code.    (8.83s)
Convert byte code - optimized dex.    Error
warning: Ignoring InnerClasses attribute for an anonymous inner class
(net.lingala.zip4j.unzip.Unzip$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(net.lingala.zip4j.unzip.Unzip$2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(net.lingala.zip4j.util.ArchiveMaintainer$2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(net.lingala.zip4j.zip.ZipEngine$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(net.lingala.zip4j.util.ArchiveMaintainer$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
trouble writing output: Too many field references: 71923; max is 65536.
You may try using --multi-dex option.
References by package:
     3 adr.stringfunctions
     2 android.accounts
    30 android.app
     8 android.arch.core.executor
    14 android.arch.core.internal
    76 android.arch.lifecycle
     1 android.content
    47 android.content.pm
    10 android.content.res
     3 android.database
    53 android.graphics
     3 android.hardware
     1 android.location


i useed this code in main activity

B4X:
#MultiDex: True

I passed this problem.
But another problem has arisen
The app runs on Android version 7:)
But in version 4.4.2 no :(
 

SMOOTSARA

Active Member
Licensed User
Longtime User
What happens when you run it? Logs?


Hi Erel :)

No messages will be displayed on log section the during installation.

The issue is that sometimes the installation report is
B4X:
B4A Version: 8.00
Parsing code.    (0.15s)
Compiling code.    (0.63s)
    
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.    (0.11s)
Organizing libraries.    (9.54s)
Generating R file.    (3.00s)
Compiling generated Java code.    (11.33s)
Convert byte code - optimized dex.    (42.30s)
    Optimized dexer failed. Switching to Standard dexer.
Packaging files.    (4.97s)
Copying libraries resources    (0.18s)
    Found 29 resource files.
Signing package file (private key).    (2.76s)
ZipAlign file.    (0.17s)
Installing file to device.    (14.47s)
    Device serial: emulator-5554
Completed successfully.

And sometimes this

B4X:
B4A Version: 8.00
Parsing code.    (0.16s)
Compiling code.    (0.45s)
    
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.    (0.06s)
Organizing libraries.    (0.00s)
Generating R file.    (1.79s)
Compiling generated Java code.    (8.43s)
Convert byte code - optimized dex.    (31.15s)
Packaging files.    (3.05s)
Copying libraries resources    (0.13s)
    Found 29 resource files.
Signing package file (private key).    (2.10s)
ZipAlign file.    (0.11s)
Installing file to device.    (10.34s)
    Device serial: emulator-5554
Completed successfully.



--------------------------------
But in either case, the program is not running
And there is no error reporting

Thanks for your attention
 
Upvote 0

SMOOTSARA

Active Member
Licensed User
Longtime User
You should test it on a real device.

hi Erel :)

I've tested on real devices
Exits the app icon by clicking the app icon
----------------------------
my Currently projects have been blocked
This problem has arisen after the update of new libraries
I'm waiting for your answer to continue
------------------------------------
 

Attachments

  • P_20180530_092309.jpg
    P_20180530_092309.jpg
    126.3 KB · Views: 346
  • P_20180530_092325.jpg
    P_20180530_092325.jpg
    73.5 KB · Views: 337
Upvote 0

SMOOTSARA

Active Member
Licensed User
Longtime User
Note that FirebaseAdMob v1.50 is almost the same size as the previous version. It is something else that added many references.

Can you post the full list of references that you see with #MultiDex set to false?
B4X:
B4A Version: 8.30 BETA #1
Parsing code.    (0.14s)
Compiling code.    (0.83s)
    
ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code.    (0.13s)
Organizing libraries.    (10.85s)
Generating R file.    (3.30s)
Compiling generated Java code.    (17.06s)
Convert byte code - optimized dex.    Error
warning: Ignoring InnerClasses attribute for an anonymous inner class
(net.lingala.zip4j.unzip.Unzip$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(net.lingala.zip4j.unzip.Unzip$2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(net.lingala.zip4j.util.ArchiveMaintainer$2) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(net.lingala.zip4j.zip.ZipEngine$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
warning: Ignoring InnerClasses attribute for an anonymous inner class
(net.lingala.zip4j.util.ArchiveMaintainer$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is *not* an inner class.
trouble writing output: Too many field references to fit in one dex file: 71930; 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 adr.stringfunctions
     2 android.accounts
    30 android.app
     8 android.arch.core.executor
    14 android.arch.core.internal
    76 android.arch.lifecycle
     1 android.content
    47 android.content.pm
    10 android.content.res
     3 android.database
    53 android.graphics
     3 android.hardware
     1 android.location
     5 android.media
     1 android.media.browse
     2 android.net
     3 android.net.wifi
    47 android.os
     3 android.print
    10 android.provider
     1 android.renderscript
    13 android.support.annotation
  2426 android.support.compat
  2426 android.support.coreui
  2538 android.support.customtabs
    57 android.support.design.widget
   207 android.support.graphics.drawable
  2426 android.support.mediacompat
    10 android.support.v13.view
    19 android.support.v13.view.inputmethod
    11 android.support.v4.accessibilityservice
   926 android.support.v4.app
   107 android.support.v4.content
    14 android.support.v4.content.pm
    20 android.support.v4.content.res
    50 android.support.v4.graphics
    56 android.support.v4.graphics.drawable
     4 android.support.v4.hardware.display
     6 android.support.v4.hardware.fingerprint
    11 android.support.v4.internal.view
   434 android.support.v4.media
     8 android.support.v4.media.app
   377 android.support.v4.media.session
     5 android.support.v4.net
    37 android.support.v4.os
    52 android.support.v4.print
   100 android.support.v4.provider
    51 android.support.v4.text
     6 android.support.v4.text.util
   118 android.support.v4.util
   413 android.support.v4.view
   118 android.support.v4.view.accessibility
     8 android.support.v4.view.animation
   472 android.support.v4.widget
   403 android.support.v7.app
  2426 android.support.v7.appcompat
  2426 android.support.v7.cardview
     8 android.support.v7.content.res
    18 android.support.v7.graphics.drawable
  2426 android.support.v7.recyclerview
    23 android.support.v7.recyclerview.extensions
     1 android.support.v7.text
   123 android.support.v7.util
    85 android.support.v7.view
   270 android.support.v7.view.menu
  1595 android.support.v7.widget
    89 android.support.v7.widget.helper
     1 android.support.v7.widget.util
     1 android.system
     7 android.text
     1 android.text.util
    14 android.util
    24 android.view
     8 android.view.accessibility
     6 android.view.inputmethod
     5 android.webkit
    15 android.widget
    55 androidx.browser.browseractions
   131 anywheresoftware.b4a
    27 anywheresoftware.b4a.admobwrapper
    49 anywheresoftware.b4a.agraham.gifdecoder
    25 anywheresoftware.b4a.agraham.reflection
    29 anywheresoftware.b4a.ariagplib
    25 anywheresoftware.b4a.inappbilling3
    94 anywheresoftware.b4a.keywords
   125 anywheresoftware.b4a.keywords.constants
     3 anywheresoftware.b4a.obejcts
     4 anywheresoftware.b4a.object
  2867 anywheresoftware.b4a.objects
    14 anywheresoftware.b4a.objects.collections
    15 anywheresoftware.b4a.objects.drawable
    10 anywheresoftware.b4a.objects.streams
   173 anywheresoftware.b4a.phone
    13 anywheresoftware.b4a.sql
    29 anywheresoftware.b4h.okhttp
    15 anywheresoftware.b4j.object
    17 aria.photoshop
     1 aria.photoshop.blur
     6 b4a.example
    27 barxdroid.NotificationBuilder
  2446 co.ronash.pushe
    15 co.ronash.pushe.a
    21 co.ronash.pushe.a.a
    41 co.ronash.pushe.activities
    14 co.ronash.pushe.b
     7 co.ronash.pushe.b.a
    40 co.ronash.pushe.c.a
    17 co.ronash.pushe.d
    33 co.ronash.pushe.e
     4 co.ronash.pushe.g
     8 co.ronash.pushe.h
    80 co.ronash.pushe.h.a
    35 co.ronash.pushe.h.b
    12 co.ronash.pushe.i
     5 co.ronash.pushe.j
    10 co.ronash.pushe.k
    71 co.ronash.pushe.log
     5 co.ronash.pushe.log.handlers
     4 co.ronash.pushe.receiver
     4 co.ronash.pushe.service
     9 co.ronash.pushe.task
     9 co.ronash.pushe.task.a
     3 co.ronash.pushe.task.scheduler.a
    19 co.ronash.pushe.task.scheduler.b
     1 co.ronash.pushe.task.scheduler.gcm
     4 com.ParsParticlesDrawable
    13 com.ParsQue
  2426 com.afollestad.materialdialogs
    53 com.airbnb.lottie
    65 com.airbnb.lottie.animatable
    53 com.airbnb.lottie.animation
   128 com.airbnb.lottie.layers
   104 com.airbnb.lottie.model
     4 com.airbnb.lottie.utils
     2 com.amazon.device.iap.model
     7 com.android.vending.billing
    80 com.balysv.materialripple
    44 com.doctoror.particlesdrawable
     1 com.draganddrop.interfaces
   138 com.evernote.android.job
     4 com.evernote.android.job.gcm
    24 com.evernote.android.job.util
    16 com.evernote.android.job.util.support
    14 com.evernote.android.job.v14
     2 com.evernote.android.job.v19
    11 com.evernote.android.job.v21
     3 com.evernote.android.job.v24
    32 com.futuremind.recyclerviewfastscroll
    26 com.futuremind.recyclerviewfastscroll.viewprovider
    41 com.fxn.cue
    13 com.fxn.cue.enums
    46 com.github.aakira.expandablelayout
     2 com.github.aakira.expandablelayout.util
    11 com.github.rubensousa.gravitysnaphelper
    25 com.google.ads
    67 com.google.ads.consent
    24 com.google.ads.mediation
     1 com.google.ads.mediation.admob
    11 com.google.ads.mediation.customevent
    20 com.google.android.gms.actions
  2480 com.google.android.gms.ads
    12 com.google.android.gms.ads.doubleclick
    61 com.google.android.gms.ads.formats
    16 com.google.android.gms.ads.identifier
  2426 com.google.android.gms.ads.impl
   331 com.google.android.gms.ads.internal
    70 com.google.android.gms.ads.internal.gmsg
    71 com.google.android.gms.ads.internal.overlay
    42 com.google.android.gms.ads.mediation
     1 com.google.android.gms.ads.mediation.admob
    12 com.google.android.gms.ads.mediation.customevent
     1 com.google.android.gms.ads.reward.mediation
    20 com.google.android.gms.ads.search
    48 com.google.android.gms.auth.api.signin
    11 com.google.android.gms.auth.api.signin.internal
  2426 com.google.android.gms.base
  2611 com.google.android.gms.common
   102 com.google.android.gms.common.api
   355 com.google.android.gms.common.api.internal
    26 com.google.android.gms.common.config
    86 com.google.android.gms.common.data
    60 com.google.android.gms.common.images
    39 com.google.android.gms.common.images.internal
   269 com.google.android.gms.common.internal
    12 com.google.android.gms.common.internal.constants
     1 com.google.android.gms.common.internal.safeparcel
     6 com.google.android.gms.common.internal.service
     4 com.google.android.gms.common.logging
    14 com.google.android.gms.common.net
    13 com.google.android.gms.common.oob
     1 com.google.android.gms.common.providers
    18 com.google.android.gms.common.server
    15 com.google.android.gms.common.server.converter
    76 com.google.android.gms.common.server.response
     1 com.google.android.gms.common.sqlite
    75 com.google.android.gms.common.stats
    97 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
    37 com.google.android.gms.dynamite
     2 com.google.android.gms.dynamite.descriptors.com.google.android.gms.ads.dynamite
     2 com.google.android.gms.dynamite.descriptors.com.google.android.gms.flags
    12 com.google.android.gms.flags
    20 com.google.android.gms.flags.impl
  2534 com.google.android.gms.gcm
    82 com.google.android.gms.iid
  4715 com.google.android.gms.internal.ads
     4 com.google.android.gms.internal.ads_identifier
    11 com.google.android.gms.internal.firebase_messaging
    10 com.google.android.gms.internal.gcm
  1112 com.google.android.gms.internal.measurement
    30 com.google.android.gms.internal.stable
     5 com.google.android.gms.location
    35 com.google.android.gms.measurement
     6 com.google.android.gms.security
    26 com.google.android.gms.signin
    43 com.google.android.gms.signin.internal
    31 com.google.android.gms.stats
    16 com.google.android.gms.stats.internal
    38 com.google.android.gms.stats.netstats
    66 com.google.android.gms.tasks
    66 com.google.firebase
    83 com.google.firebase.analytics
    18 com.google.firebase.analytics.connector
     6 com.google.firebase.analytics.connector.internal
     3 com.google.firebase.auth
    40 com.google.firebase.components
  2447 com.google.firebase.crash
     2 com.google.firebase.events
   131 com.google.firebase.iid
     1 com.google.firebase.internal
  2464 com.google.firebase.messaging
    76 com.google.gson
   120 com.google.gson.internal
   144 com.google.gson.internal.bind
     2 com.google.gson.internal.bind.util
     4 com.google.gson.internal.reflect
     3 com.google.gson.reflect
    74 com.google.gson.stream
    14 com.headerfooter.songhang.library
    11 com.ia.desinscripts
    11 com.lb.recyclerview_fast_scroller
    28 com.mcxtzhang.swipemenulib
     2 com.mindorks.snaphelperexample.ui.common
   185 com.nineoldandroids.animation
     8 com.nineoldandroids.util
    68 com.nineoldandroids.view
    18 com.nineoldandroids.view.animation
   282 com.onesignal
     4 com.onesignal.shortcutbadger
    46 com.onesignal.shortcutbadger.impl
   151 com.orangegangsters.github.swipyrefreshlayout.library
  2426 com.recyclerviewaar
    48 com.recyclerviewpager
     2 com.reza.sh.Json
    62 com.simplecityapps.recyclerview_fastscroll.views
    42 com.sprylab.android.widget
    13 com.tillekesoft.texturevideoviewwrapper
    61 com.yqritc.recyclerviewflexibledivider
    32 de.amberhome.navdrawer
    83 de.amberhome.navdrawer.internal
    70 de.amberhome.objects.appcompat
     1 de.amberhome.objects.internal
    15 de.donmanfred
    18 derez.libs
     1 flm.b4a.rippledrawable
     1 ir.CardView
     1 ir.FastScroll
     3 ir.ItemDecoration
     1 ir.Ripple
     8 ir.Type
    27 ir.basicapp.markets
    27 ir.blue_saffron.libs.onesignal
    31 ir.hitex.zip
    28 java.lang
    11 java.lang.annotation
     3 java.math
     9 java.net
     2 java.nio
     1 java.nio.channels
     1 java.text
     6 java.util
     6 java.util.concurrent
     3 java.util.logging
     4 javax.microedition.khronos.egl
   200 layout.b4a.view
  2426 me.zhanghai.android.materialprogressbar
    10 net.lingala.zip4j.core
    37 net.lingala.zip4j.crypto
    11 net.lingala.zip4j.crypto.PBKDF2
    11 net.lingala.zip4j.crypto.engine
     7 net.lingala.zip4j.exception
    41 net.lingala.zip4j.io
   143 net.lingala.zip4j.model
    22 net.lingala.zip4j.progress
    18 net.lingala.zip4j.unzip
   109 net.lingala.zip4j.util
     5 net.lingala.zip4j.zip
    14 net.vrallev.android.cat
     3 net.vrallev.android.cat.instance
   458 okhttp3
    21 okhttp3.internal
    78 okhttp3.internal.cache
    23 okhttp3.internal.cache2
    42 okhttp3.internal.connection
    31 okhttp3.internal.http
    34 okhttp3.internal.http1
   211 okhttp3.internal.http2
    42 okhttp3.internal.huc
     1 okhttp3.internal.io
    29 okhttp3.internal.platform
    15 okhttp3.internal.tls
    90 okhttp3.internal.ws
   102 okio
     1 org.json
  3241 tablet.group.italian.verb
   103 wir.hitex.recycler
 

Attachments

  • 1.PNG
    1.PNG
    26.7 KB · Views: 388
  • 3.PNG
    3.PNG
    22.8 KB · Views: 405
  • 2.PNG
    2.PNG
    10.8 KB · Views: 425
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
There are several resources that add many fields:
2426 me.zhanghai.android.materialprogressbar
2426 com.recyclerviewaar
2426 com.afollestad.materialdialogs
2446 co.ronash.pushe

You can also try to remove with #ExcludeClasses:
2426 android.support.v7.recyclerview
2426 android.support.v7.cardview

Get rid of a few of them and it will compile without multidex.
 
Upvote 0
Top