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.

Various Errors/Exceptions logged with Firebase-Perf

See original GitHub issue

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general Firebase discussion, use the firebase-talk google group.
  • For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 3.6.3
  • Firebase Component: Performance (Perf)
  • Component version: 18.0.1

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

  1. Do a build (debug or release) with perf enabled
  2. See the following logs (app builds fine)
java.lang.NoClassDefFoundError: com/google/ads/interactivemedia/v3/api/AdErrorEvent$AdErrorListener
java.lang.ClassNotFoundException: com.google.ads.interactivemedia.v3.api.AdEvent
java.lang.ClassNotFoundException: com.google.ads.interactivemedia.v3.api.AdEvent
java.lang.ClassNotFoundException: org.apache.http.entity.ContentLengthStrategy
java.lang.ClassNotFoundException: org.apache.http.entity.ContentLengthStrategy
java.lang.ClassNotFoundException: org.apache.http.entity.ContentLengthStrategy
java.lang.ClassNotFoundException: org.apache.http.HttpResponseFactory
java.lang.ClassNotFoundException: org.apache.http.message.LineParser
java.lang.ClassNotFoundException: org.apache.http.HttpResponseFactory
java.lang.ClassNotFoundException: org.apache.http.HttpRequestFactory
java.lang.ClassNotFoundException: org.apache.http.message.LineParser
java.lang.ClassNotFoundException: org.apache.http.message.LineParser
java.lang.ClassNotFoundException: org.apache.http.message.LineFormatter
java.lang.ClassNotFoundException: org.apache.http.HttpResponseFactory
java.lang.ClassNotFoundException: org.apache.http.message.LineParser
java.lang.ClassNotFoundException: org.apache.http.HttpResponseFactory
java.lang.ClassNotFoundException: org.apache.http.HttpRequestFactory
java.lang.ClassNotFoundException: org.apache.http.message.LineFormatter
java.lang.ClassNotFoundException: org.apache.http.message.LineFormatter
java.lang.ClassNotFoundException: org.apache.http.protocol.HttpContext
java.lang.NoClassDefFoundError: org/apache/http/protocol/HttpContext
java.lang.ClassNotFoundException: org.apache.http.protocol.HttpContext
java.lang.NoClassDefFoundError: org/apache/http/client/CredentialsProvider
java.lang.ClassNotFoundException: org.apache.http.client.CredentialsProvider
java.lang.NoClassDefFoundError: org/apache/http/client/CredentialsProvider
java.lang.NoClassDefFoundError: org/apache/http/client/CookieStore
java.lang.ClassNotFoundException: org.apache.http.client.CookieStore
java.lang.ClassNotFoundException: org.apache.http.client.CredentialsProvider
java.lang.NoClassDefFoundError: org/apache/http/client/CredentialsProvider
java.lang.NoClassDefFoundError: org/apache/http/conn/routing/HttpRoutePlanner
java.lang.ClassNotFoundException: org.apache.http.conn.routing.HttpRoutePlanner
java.lang.ClassNotFoundException: org.apache.http.client.CookieStore
java.lang.NoClassDefFoundError: org/apache/http/client/CookieStore
java.lang.NoClassDefFoundError: org/apache/http/conn/routing/HttpRoutePlanner
java.lang.NoClassDefFoundError: org/apache/http/conn/routing/HttpRoutePlanner
java.lang.NoClassDefFoundError: org/apache/http/client/HttpRequestRetryHandler
java.lang.NoClassDefFoundError: org/apache/http/client/UserTokenHandler
java.lang.ClassNotFoundException: org.apache.http.client.UserTokenHandler
java.lang.ClassNotFoundException: org.apache.http.conn.routing.HttpRoutePlanner
java.lang.NoClassDefFoundError: org/apache/http/conn/routing/HttpRoutePlanner
java.lang.ClassNotFoundException: org.apache.http.client.HttpRequestRetryHandler
java.lang.NoClassDefFoundError: org/apache/http/client/HttpRequestRetryHandler
java.lang.NoClassDefFoundError: org/apache/http/client/UserTokenHandler
java.lang.NoClassDefFoundError: org/apache/http/conn/ConnectionKeepAliveStrategy
java.lang.ClassNotFoundException: org.apache.http.conn.ConnectionKeepAliveStrategy
java.lang.ClassNotFoundException: org.apache.http.client.UserTokenHandler
java.lang.NoClassDefFoundError: org/apache/http/client/UserTokenHandler
java.lang.NoClassDefFoundError: org/apache/http/ConnectionReuseStrategy
java.lang.ClassNotFoundException: org.apache.http.ConnectionReuseStrategy
java.lang.ClassNotFoundException: org.apache.http.conn.ConnectionKeepAliveStrategy
java.lang.NoClassDefFoundError: org/apache/http/conn/ConnectionKeepAliveStrategy
java.lang.NoClassDefFoundError: org/apache/http/ConnectionReuseStrategy
java.lang.NoClassDefFoundError: org/apache/http/ConnectionReuseStrategy
java.lang.ClassNotFoundException: org.apache.http.protocol.HttpContext
java.lang.NoClassDefFoundError: org/apache/http/protocol/HttpContext
java.lang.ClassNotFoundException: org.apache.http.protocol.HttpContext
java.lang.NoClassDefFoundError: org/apache/http/client/CredentialsProvider
java.lang.ClassNotFoundException: org.apache.http.client.CredentialsProvider
java.lang.NoClassDefFoundError: org/apache/http/client/CredentialsProvider
java.lang.ClassNotFoundException: org.apache.http.message.HeaderValueParser
java.lang.ClassNotFoundException: org.apache.http.message.LineFormatter
java.lang.ClassNotFoundException: org.apache.http.message.HeaderValueFormatter
java.lang.ClassNotFoundException: org.apache.http.ProtocolVersion
java.lang.ClassNotFoundException: org.apache.http.message.LineParser
java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
java.lang.NoClassDefFoundError: org/apache/http/HttpEntityEnclosingRequest
java.lang.NoClassDefFoundError: org/apache/http/HttpEntity
java.lang.ClassNotFoundException: org.apache.http.HttpEntity
java.lang.NoClassDefFoundError: org/apache/http/HttpEntityEnclosingRequest
java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
java.lang.ClassNotFoundException: org.apache.http.cookie.MalformedCookieException
java.lang.ClassNotFoundException: org.apache.http.cookie.MalformedCookieException
Can't instrument: com/udemy/android/view/CourseBadgeViewNew.class
java.lang.ArrayIndexOutOfBoundsException

Screen Shot 2020-05-26 at 11 19 14 AM

The errors aren’t logged if the plugin is disabled

if (getGradle().getStartParameter().getTaskRequests().toString().contains("Release")) {
    apply plugin: 'com.google.firebase.firebase-perf'
}

Relevant Code:

package com.udemy.android.view

import android.content.Context
import android.content.res.ColorStateList
import android.util.AttributeSet
import android.view.View
import android.widget.TextView
import androidx.annotation.AttrRes
import androidx.annotation.ColorRes
import androidx.annotation.StyleRes
import androidx.core.content.ContextCompat
import com.udemy.android.legacy.R


class CourseBadgeViewNew @JvmOverloads constructor(
        context: Context,
        attrs: AttributeSet? = null,
        @AttrRes defStyleAttr: Int = 0,
        @StyleRes defStyleRes: Int = R.style.CourseBadgeView
) : TextView(context, attrs, defStyleAttr, defStyleRes) {

    companion object {
        private const val BADGE_FAMILY_BESTSELLER = "bestseller"
        private const val BADGE_FAMILY_HOT_AND_NEW = "hot_and_new"
        private const val BADGE_FAMILY_NEW = "new"
        private const val BADGE_FAMILY_TOP_RATED = "top_rated"
    }

    var type: String? = null
        set(value) {
            var ok = true
            when (value) {
                BADGE_FAMILY_BESTSELLER -> {
                    setColor(R.color.yellow_light)
                }
                BADGE_FAMILY_HOT_AND_NEW -> {
                    setColor(R.color.coral_light)
                }
                BADGE_FAMILY_NEW -> {
                    setColor(R.color.green_light)
                }
                BADGE_FAMILY_TOP_RATED -> {
                    setColor(R.color.orange_light)
                }
                else -> ok = false
            }
            field = if (ok) value else null
            updateVisibility()
        }

    var isBadgeDisplayEnabled: Boolean = true
        set(value) {
            field = value
            updateVisibility()
        }

    init {
        attrs?.let {
            val a = context.theme.obtainStyledAttributes(it, R.styleable.CourseBadgeView,
                    0, 0)

            try {
                text = a.getString(R.styleable.CourseBadgeView_badgeText)
            } finally {
                a.recycle()
            }
        }

        setTextColor(ContextCompat.getColor(context, R.color.black))
    }

    private fun setColor(@ColorRes color: Int) {
        backgroundTintList = ColorStateList.valueOf(ContextCompat.getColor(context, color))
    }

    private fun updateVisibility() {
        visibility = if (text == null || type == null || !isBadgeDisplayEnabled) {
            View.GONE
        } else {
            View.VISIBLE
        }
    }
}

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
visumickeycommented, May 29, 2020

We see two issues here:

  1. When applying plugin, many classes show up as “Class not defined”. Eg: java.lang.ClassNotFoundException: com.google.ads.interactivemedia.v3.api.AdEvent
  2. Index out of bounds exception error.

We are able to reproduce Issue #2 and we have nailed it to be an ASM issue (Both version 7 and version 8). We are following up with ASM on this. Reference: https://gitlab.ow2.org/asm/asm/issues/317904

Regarding issue 1, can you please provide us a sample app where the issue is reproducible?

0reactions
visumickeycommented, Jun 11, 2020

Here are some updates from the ASM team on the issue. They are currently working on a PR for this fix an we are expecting that this would land very soon. As soon their fix lands, the IndexOutOfBoundsException should be resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Handling | Firebase Documentation - Google
Handling account-exists-with-different-credential Errors ... Each method provides various error codes and messages depending on the type of ...
Read more >
Firebase Crashlytics | Are catched exceptions showed or not?
All uncaught exceptions will be sent to Crashlytics. Caught exceptions will not be sent, unless you write specific code to log them as ......
Read more >
Question - An error - Unity Forum
End of inner exception stack trace --- ... LogError("Could not resolve all Firebase dependencies: " + ... //User is now logged in.
Read more >
R8 fails in Full Mode with Firebase Perf [141497570]
Regarding the exception we log it as an error because it shouldn't be overlooked and may sometimes require an attention (like a fix...
Read more >
View errors | Error Reporting - Google Cloud
The error reporting icon for logs that are part of error groups. . Click the button to access grouping details or to change...
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