Android Question [SOLVED] FirebaseFirestore error com.android.dx.cf.code.SimException

Discussion in 'Android Questions' started by musaso, Jul 19, 2019.

  1. musaso

    musaso Member Licensed User

    Instal proyect from
    https://www.b4x.com/android/forum/t...ectionreference-is-not-inited.106079/#content
    I have the following error: Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)

    Code:
    B4A Versión: 9.30
    Java Versión: 
    8
    Parseando código.    (
    0.00s)
    Building folders structure.    (
    0.12s)
    Compilando código.    (
    0.07s)
    Compilado códigos de diseños.    (
    0.00s)
    Organizando librerías.    (
    0.13s)
        (AndroidX SDK)
    Generando el fichero R.    (
    0.00s)
    Compilando el código Java generado.    (
    4.53s)
    Convirtiendo byte code a dex optimizado.    Error
    Uncaught translation error: com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --
    min-sdk-version >= 26)
    1 error; aborting
     
  2. DonManfred

    DonManfred Expert Licensed User

    I am running in the same issue using the newest SDK and the additional jars i/we used in the past.

    I am investigating.
     
  3. musaso

    musaso Member Licensed User

    Is this library the one that causes the error?

    Code:
    '#AdditionalJar: com.google.gms:google-services
    If I put a comment, the error disappears
     
  4. Erel

    Erel Administrator Staff Member Licensed User

  5. musaso

    musaso Member Licensed User

    Thanks for answering Erel.
    I followed the instructions and executed the program b4j changing the paths and did not find anything.
    "C:\Android\platforms\android-28\android.jar" my path
    I have checked the file android.jar and it does not have any classes.jar or .aar ????
    Log of b4j
    Code:
    extract
    merge
    zip error: Nothing 
    to do! (try: zip -r C:\Program Files (x86)\Anywhere Software\B4J\Proyectos\Desugar\desugar\temp\merged.jar . -i .)
    12
     
  6. DonManfred

    DonManfred Expert Licensed User

    Try download
    - the new example from Dropbox (same link as before)
    - the addlibs.zip from Dropbox (same link as before). Extract all files from the zip to your additional library folder.

    Basically with this "setup" it is working for me
    Code:
    #Extends: android.support.v7.app.AppCompatActivity
    #MultiDex: true
    #BridgeLogger: true
    #AdditionalJar: com.google.firebase:firebase-common
    #AdditionalJar: com.google.firebase:firebase-auth
    #AdditionalJar: com.google.firebase:firebase-database
    #AdditionalJar: com.google.firebase:firebase-core
    #AdditionalJar: com.google.firebase:firebase-common
    #AdditionalJar: com.google.firebase:firebase-firestore
    '#AdditionalJar: com.google.gms:google-services
    #AdditionalJar: grpc-all-1.22.1.jar
    #AdditionalJar: grpc-api-1.22.1.jar
    #AdditionalJar: grpc-core-1.22.1.jar
    #AdditionalJar: grpc-okhttp-1.22.1.jar
    #AdditionalJar: grpc-android-1.22.1.aar
    #AdditionalJar: grpc-android-1.22.1-zero.jar ' Desugared (Like Coke Zero :D)
    #AdditionalJar: grpc-context-1.22.1.jar
    #AdditionalJar: grpc-stub-1.22.1.jar
    '#AdditionalJar: grpc-protobuf-1.22.1.jar
    #AdditionalJar: grpc-protobuf-lite-1.22.1.jar

    #AdditionalJar: opencensus-api-0.23.0.jar
    #AdditionalJar: opencensus-contrib-grpc-metrics-0.23.0.jar
    #AdditionalJar: opencensus-contrib-http-util-0.23.0.jar
    #AdditionalJar: perfmark-api-0.17.0.jar
    #AdditionalJar: guava-27.1-android.jar
    #ExcludeClasses: com.google.guava:guava-jdk5
    All needed jars should be in the addlibs.zip
     
    Last edited: Jul 21, 2019
    Erel likes this.
  7. musaso

    musaso Member Licensed User

    Thanks DonManfred now compiles well without error.
    But I can not add documents to my database, they stay in hasPendingWrites = true and isFromCache = true
    I do not know if I should open another thread thanks.
     
  8. DonManfred

    DonManfred Expert Licensed User

    You should always create a new thread for a new Issue.
     
  9. musaso

    musaso Member Licensed User

    Thanks
     
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