Bug? Update to ver 6.50 - error in all projects

Nino C.

Member
Licensed User
Longtime User
Hi

I updated B4A to version 6.50 and received the below error when compile projects:

B4A version: 6.50
Parsing code. (0.08s)
Compiling code. (0.08s)
Compiling layouts code. (0.01s)
Organizing libraries. (0.00s)
Generating R file. (0.40s)
Compiling generated Java code. (1.41s)
Convert byte code - optimized dex. Error
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/analytics/internal/Command;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
at com.android.dx.command.dexer.Main.processClass(Main.java:615)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:570)
at com.android.dx.command.dexer.Main.access$2(Main.java:546)
at com.android.dx.command.dexer.Main$2.processFileBytes(Main.java:514)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:537)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:449)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:236)
at com.android.dx.command.dexer.Main.run(Main.java:206)
at com.android.dx.command.dexer.Main.main(Main.java:179)
at com.android.dx.command.Main.main(Main.java:103)
1 error; aborting

Help :)
 

MarcoRome

Expert
Licensed User
Longtime User
Hi

I updated B4A to version 6.50 and received the below error when compile projects:

B4A version: 6.50
Parsing code. (0.08s)
Compiling code. (0.08s)
Compiling layouts code. (0.01s)
Organizing libraries. (0.00s)
Generating R file. (0.40s)
Compiling generated Java code. (1.41s)
Convert byte code - optimized dex. Error
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/analytics/internal/Command;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
at com.android.dx.command.dexer.Main.processClass(Main.java:615)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:570)
at com.android.dx.command.dexer.Main.access$2(Main.java:546)
at com.android.dx.command.dexer.Main$2.processFileBytes(Main.java:514)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:537)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:449)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:236)
at com.android.dx.command.dexer.Main.run(Main.java:206)
at com.android.dx.command.dexer.Main.main(Main.java:179)
at com.android.dx.command.Main.main(Main.java:103)
1 error; aborting

Help :)

Can you paste the first line the you have in main activity ?
...type:

B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Example
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#AdditionalJar .... ' <----

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
...

often this depend #AddtionalJar or do you have "double" classes
 

Nino C.

Member
Licensed User
Longtime User
First lines from main act.

B4X:
#Region  Project Attributes
    #ApplicationLabel: Kalkulator plaće
    #VersionCode: 19
    #VersionName: 1.19
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: True
   
    #AdditionalRes: c:\Android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms
#End Region

#Region  Activity Attributes
    #FullScreen: True
    #IncludeTitle: False
#End Region
 

MarcoRome

Expert
Licensed User
Longtime User
First lines from main act.

B4X:
#Region  Project Attributes
    #ApplicationLabel: Kalkulator plaće
    #VersionCode: 19
    #VersionName: 1.19
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: True

    #AdditionalRes: c:\Android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms
#End Region

#Region  Activity Attributes
    #FullScreen: True
    #IncludeTitle: False
#End Region

This is the problem:
B4X:
#AdditionalRes: c:\Android\android-sdk\extras\google\google_play_services\libproject\google-play-services_lib\res, com.google.android.gms

Now this is:

B4X:
#AdditionalJar: com.google.android.gms
or
B4X:
#AdditionalJar: com.google.android.gms:play-services-maps
#AdditionalJar: com.google.android.gms:play-services-location
....
etc...depend what you need
another thing...do you Update also Android SDK ?

Is necessary that you read also THIS
 
Last edited:

Nino C.

Member
Licensed User
Longtime User
Updated Android SDK.
I made the changes shown on this link

etc...depend what you need

The application use AdMob.
What is #AdditionalJar: for AdMob?

Now I get the following error:

B4A version: 6.50
Parsing code. (0.06s)
Compiling code. (0.09s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Generating R file. Error
AndroidManifest.xml:35: error: Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.IAPTheme').
 

MarcoRome

Expert
Licensed User
Longtime User
Updated Android SDK.
I made the changes shown on this link



The application use AdMob.
What is #AdditionalJar: for AdMob?

Now I get the following error:

B4A version: 6.50
Parsing code. (0.06s)
Compiling code. (0.09s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Generating R file. Error
AndroidManifest.xml:35: error: Error: No resource found that matches the given name (at 'theme' with value '@style/Theme.IAPTheme').

You must read better the link and anywayt if you search
https://www.b4x.com/android/forum/pages/results/?query=at+'theme'+with+value+'@style/Theme.IAPTheme
You have a lot result
 

Nino C.

Member
Licensed User
Longtime User
I was always afraid to go to the new version just for the reasons that occurred, that applications will no longer work.

Erel, would not the application should immediately work on a new version, without changing the source code?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The application should work without any change. There was a major shift from the old Google Play Services to the new maven repositories.
The changes required, if any, should be minimal.

1. Don't add any #AdditionalJar to your code.
2. Remove the #AdditionalRes attribute.

Do you get any error?

Which libraries are you using?

If you are using AdMob then you need to switch to FirebaseAdmob.
 
Last edited:

Nino C.

Member
Licensed User
Longtime User
Yes, it was a problem in the AdMob. Switch to FirebaseAdmob and now works.

Thanks for your help Marco, Erel!
 
Top