Android Question [SOLVED] Compile error after trying to use SMS runtime permissions and Firebase in one application

Discussion in 'Android Questions' started by mare1980k1, Jun 22, 2019.

  1. mare1980k1

    mare1980k1 Member Licensed User

    Here is the thing, I tried to make Firebase work, but there were hundreds of errors like
    Maven artifact not found, so I went to SDK and downloaded all mavens... Then the firebase worked perfectly.

    Then I wanted to add SMS sending to application and added runtime permissions.
    Then it gave me an error that there are duplicate declarations of attributes in XML files. Since I had similiar looking XML files in the COM and xandroid folders.
    I went to the XML files in xandroid and put comments around attributes that were duplicates and resolved that problem.

    Then it went to DEX problems. First there was java.lang.OutOfMemoryError: GC overhead limit exceeded which I solved by changing DEX limit in .ini file in %APPDATA% folder.

    And after that I got another set of errors like this, I tried adding #MultiDex: True, but nothing happened. Can someone help me solve this? Also, the code in B4A works fine in two different apps, but when I try to bring together runtime permissions and Firebase, this happens..

    This is the compile error after some 2 minutes of 100% CPU usage and 2GB of RAM usage:

    What should I do? Thank you for help :)

    Convert byte code - optimized dex. Error
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/IResultReceiver;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/IResultReceiver$Stub;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/IResultReceiver$Stub$Proxy;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/ResultReceiver;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/ResultReceiver$1;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/ResultReceiver$MyResultReceiver;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroid/support/v4/os/ResultReceiver$MyRunnable;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroidx/versionedparcelable/CustomVersionedParcelable;
    Uncaught translation error: java.lang.IllegalArgumentException: already added: Landroidx/versionedparcelable/NonParcelField;
    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.RuntimeException: Translation has been interrupted
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:696)
    at com.android.dx.command.dexer.Main.runMultiDex(Main.java:370)
    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:688)
    ... 4 more
     
  2. mare1980k1

    mare1980k1 Member Licensed User

    In the end, it was just a resource mix up in the jars. Clean B4A reinstall did the job perfectly. The code itself works perfect.
     
  3. mare1980k1

    mare1980k1 Member Licensed User

    And now it compiles in 2 seconds.. although I went from laptop to main PC with i7, but on laptop it was compiling 2 minutes.. Seems that good rule of thumb is to refresh the B4A from time to time. And I must say that Erel did an amazing job in configuring the SDK with everything that I needed for this build.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice