Android Question Having Crashes for android 9 and below with new google mobile ads sdk 19.7

tufanv

Expert
Licensed User
Longtime User
Hello,

I really need a help here. I am also using Pendrush's Ad manager Library with admob library. Ad manager Library is based on google mobile ads sdk 19.7 whereas firebase admob's is older I think. To use both libraries I am initializing both mobileadssdk:

Dim MobileAds As MobileAds
MobileAds.Initialize

and

Dim MobileAdsdk1s As MobileAdsSdk
MobileAdsSdk.Initialize

After the update there is no problem with android 10 devices, but verisons below 10, especially 9 crash rates increased by 10x, I cant reproduce it with a genymotion emulaator with adnrıoid 9 or lower, crashyltyics not showing any spike in crashes, but google play console shows the huge increase in crashes( maybe meaning app even not starting so crashlytics cant record it) .

suspecting some things:
1) initializing 2 mobile ads sdk
2) Updated the ads, ads-lite and ads-base to 19.7.0 to be able to use ad manager sdk.
3) manifest I have added these for admanager:

Another interesting point is nearly%90 of these crashes are for huweai device. This doesnt make any sense to me

B4X:
AddApplicationText(<meta-data
            android:name="com.google.android.gms.ads.AD_MANAGER_APP"
            android:value="true"/>  
            <activity
            android:name="com.google.android.gms.ads.AdActivity"
            android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />  
           
            <activity android:name="com.google.android.gms.common.api.GoogleApiActivity"
          android:theme="@android:style/Theme.Translucent.NoTitleBar"
          android:exported="false"/>
            <meta-data
          android:name="com.google.android.gms.version"
          android:value="@integer/google_play_services_version" />
        <receiver
                    android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
                    android:enabled="true"
                    android:exported="false" >
                </receiver>
       
          <service
                    android:name="com.google.android.gms.measurement.AppMeasurementService"
                    android:enabled="true"
                    android:exported="false" />
                   
         <receiver
                    android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
                    android:enabled="true"
                    android:exported="true"
                    android:permission="android.permission.INSTALL_PACKAGES" >
                    <intent-filter>
                        <action android:name="com.android.vending.INSTALL_REFERRER" />
                    </intent-filter>
        </receiver>
        <service
                    android:name="com.google.android.gms.measurement.AppMeasurementJobService"
                    android:enabled="true"
                    android:exported="false"
                    android:permission="android.permission.BIND_JOB_SERVICE" />)

maybe one of these is vreaking stg. Do you have an idea? I am really having a huge problem with devices running below android 10 accoırding to admob income halfed, and google play console crashes increased by %1000 . Please check the image below. After the update at 15th feb

fxcrash2.png
 
Last edited:

tufanv

Expert
Licensed User
Longtime User
Edit:

I found ou that that were logs in the google play developer console. And all the errors logs is this: Probably the error is in firebase because crashlytics doesnt record this crash also third line shows: at com.google.firebase.encoders.json.JsonDataEncoderBuilder.configureWith (JsonDataEncoderBuilder.java:103)

B4X:
java.lang.NoClassDefFoundError:
  at com.google.android.datatransport.cct.internal.AutoBatchedLogRequestEncoder.configure (AutoBatchedLogRequestEncoder.java:21)
  at com.google.firebase.encoders.json.JsonDataEncoderBuilder.configureWith (JsonDataEncoderBuilder.java:103)
  at com.google.android.datatransport.cct.internal.BatchedLogRequest.createDataEncoder (BatchedLogRequest.java:39)
  at com.google.android.datatransport.cct.CctTransportBackend.<init> (CctTransportBackend.java:100)
  at com.google.android.datatransport.cct.CctTransportBackend.<init> (CctTransportBackend.java:129)
  at com.google.android.datatransport.cct.CctBackendFactory.create (CctBackendFactory.java:29)
  at com.google.android.datatransport.runtime.backends.MetadataBackendRegistry.get (MetadataBackendRegistry.java:80)
  at com.google.android.datatransport.runtime.scheduling.DefaultScheduler.lambda$schedule$1 (DefaultScheduler.java:70)
  at com.google.android.datatransport.runtime.scheduling.DefaultScheduler$$Lambda$1.run (Unknown Source:8)
  at com.google.android.datatransport.runtime.SafeLoggingExecutor$SafeLoggingRunnable.run (SafeLoggingExecutor.java:47)
  at java.util.concurrent.ThreadPoolExecutor.processTask (ThreadPoolExecutor.java:1187)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1152)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
  at java.lang.Thread.run (Thread.java:784)
Caused by: java.lang.NoSuchMethodError:
  at com.google.android.datatransport.cct.internal.AutoBatchedLogRequestEncoder$BatchedLogRequestEncoder.<clinit> (AutoBatchedLogRequestEncoder.java:38)
 
Last edited:
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Yes I have read that yesterday but doesnt make sense to me about where I have to check, which sub is causing the error I dont know.
When I launch the application for the first time, if the user is not logged in, I launch a new activity called "login" and close the main activity with Activity.finish

This causes the InAppUpdate to be running and returns to "Sub InAppUpdate_onAppUpdateInfoReceived" but the activity has already been completed, and at this point it gives that error.

I have solved it by putting an "If IsPaused (Me) Then Return" inside the "Sub InAppUpdate_onAppUpdateInfoReceived" so that it is not executed if it is paused, and it solves the problem
 
Last edited:
Upvote 0

tufanv

Expert
Licensed User
Longtime User
I was able to produce it and it showed me this log :

B4X:
*** Service (starter) Create ***
java.lang.NoSuchMethodError: No static method of(Ljava/lang/String;)Lcom/google/firebase/encoders/FieldDescriptor; in class Lcom/google/firebase/encoders/FieldDescriptor; or its super classes (declaration of 'com.google.firebase.encoders.FieldDescriptor' appears in /data/app/ct.canlidoviz-1/base.apk)
    at com.google.android.datatransport.cct.internal.AutoBatchedLogRequestEncoder$BatchedLogRequestEncoder.<clinit>(AutoBatchedLogRequestEncoder.java:38)
    at com.google.android.datatransport.cct.internal.AutoBatchedLogRequestEncoder.configure(AutoBatchedLogRequestEncoder.java:21)
    at com.google.firebase.encoders.json.JsonDataEncoderBuilder.configureWith(JsonDataEncoderBuilder.java:103)
    at com.google.android.datatransport.cct.internal.BatchedLogRequest.createDataEncoder(BatchedLogRequest.java:39)
    at com.google.android.datatransport.cct.CctTransportBackend.<init>(CctTransportBackend.java:100)
    at com.google.android.datatransport.cct.CctTransportBackend.<init>(CctTransportBackend.java:129)
    at com.google.android.datatransport.cct.CctBackendFactory.create(CctBackendFactory.java:29)
    at com.google.android.datatransport.runtime.backends.MetadataBackendRegistry.get(MetadataBackendRegistry.java:80)
    at com.google.android.datatransport.runtime.scheduling.DefaultScheduler.lambda$schedule$1(DefaultScheduler.java:70)
    at com.google.android.datatransport.runtime.scheduling.DefaultScheduler$$Lambda$1.run(DefaultScheduler.java)
    at com.google.android.datatransport.runtime.SafeLoggingExecutor$SafeLoggingRunnable.run(SafeLoggingExecutor.java:47)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    at java.lang.Thread.run(Thread.java:818)
java.lang.NoSuchMethodError: com.google.android.datatransport.cct.internal.AutoBatchedLogRequestEncoder$BatchedLogRequestEncoder
    at com.google.android.datatransport.cct.internal.AutoBatchedLogRequestEncoder.configure(AutoBatchedLogRequestEncoder.java:21)
    at com.google.firebase.encoders.json.JsonDataEncoderBuilder.configureWith(JsonDataEncoderBuilder.java:103)
    at com.google.android.datatransport.cct.internal.BatchedLogRequest.createDataEncoder(BatchedLogRequest.java:39)
    at com.google.android.datatransport.cct.CctTransportBackend.<init>(CctTransportBackend.java:100)
    at com.google.android.datatransport.cct.CctTransportBackend.<init>(CctTransportBackend.java:129)
    at com.google.android.datatransport.cct.CctBackendFactory.create(CctBackendFactory.java:29)
    at com.google.android.datatransport.runtime.backends.MetadataBackendRegistry.get(MetadataBackendRegistry.java:80)
    at com.google.android.datatransport.runtime.scheduling.DefaultScheduler.lambda$schedule$1(DefaultScheduler.java:70)
    at com.google.android.datatransport.runtime.scheduling.DefaultScheduler$$Lambda$1.run(DefaultScheduler.java)
    at com.google.android.datatransport.runtime.SafeLoggingExecutor$SafeLoggingRunnable.run(SafeLoggingExecutor.java:47)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    at java.lang.Thread.run(Thread.java:818)
java.lang.NoSuchMethodError: com.google.android.datatransport.cct.internal.AutoBatchedLogRequestEncoder$BatchedLogRequestEncoder
    at com.google.android.datatransport.cct.internal.AutoBatchedLogRequestEncoder.configure(AutoBatchedLogRequestEncoder.java:21)
    at com.google.firebase.encoders.json.JsonDataEncoderBuilder.configureWith(JsonDataEncoderBuilder.java:103)
    at com.google.android.datatransport.cct.internal.BatchedLogRequest.createDataEncoder(BatchedLogRequest.java:39)
    at com.google.android.datatransport.cct.CctTransportBackend.<init>(CctTransportBackend.java:100)
    at com.google.android.datatransport.cct.CctTransportBackend.<init>(CctTransportBackend.java:129)
    at com.google.android.datatransport.cct.CctBackendFactory.create(CctBackendFactory.java:29)
    at com.google.android.datatransport.runtime.backends.MetadataBackendRegistry.get(MetadataBackendRegistry.java:80)
    at com.google.android.datatransport.runtime.scheduling.DefaultScheduler.lambda$schedule$1(DefaultScheduler.java:70)
    at com.google.android.datatransport.runtime.scheduling.DefaultScheduler$$Lambda$1.run(DefaultScheduler.java)
    at com.google.android.datatransport.runtime.SafeLoggingExecutor$SafeLoggingRunnable.run(SafeLoggingExecutor.java:47)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    at java.lang.Thread.run(Thread.java:818)
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
I recommend you to switch to FirebaseAdMob for now.

I will soon release a beta version of B4A which uses a new toolchain. This will allow updating all resources to their latest versions and is highly likely to fix this issue.
Should I switch to new version now? I found out that, since I am using the admanager lib, Firebase crashlytics is not working and it is likely that this error is caused by crashlytics?
 
Upvote 0

tufanv

Expert
Licensed User
Longtime User
Worth trying with the new version.
Tried with the new version, still getting this error about transport and crashlytics not working. I asked @Pendrush if the admanager lib could be braking crashlytics but he said there is no reference regarding crahlytics with admanager lib.

Also I tried to completely disable admanager lib, and still getting the error. Only difference from the working version is only we updated form the sdk these entries:

play-services-ads
play-services-ads-lite
play-servicces-ads-base
 
Last edited:
Upvote 0
Top