166508275: Fatal Exception: ArrayIndexOutOfBoundsException in-app messaging

Environement

  • Android Studio version: 4.0.1
  • Firebase Component: In-AppMessaging (Database, Firestore, Storage, Functions, etc)
  • Component version:

compileSdkVersion 29

'com.google.firebase:firebase-core:17.4.4' 
'com.google.firebase:firebase-messaging:20.1.5' 
'com.google.firebase:firebase-inappmessaging-display:19.1.0'
'com.google.firebase:firebase-analytics-ktx:17.4.4'

protobuf {
    protoc {
        artifact = 'com.google.protobuf:protoc:3.11.4'
    }
    plugins {
        grpc {
            artifact = 'io.grpc:protoc-gen-grpc-java:1.30.1'
        }
        javalite {
            artifact = 'com.google.protobuf:protoc-gen-javalite:3.0.0'
        }
    }
    generateProtoTasks {
        all().each { task ->
            task.builtins {
                java {
                    option 'lite'
                }
            }

            task.plugins {
                grpc {
                    // Options added to --grpc_out
                    option 'lite'
                }
            }
        }
    }
}

Exception

Following Fatal Exception occurs shortly after displaying in-app message:

FATAL EXCEPTION: main
    java.lang.ArrayIndexOutOfBoundsException: length=3; index=3
        at com.google.protobuf.MessageSchema.newSchemaForRawMessageInfo(MessageSchema.java:507)
        at com.google.protobuf.MessageSchema.newSchema(MessageSchema.java:227)
        at com.google.protobuf.ManifestSchemaFactory.newSchema(ManifestSchemaFactory.java:77)
        at com.google.protobuf.ManifestSchemaFactory.createSchema(ManifestSchemaFactory.java:71)
        at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:93)
        at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:107)
        at com.google.protobuf.GeneratedMessageLite.makeImmutable(GeneratedMessageLite.java:175)
        at com.google.protobuf.GeneratedMessageLite$Builder.buildPartial(GeneratedMessageLite.java:395)
        at com.google.protobuf.GeneratedMessageLite$Builder.build(GeneratedMessageLite.java:403)
        at com.google.firebase.inappmessaging.CampaignAnalytics$Builder.setClientApp(CampaignAnalytics.java:1049)
        at com.google.firebase.inappmessaging.internal.MetricsLoggerClient.createCampaignAnalyticsBuilder(MetricsLoggerClient.java:191)
        at com.google.firebase.inappmessaging.internal.MetricsLoggerClient.createEventEntry(MetricsLoggerClient.java:168)
        at com.google.firebase.inappmessaging.internal.MetricsLoggerClient.lambda$logImpression$0(MetricsLoggerClient.java:106)
        at com.google.firebase.inappmessaging.internal.MetricsLoggerClient$$Lambda$1.onSuccess(Unknown Source:6)
        at com.google.android.gms.tasks.zzm.run(com.google.android.gms:play-services-tasks@@17.0.2:4)
        at android.os.Handler.handleCallback(Handler.java:873)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at com.google.android.gms.internal.tasks.zzb.dispatchMessage(com.google.android.gms:play-services-tasks@@17.0.2:6)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I/FIAM.Headless: Starting InAppMessaging runtime with Installation ID e9kZTNGCQ4qvUu4zVEeBAL
I/FIAM.Headless: went foreground
I/FIAM.Display: Binding to activity: com.bitcoin.mwallet.OnBoardingActivity
I/FIAM.Headless: Setting display event component
I/FIAM.Headless: Forcing fetch from service rather than cache. Test Device: false | App Fresh Install: true
I/FIAM.Headless: Fetching campaigns from service.
I/FIAM.Headless: Successfully fetched 1 messages from backend
I/FIAM.Headless: Already impressed campaign Android Test 2 ? : false
I/FIAM.Headless: Already impressed campaign Android Test 2 ? : false
I/FIAM.Display: Impression timer onFinish for: 11550505989228724224

Steps to reproduce:

  1. Created a campaign on Firebase console with scheduler to trigger on specific event
  2. Have your activity trigger event onCreate

Relevant Code:

FirebaseInAppMessaging.getInstance().triggerEvent("main_activity_ready")

1 possible answer(s) on “166508275: Fatal Exception: ArrayIndexOutOfBoundsException in-app messaging