Android Question Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/c

Status
Not open for further replies.

Anser

Well-Known Member
Licensed User
Longtime User
Hi,

Today morning I updated the Android SDK via SDK Manager. Installed the recommended.

When I try to compile my application, I get the following errors. Please note that till last night ie before the Android SDK updates, it was working fine.

Compiling generated Java code. (4.63s)
Convert byte code - optimized dex. Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/cardview/R;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/cardview/R$attr;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/cardview/R$color;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/cardview/R$dimen;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/cardview/R$drawable;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/cardview/R$id;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/cardview/R$integer;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/cardview/R$layout;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v7/cardview/R$string;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:692)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:315)
at com.android.dx.command.dexer.Main.runDx(Main.java:293)
at com.android.dx.command.dexer.Main.main(Main.java:249)
at com.android.dx.command.Main.main(Main.java:94)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:684)
... 4 more

Any help will be appreciated
 

DonManfred

Expert
Licensed User
Longtime User
Upload a example project which shows the issue. Without anything it is hard to help
 
Upvote 0

Anser

Well-Known Member
Licensed User
Longtime User
It is an app with many activities, on which I have used many kinds of views. It may be difficult to recreate a sample which reproduce the same compilation error. I though that someone may get a clue from the compilation error. I am using MSCardView, it looks like the error is something related to the cardview

Lesson learned : Always make a backup of the Android SDK folder before updating the SDK's. Unfortunately I did not do that. Now do not know how to go back
 
Upvote 0

Anser

Well-Known Member
Licensed User
Longtime User
What are you using MSCardView for?

Looks like this library includes the Android SDK classes internally instead of properly linking to them. You can see it if you open the jar with 7zip. You can try to delete these classes.
I have used MSCardView in few of my apps
When I opened the jar with 7zip, I could find the following class files inside android->support->v7->cardview
Contents.jpg


Are you mentioning about deleting these class ?
 
Upvote 0

Anser

Well-Known Member
Licensed User
Longtime User
I removed few class files that was causing the error. There were few files inside the folder android->support->v7->cardview
Few files were there inside android->support->v7->widget which I had to remove.

Unfortunately now it is showing the following compilation errors
B4X:
Compiling generated Java code.    (3.83s)
Convert byte code - optimized dex.    Error
trouble writing output: Too many field references to fit in one dex file: 77425; 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
    28 android.app
     8 android.arch.core.executor
    14 android.arch.core.internal
   129 android.arch.lifecycle
     1 android.content
    39 android.content.pm
    10 android.content.res
     3 android.database
    63 android.graphics
     3 android.hardware
     2 android.hardware.camera2
     2 android.media
     1 android.media.browse
     2 android.net
    18 android.os
     3 android.print
     8 android.provider
    13 android.support.annotation
  3199 android.support.compat
  3578 android.support.constraint
   109 android.support.constraint.solver
   353 android.support.constraint.solver.widgets
  3199 android.support.coordinatorlayout
  3311 android.support.customtabs
  3199 android.support.design
    23 android.support.design.animation
     8 android.support.design.behavior
    37 android.support.design.bottomappbar
     4 android.support.design.bottomnavigation
    36 android.support.design.button
     5 android.support.design.card
    95 android.support.design.chip
    28 android.support.design.circularreveal
     1 android.support.design.circularreveal.cardview
     1 android.support.design.circularreveal.coordinatorlayout
     3 android.support.design.expandable
   122 android.support.design.internal
    23 android.support.design.resources
    10 android.support.design.ripple
    69 android.support.design.shape
     2 android.support.design.stateful
    37 android.support.design.transformation
   762 android.support.design.widget
   207 android.support.graphics.drawable
  3199 android.support.mediacompat
  3593 android.support.transition
    10 android.support.v13.view
    19 android.support.v13.view.inputmethod
    11 android.support.v4.accessibilityservice
   966 android.support.v4.app
   108 android.support.v4.content
    14 android.support.v4.content.pm
    33 android.support.v4.content.res
    60 android.support.v4.graphics
    63 android.support.v4.graphics.drawable
     3 android.support.v4.hardware.display
     6 android.support.v4.hardware.fingerprint
    11 android.support.v4.internal.view
   482 android.support.v4.media
     8 android.support.v4.media.app
   388 android.support.v4.media.session
     5 android.support.v4.net
    37 android.support.v4.os
    44 android.support.v4.print
   100 android.support.v4.provider
    80 android.support.v4.text
    31 android.support.v4.text.util
   118 android.support.v4.util
   413 android.support.v4.view
   130 android.support.v4.view.accessibility
     8 android.support.v4.view.animation
   471 android.support.v4.widget
   382 android.support.v7.app
  3199 android.support.v7.appcompat
  3200 android.support.v7.cardview
     6 android.support.v7.content.res
   110 android.support.v7.graphics.drawable
  3199 android.support.v7.recyclerview
    24 android.support.v7.recyclerview.extensions
     1 android.support.v7.text
   124 android.support.v7.util
    85 android.support.v7.view
   272 android.support.v7.view.menu
  1591 android.support.v7.widget
    89 android.support.v7.widget.helper
     1 android.support.v7.widget.util
     1 android.system
    15 android.text
     1 android.text.util
    17 android.util
    34 android.view
    11 android.view.accessibility
     6 android.view.animation
     3 android.view.inputmethod
    18 android.widget
    55 androidx.browser.browseractions
    56 androidx.versionedparcelable
   131 anywheresoftware.b4a
    25 anywheresoftware.b4a.agraham.reflection
    94 anywheresoftware.b4a.keywords
   125 anywheresoftware.b4a.keywords.constants
  3612 anywheresoftware.b4a.objects
    14 anywheresoftware.b4a.objects.collections
    15 anywheresoftware.b4a.objects.drawable
    10 anywheresoftware.b4a.objects.streams
   177 anywheresoftware.b4a.phone
    76 anywheresoftware.b4a.randomaccessfile
    22 anywheresoftware.b4a.remotelogger
    31 anywheresoftware.b4a.samples.httputils2
    13 anywheresoftware.b4a.sql
    29 anywheresoftware.b4h.okhttp
    15 anywheresoftware.b4j.object
    62 b4a.example
    44 barxdroid.NotificationBuilder
   113 cn.pedant.SweetAlert
    36 com.aghajari.layoutmanagers
   141 com.aghajari.rv
   245 com.aghajari.rv.utils
    52 com.aghajari.rvplugins
    35 com.astuetz
     1 com.bumptech.glide.load
     6 com.devil.app
  3274 com.firebase.ui.auth
     2 com.firebase.ui.auth.data.client
    39 com.firebase.ui.auth.data.model
    29 com.firebase.ui.auth.data.remote
     7 com.firebase.ui.auth.ui
     4 com.firebase.ui.auth.ui.credentials
    37 com.firebase.ui.auth.ui.email
    16 com.firebase.ui.auth.ui.idp
    82 com.firebase.ui.auth.ui.phone
    56 com.firebase.ui.auth.util
    12 com.firebase.ui.auth.util.data
    17 com.firebase.ui.auth.util.ui
    11 com.firebase.ui.auth.util.ui.fieldvalidators
    20 com.firebase.ui.auth.viewmodel
     9 com.firebase.ui.auth.viewmodel.email
    22 com.firebase.ui.auth.viewmodel.idp
     3 com.firebase.ui.auth.viewmodel.smartlock
    17 com.firebase.ui.common
    41 com.firebase.ui.database
    22 com.firebase.ui.firestore
     6 com.firebase.ui.storage
     9 com.firebase.ui.storage.images
    20 com.google.android.gms.actions
    16 com.google.android.gms.ads.identifier
    55 com.google.android.gms.auth
     5 com.google.android.gms.auth.account
  3217 com.google.android.gms.auth.api
    70 com.google.android.gms.auth.api.accounttransfer
    80 com.google.android.gms.auth.api.credentials
     6 com.google.android.gms.auth.api.phone
    37 com.google.android.gms.auth.api.proxy
    63 com.google.android.gms.auth.api.signin
    37 com.google.android.gms.auth.api.signin.internal
  3199 com.google.android.gms.base
  3335 com.google.android.gms.common
   102 com.google.android.gms.common.api
   369 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
   211 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
    38 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
     4 com.google.android.gms.internal.ads_identifier
    97 com.google.android.gms.internal.auth
    16 com.google.android.gms.internal.auth-api
     6 com.google.android.gms.internal.auth-api-phone
    25 com.google.android.gms.internal.base
     5 com.google.android.gms.internal.common
   856 com.google.android.gms.internal.firebase_auth
     8 com.google.android.gms.internal.firebase_messaging
     4 com.google.android.gms.internal.flags
   654 com.google.android.gms.internal.measurement
    36 com.google.android.gms.measurement
   692 com.google.android.gms.measurement.internal
     6 com.google.android.gms.security
    17 com.google.android.gms.signin
    15 com.google.android.gms.signin.internal
    27 com.google.android.gms.stats
    66 com.google.android.gms.tasks
    65 com.google.firebase
    88 com.google.firebase.analytics
    22 com.google.firebase.analytics.connector
    16 com.google.firebase.analytics.connector.internal
   118 com.google.firebase.auth
   385 com.google.firebase.auth.api.internal
    70 com.google.firebase.auth.internal
    40 com.google.firebase.components
     2 com.google.firebase.events
     3 com.google.firebase.firestore
   143 com.google.firebase.iid
     1 com.google.firebase.internal
  3234 com.google.firebase.messaging
     3 com.maximussoft.mscardview
     1 com.mchange.v2.c3p0
  4399 com.myfirebasetestapp.android
    54 com.mysql.fabric
     8 com.mysql.fabric.hibernate
    56 com.mysql.fabric.jdbc
    40 com.mysql.fabric.proto.xmlrpc
     2 com.mysql.fabric.xmlrpc
    27 com.mysql.fabric.xmlrpc.base
     1 com.mysql.fabric.xmlrpc.exceptions
  2619 com.mysql.jdbc
    11 com.mysql.jdbc.authentication
    12 com.mysql.jdbc.exceptions
     2 com.mysql.jdbc.exceptions.jdbc4
     3 com.mysql.jdbc.integration.c3p0
     2 com.mysql.jdbc.integration.jboss
     7 com.mysql.jdbc.interceptors
    82 com.mysql.jdbc.jdbc2.optional
     2 com.mysql.jdbc.jmx
    19 com.mysql.jdbc.log
    22 com.mysql.jdbc.profiler
    23 com.mysql.jdbc.util
    49 com.pnikosis.materialishprogress
    14 com.rootsoft.imageprocessing
     4 com.simplysoftware.base64convert
     3 com.twitter.sdk.android.core
     3 com.twitter.sdk.android.core.models
     6 com.whatsapp
     9 com.wrapp.floatlabelededittext
    66 de.amberhome.objects
    70 de.amberhome.objects.appcompat
     1 de.amberhome.objects.internal
    42 de.donmanfred
    30 de.donmanfred.b4a
    43 eu.dgconsulting.appupdating
     2 java.io
    14 java.lang
    11 java.lang.annotation
     9 java.net
     2 java.nio
     1 java.nio.channels
     5 java.sql
     6 java.util
     6 java.util.concurrent
     5 java.util.logging
   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
 
Upvote 0

Anser

Well-Known Member
Licensed User
Longtime User
By adding the following line in the Main, finally I was able to compile and build the application.
#MultiDex: True

Of course, the way MSCardView looked has changed. The background color changed from White to Dark gray color

So anyone here using MsCardView after the latest Android SDK update may encounter this issue.

All these were working fine just before the Android SDK update.
 
Upvote 0

Situ LLC

Active Member
Licensed User
I Have no idea
I change the java version and nothing I don't get the error jus this app show me this issue.


B4A Version: 10.50
Parsing code. (1.12s)
Java Version: 8
Building folders structure. (0.08s)
Compiling code. (2.89s)
Compiling layouts code. (0.04s)
Organizing libraries. (0.03s)
(AndroidX SDK)
Generating R file. (0.00s)
Compiling generated Java code. (10.29s)
Convert byte code - optimized dex. Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokhttp3/internal/platform/JdkWithJettyBootPlatform$JettyNegoProvider;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$2;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/AsyncTimeout$Watchdog;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Base64;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Buffer;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Buffer$1;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lokio/Buffer$2;
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: Translation has been interrupted
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:692)
at com.android.dx.command.dexer.Main.runMultiDex(Main.java:366)
at com.android.dx.command.dexer.Main.runDx(Main.java:291)
at com.android.dx.command.dexer.Main.main(Main.java:249)
at com.android.dx.command.Main.main(Main.java:94)
Caused by: java.lang.InterruptedException: Too many errors
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:684)
... 4 more
 
Upvote 0
Status
Not open for further replies.
Top