GoogleMobileAds(FirebaseAdmob 2021)

Status
Not open for further replies.

ArminKh1993

Active Member
1616070586175.png


Hi there;)
Ok,I think the time has come to release my library over the new version of Google Mobile Ads SDK.

This library is fully compatible with the new version(20.0.0) of GoogleMobileAds SDK.
Have a look at it. (https://developers.google.com/admob/android/migration)
All changes in the link above have been applied in this version of my library.

Supported Ad Formats:
1616071098905.png


Note:
Before doing anything, choose whether you want to use Admob with Firebase? Or Standalone?
You can read the difference between using them in this link.(Use more features of Google Analytics and Firebase with AdMob apps)

How to implement Admob(With Firebase):
1616072696186.png

  • Add this code to your "Project Attributes" of Main activity:
B4X:
#AdditionalJar: com.google.firebase:firebase-ads

How to implement Admob(Without Firebase):
B4X:
AddApplicationText(
  <activity
  android:name="com.google.android.gms.ads.AdActivity"
  android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
  android:theme="@android:style/Theme.Translucent" />
  <activity android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
  android:theme="@style/Theme.IAPTheme"/>
    <provider
            android:name="com.google.android.gms.ads.MobileAdsInitProvider"
            android:authorities="${applicationId}.mobileadsinitprovider"
            android:exported="false"
            android:initOrder="100" />
   <meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="$ADMOB_APP_ID$"/>
)

Note: Instead of code above you can use this one from Firebase integration tutorial too:
B4X:
CreateResourceFromFile(Macro, FirebaseAdMob.FirebaseAds)

  • Then add your AdmobAppId and GooglePlayService macro to your manifest:
B4X:
AddReplacement($ADMOB_APP_ID$, ca-app-pub-3940256099942544~3347511713)
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
  • Add this code to your "Project Attributes" of Main activity:
B4X:
#AdditionalJar: com.google.android.gms:play-services-ads


Ok, Now everything is ready to display your ads.But you need to know a few important points.
  • This library is compatible with b4a v10.7 or higher.
  • This library is compatible with Admob version 19.7 or higher, So if you see any errors, please update your SDK first. To install it please start SDK Manager and in search field type: com.google.android.gms: play-services-ads and com.google.firebase:firebase-ads and install it.
1616073706300.png

  • You should Initializes the Google Mobile Ads SDK. The SDK will configure itself. Call this method as early as possible, and only once per application launch(Maybe in Starter_Create).
B4X:
Dim MobileAds As MobileAds
    MobileAds.Initialize
  • By default, the Google Mobile Ads SDK initializes app measurement and begins sending user-level event data to Google immediately when the app starts. This initialization behavior ensures you can enable AdMob user metrics without making additional code changes. However, if your app requires user consent before these events can be sent, you can delay app measurement until you explicitly initialize the Mobile Ads SDK or load an ad. To delay app measurement, add the following <meta-data> tag in your Manifest. Delay app measurement until MobileAds.initialize() is called.
B4X:
AddApplicationText(
    <meta-data
        android:name="com.google.android.gms.ads.DELAY_APP_MEASUREMENT_INIT"
        android:value="true"/>
)
  • For video ads to show successfully in your banner ad views or in native video ads, hardware acceleration must be enabled.(Add to manifest)
B4X:
SetApplicationAttribute(android:hardwareAccelerated, "true")

  • You can also use lite version of google mobile ads sdk. just replace your code in "Project Attributes" of Main activity with lite versions. Like any Android library, the Google Play services SDK increases the size of apps that include it. The Google Mobile Ads Lite SDK is a lightweight version of the Google Mobile Ads SDK built to reduce that impact. It is a fraction of the size of the regular SDK.
    Alongside reduced size, using the Lite SDK decreases the total number of methods referenced in an app. This is especially useful when deploying to older versions of Android, where developers can run into the 64K reference limit. (https://developers.google.com/admob/android/lite-sdk)
#AdditionalJar: com.google.firebase:firebase-ads ==> #AdditionalJar: com.google.firebase:firebase-ads-lite
#AdditionalJar: com.google.android.gms:play-services-ads ==> #AdditionalJar: com.google.android.gms:play-services-ads-lite


Limitations of the Lite SDK
The Lite SDK should only be used in apps distributed through the Google Play store.​
 

Attachments

  • GoogleMobileAds.zip
    73.7 KB · Views: 542
  • GoogleMobileAds-Example.zip
    19 KB · Views: 553
  • GoogleMobileAds-20.zip
    73.6 KB · Views: 486
Last edited:

sorex

Expert
Licensed User
Longtime User
Thanks, Armin.

Is this using the same calls and callbacks as in Erel's libs?

Just a matter of not needing to recode a lot of things when this becomes an internal library aswell.
 

ArminKh1993

Active Member
Thanks, Armin.

Is this using the same calls and callbacks as in Erel's libs?

No, I have wrapped all the methods and events according to the original version.

Just a matter of not needing to recode a lot of things when this becomes an internal library aswell.

A lot has changed and I don't think erel will release anything without change.
for example :

Starting with version 20.0.0, interstitial, rewarded, rewarded interstitial, and App Open ad formats are standardized to follow a consistent API design.
All full-screen format APIs utilize the following principles:
  • A static load method
  • A similar load callback or handler mechanism
  • Reliance on the FullScreenContentCallack class for presentation callbacks
and this is events of interstitialAd:
B4X:
Sub EventName_onAdLoaded

End Sub
Sub EventName_onAdFailedToLoad(ErrorCode As Int)

End Sub
Sub EventName_onAdShowedFullScreenContent

End Sub
Sub EventName_onAdFailedToShowFullScreenContent(ErrorCode As Int)
        
End Sub
Sub EventName_onAdDismissedFullScreenContent
        
End Sub

As you can see a lot has changed.(Same for Rewarded,Rewarded Interstitial, AppOpenAd)
So I do not think that erel wants to continue with the same calls and callbacks of the past.
 

hl88

Member
Help, can't compile with play-services-ads and app crash with play-services-ads-lite
crash:
--------- beginning of crash
--------- beginning of system
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main$ResumableSub_Activity_Createresume (java line: 384)
java.lang.NoSuchMethodError: No direct method <init>(Landroid/os/IBinder;Ljava/lang/String;)V in class Lcom/google/android/gms/internal/ads/zzgw; or its super classes (declaration of 'com.google.android.gms.internal.ads.zzgw' appears in base.apk)
    at com.google.android.gms.internal.ads.zzyl.<init>(com.google.android.gms:play-services-ads-lite@@19.8.0:1)
    at com.google.android.gms.internal.ads.zzaaa.getRemoteCreator(com.google.android.gms:play-services-ads-lite@@19.8.0:25)
    at com.google.android.gms.dynamic.RemoteCreator.getRemoteCreatorInstance(com.google.android.gms:play-services-basement@@17.4.0:12)
    at com.google.android.gms.internal.ads.zzaaa.zzh(com.google.android.gms:play-services-ads-lite@@19.8.0:5)
    at com.google.android.gms.internal.ads.zzwp.zzqq(com.google.android.gms:play-services-ads-lite@@19.8.0:7)
    at com.google.android.gms.internal.ads.zzwt.zzqv(com.google.android.gms:play-services-ads-lite@@19.8.0:29)
    at com.google.android.gms.internal.ads.zzwt.zzd(com.google.android.gms:play-services-ads-lite@@19.8.0:56)
    at com.google.android.gms.internal.ads.zzzs.zzg(com.google.android.gms:play-services-ads-lite@@19.8.0:168)
    at com.google.android.gms.internal.ads.zzzs.zza(com.google.android.gms:play-services-ads-lite@@19.8.0:29)
    at com.google.android.gms.ads.MobileAds.initialize(com.google.android.gms:play-services-ads-lite@@19.8.0:10)
    at com.khaan.googleadssdk.MobileAdsWrapper.Initialize(MobileAdsWrapper.java:34)
   ...
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7386)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/ads/zzgy;
    at com.google.android.gms.internal.ads.zzanh.run(com.google.android.gms:play-services-ads-lite@@19.8.0:17)
    at java.lang.Thread.run(Thread.java:919)
Caused by: java.lang.ClassNotFoundException: com.google.android.gms.internal.ads.zzgy
    ... 2 more
 

ArminKh1993

Active Member
Help, can't compile with play-services-ads and app crash with play-services-ads-lite
crash:
--------- beginning of crash
--------- beginning of system
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main$ResumableSub_Activity_Createresume (java line: 384)
java.lang.NoSuchMethodError: No direct method <init>(Landroid/os/IBinder;Ljava/lang/String;)V in class Lcom/google/android/gms/internal/ads/zzgw; or its super classes (declaration of 'com.google.android.gms.internal.ads.zzgw' appears in base.apk)
    at com.google.android.gms.internal.ads.zzyl.<init>(com.google.android.gms:play-services-ads-lite@@19.8.0:1)
    at com.google.android.gms.internal.ads.zzaaa.getRemoteCreator(com.google.android.gms:play-services-ads-lite@@19.8.0:25)
    at com.google.android.gms.dynamic.RemoteCreator.getRemoteCreatorInstance(com.google.android.gms:play-services-basement@@17.4.0:12)
    at com.google.android.gms.internal.ads.zzaaa.zzh(com.google.android.gms:play-services-ads-lite@@19.8.0:5)
    at com.google.android.gms.internal.ads.zzwp.zzqq(com.google.android.gms:play-services-ads-lite@@19.8.0:7)
    at com.google.android.gms.internal.ads.zzwt.zzqv(com.google.android.gms:play-services-ads-lite@@19.8.0:29)
    at com.google.android.gms.internal.ads.zzwt.zzd(com.google.android.gms:play-services-ads-lite@@19.8.0:56)
    at com.google.android.gms.internal.ads.zzzs.zzg(com.google.android.gms:play-services-ads-lite@@19.8.0:168)
    at com.google.android.gms.internal.ads.zzzs.zza(com.google.android.gms:play-services-ads-lite@@19.8.0:29)
    at com.google.android.gms.ads.MobileAds.initialize(com.google.android.gms:play-services-ads-lite@@19.8.0:10)
    at com.khaan.googleadssdk.MobileAdsWrapper.Initialize(MobileAdsWrapper.java:34)
   ...
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:214)
    at android.app.ActivityThread.main(ActivityThread.java:7386)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:980)
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/ads/zzgy;
    at com.google.android.gms.internal.ads.zzanh.run(com.google.android.gms:play-services-ads-lite@@19.8.0:17)
    at java.lang.Thread.run(Thread.java:919)
Caused by: java.lang.ClassNotFoundException: com.google.android.gms.internal.ads.zzgy
    ... 2 more
Are you trying to compile attached example? Or it's your own code?
 

hl88

Member
Are you trying to compile attached example? Or it's your own code?
both, your admobplus is ok, I follow the link in your old post, update sdk and everything has mess up. I delete and reinstall resource folder and will give another tries on other computer
 

ArminKh1993

Active Member
both, your admobplus is ok, I follow the link in your old post, update sdk and everything has mess up. I delete and reinstall resource folder and will give another tries on other computer
Without knowing what the error is, it's hard for me to tell where the problem is because I and several of my friends and many others are using this library without any problems.
But because you say the app crashes, this could be related to the manifest.
 

Lucas Eduardo

Active Member
Licensed User
Hello, last week i tryed this lib and works very well, but today i had to download the SDK again. Now the lib does not work and the version of SDK is diferent. You can see in the print.

This is the error that i get when i use the lib
B4X:
B4A Version: 10.70
Parsing code.    (0.01s)
    Java Version: 11
Building folders structure.    (0.06s)
Compiling code.    (0.05s)
Compiling layouts code.    (0.02s)
Organizing libraries.    (0.02s)
    (AndroidX SDK)
Compiling resources    (0.48s)
Linking resources    (0.30s)
Compiling debugger engine code.    (1.10s)
Compiling generated Java code.    (1.59s)
Convert byte code - optimized dex.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpx;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpz;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqa;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqb;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqc;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqd;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqe;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqf;
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


There is something that i can do to fix it?

Thank you.
 

Attachments

  • ads.png
    ads.png
    20.1 KB · Views: 327

ArminKh1993

Active Member
Hello, last week i tryed this lib and works very well, but today i had to download the SDK again. Now the lib does not work and the version of SDK is diferent. You can see in the print.

This is the error that i get when i use the lib
B4X:
B4A Version: 10.70
Parsing code.    (0.01s)
    Java Version: 11
Building folders structure.    (0.06s)
Compiling code.    (0.05s)
Compiling layouts code.    (0.02s)
Organizing libraries.    (0.02s)
    (AndroidX SDK)
Compiling resources    (0.48s)
Linking resources    (0.30s)
Compiling debugger engine code.    (1.10s)
Compiling generated Java code.    (1.59s)
Convert byte code - optimized dex.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpx;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpz;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqa;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqb;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqc;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqd;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqe;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqf;
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


There is something that i can do to fix it?

Thank you.
Try it with sample or in a new project and post result
 

Lucas Eduardo

Active Member
Licensed User
same error
B4X:
B4A Version: 10.70
Parsing code.    (0.02s)
    Java Version: 11
Building folders structure.    (0.02s)
Compiling code.    (0.03s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.05s)
Linking resources    (0.30s)
Compiling debugger engine code.    (0.00s)
Compiling generated Java code.    (0.01s)
Convert byte code - optimized dex.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpx;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpz;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqa;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqb;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqc;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqd;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqe;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqf;
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
 

ArminKh1993

Active Member
same error
B4X:
B4A Version: 10.70
Parsing code.    (0.02s)
    Java Version: 11
Building folders structure.    (0.02s)
Compiling code.    (0.03s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Compiling resources    (0.05s)
Linking resources    (0.30s)
Compiling debugger engine code.    (0.00s)
Compiling generated Java code.    (0.01s)
Convert byte code - optimized dex.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpx;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpz;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqa;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqb;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqc;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqd;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqe;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqf;
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
So please try to remove your sdk(support) and install it again
 

Lucas Eduardo

Active Member
Licensed User
I redownload the SDK, when i open the example project, SDK manager ask to install work-runtime and user-messaging plataform.

I installed the ads version 20 too.
 

ArminKh1993

Active Member
I redownload the SDK, when i open the example project, SDK manager ask to install work-runtime and user-messaging plataform.

I installed the ads version 20 too.
The library now is compatible with version 20.0.0.
I separated the library that uses version 20.0.0 from 19.8.0 so that anyone who wants to can use that version(see first post attachments)
If you still have problems, download and use my sdk(extra folder). https://filebin.net/zeq4500nfgasbu5t
Be sure to back up your SDK before doing so.
 

Rubsanpe

Active Member
Licensed User
Hi. I have same issue since first day when i test the sample.

B4X:
B4A Versión: 10.70
Parseando código.    (0.00s)
    Java Versión: 11
Building folders structure.    (0.01s)
Compilando código.    (0.03s)
Compilado códigos de diseños.    (0.00s)
Organizando librerías.    (0.00s)
    (AndroidX SDK)
Compilando los recursos    (0.83s)
Enlazando los recursos    (0.37s)
Compilando el código del motor de depuración.    (1.08s)
Compilando el código Java generado.    (1.90s)
Convirtiendo byte code a dex optimizado.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpx;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpz;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqa;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqb;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqc;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqd;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqe;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqf;
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

Rubén
 

Lucas Eduardo

Active Member
Licensed User
Hi. I have same issue since first day when i test the sample.

B4X:
B4A Versión: 10.70
Parseando código.    (0.00s)
    Java Versión: 11
Building folders structure.    (0.01s)
Compilando código.    (0.03s)
Compilado códigos de diseños.    (0.00s)
Organizando librerías.    (0.00s)
    (AndroidX SDK)
Compilando los recursos    (0.83s)
Enlazando los recursos    (0.37s)
Compilando el código del motor de depuración.    (1.08s)
Compilando el código Java generado.    (1.90s)
Convirtiendo byte code a dex optimizado.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpx;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdpz;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqa;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqb;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqc;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqd;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqe;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/ads/zzdqf;
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

Rubén
Hello, when i downloaded the SDK extras from @ArminKh1993, was resolved to me. https://filebin.net/zeq4500nfgasbu5t
 

Lucas Eduardo

Active Member
Licensed User
Re install the SDK and update the ads like in the image to version 20. So if still it is not working, download the extras from Armin and replace it then test the sample again.
 

Attachments

  • ads.png
    ads.png
    20.1 KB · Views: 281

Rubsanpe

Active Member
Licensed User
Nothing. Same error. SDK installed from B4A installation page. I install also the artefacts the IDE is warning me. When i compile the sample i see the same error. If is working for you with Armin SDK artefacts, maybe Armin has other artefacts installed?

Edit: if i copy the Armin folder for overwrite my SDK then the sample compile ok.

Rubén
 
Last edited:
Status
Not open for further replies.
Top