question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

166508275: Fatal Exception: ArrayIndexOutOfBoundsException in-app messaging

See original GitHub issue

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")

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
JasonAHeroncommented, Aug 5, 2020

Hmmm this error seems to be coming from the proto message builder, let me take a look

0reactions
rlazocommented, Jan 10, 2021

Hi! On Dec 16th we released a new versions of the SDKs pointing to the latest released version of protobuf-javalite at the time. See the release notes

Read more comments on GitHub >

github_iconTop Results From Across the Web

Firebase AsyncTask fatal exception - Stack Overflow
The error comes from RestrictiveDataManager.updateFromSetting(RestrictiveDataManager.java:46) , which seems to be missing from the code you ...
Read more >
Firebase In-App Messaging - Google
Firebase In-App Messaging helps you engage your app's active users by sending them targeted, contextual messages that encourage them to use key app...
Read more >
Amazon Pinpoint in-app messaging channel
You can send a single message, or create a carousel that contains up to five unique messages. Unlike other channels such as email...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found