• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Cannot connect to Firebase for debug (code/errors included in thread)

MattNor

Lurker
Hello -

I'm still new to Firebase and Android Studio. I am trying to get event data sent via debug mode on a test app that I am playing with. My logcat has a few errors. I have googled for them and (mostly via StackOverflow) have found either no answers, or answers that didn't seem to work. Hoping there's some added assistance here.

The app runs fine in the emulator, and even seems to log events okay to logcat. I used the adb command in terminal to enable firebase debugging as well, per the firebase documentation. The information I'm providing below may be overkill, but (in the interest of me not really knowing what I'm doing here) I'd rather provide too much info than not enough, so my advanced apologies for the lengthy post. :-P

I'll post the whole logcat, but here are the specific errors in question:

Code:
09-02 15:01:06.936 2531-2595/com.google.firebase.udacity.greenthumb E/FA: Task exception on worker thread: java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.<init>()' is inaccessible to class 'com.google.firebase.iid.zzg' (declaration of 'com.google.firebase.iid.zzg' appears in /data/app/com.google.firebase.udacity.greenthumb-zcnVi5jNaWEAbLaWJnaAjQ==/split_lib_dependencies_apk.apk:classes2.dex): com.google.android.gms.measurement.internal.zzt.zzEd(Unknown Source:3)
09-02 15:01:09.189 2802-2802/? E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
09-02 15:01:09.191 2802-2802/? E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.

09-02 15:01:09.401 2802-2870/? E/FA: AppMeasurementReceiver not registered/enabled
09-02 15:01:09.408 2802-2870/? E/FA: AppMeasurementService not registered/enabled
09-02 15:01:09.408 2802-2870/? E/FA: Uploading is not possible. App measurement disabled

Logcat when running the app on an emulator
Code:
09-02 15:01:05.532 2531-2531/com.google.firebase.udacity.greenthumb I/FA: App measurement is starting up, version: 9080
09-02 15:01:05.533 2531-2531/com.google.firebase.udacity.greenthumb I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
09-02 15:01:05.533 2531-2531/com.google.firebase.udacity.greenthumb D/FA: Debug logging enabled
09-02 15:01:05.533 2531-2531/com.google.firebase.udacity.greenthumb D/FA: AppMeasurement singleton hash: 205429811
09-02 15:01:05.609 2531-2531/com.google.firebase.udacity.greenthumb V/FA: Collection enabled
09-02 15:01:05.609 2531-2531/com.google.firebase.udacity.greenthumb V/FA: App package, google app id: com.google.firebase.udacity.greenthumb, 1:923725470327:android:460ef458a52102b8
09-02 15:01:05.653 2531-2531/com.google.firebase.udacity.greenthumb V/FA: Registered activity lifecycle callback
09-02 15:01:05.719 2531-2595/com.google.firebase.udacity.greenthumb V/FA: Using measurement service
09-02 15:01:05.759 2531-2595/com.google.firebase.udacity.greenthumb V/FA: Connecting to remote service
09-02 15:01:05.856 2531-2531/com.google.firebase.udacity.greenthumb V/FA: onActivityCreated
09-02 15:01:06.229 2531-2595/com.google.firebase.udacity.greenthumb V/FA: Activity resumed, time: 45550
09-02 15:01:06.609 2460-2472/? I/FA-SVC: App measurement is starting up, version: 10932
09-02 15:01:06.622 2460-2472/? V/FA-SVC: Collection enabled
09-02 15:01:06.627 2460-2472/? D/FA-SVC: Debug-level message logging enabled
09-02 15:01:06.632 2460-2472/? V/FA-SVC: Cancelling job. JobID: 812057698
09-02 15:01:06.897 2531-2595/com.google.firebase.udacity.greenthumb D/FA: Connected to remote service
09-02 15:01:06.897 2531-2595/com.google.firebase.udacity.greenthumb V/FA: Processing queued up service tasks: 1
09-02 15:01:06.936 2531-2595/com.google.firebase.udacity.greenthumb E/FA: Task exception on worker thread: java.lang.IllegalAccessError: Method 'void android.support.v4.content.ContextCompat.<init>()' is inaccessible to class 'com.google.firebase.iid.zzg' (declaration of 'com.google.firebase.iid.zzg' appears in /data/app/com.google.firebase.udacity.greenthumb-zcnVi5jNaWEAbLaWJnaAjQ==/split_lib_dependencies_apk.apk:classes2.dex): com.google.android.gms.measurement.internal.zzt.zzEd(Unknown Source:3)
09-02 15:01:09.189 2802-2802/? E/FirebaseInstanceId: Failed to resolve target intent service, skipping classname enforcement
09-02 15:01:09.191 2802-2802/? E/FirebaseInstanceId: Error while delivering the message: ServiceIntent not found.
09-02 15:01:09.247 2802-2802/? I/FA: App measurement is starting up, version: 10298
09-02 15:01:09.247 2802-2802/? I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
09-02 15:01:09.318 2802-2802/? V/FA: Collection enabled
09-02 15:01:09.318 2802-2802/? V/FA: App package, google app id: com.android.chrome, 1:914760932289:android:bdb905fe8b8890ae
09-02 15:01:09.318 2802-2802/? I/FA: To enable faster debug mode event logging run:
                                       adb shell setprop debug.firebase.analytics.app com.android.chrome
09-02 15:01:09.318 2802-2802/? D/FA: Debug-level message logging enabled
09-02 15:01:09.333 2802-2802/? V/FA: Registered activity lifecycle callback
09-02 15:01:09.401 2802-2870/? E/FA: AppMeasurementReceiver not registered/enabled
09-02 15:01:09.408 2802-2870/? E/FA: AppMeasurementService not registered/enabled
09-02 15:01:09.408 2802-2870/? E/FA: Uploading is not possible. App measurement disabled
09-02 15:01:10.333 2460-2640/? I/FA-SVC: This instance being marked as an uploader
09-02 15:01:10.400 2460-2640/? V/FA-SVC: Nothing to upload or uploading impossible
09-02 15:01:10.414 2460-2640/? V/FA-SVC: Cancelling job. JobID: 812057698
09-02 15:01:11.904 2531-2595/com.google.firebase.udacity.greenthumb V/FA: Inactivity, disconnecting from AppMeasurementService
09-02 15:01:15.556 2460-2839/? D/FA-SVC: Got package replaced intent: com.google.firebase.udacity.greenthumb

App > Manifest > AndroidManifest.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.google.firebase.udacity.greenthumb">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>

                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <activity
            android:name=".PlantDetailActivity"
            android:parentActivityName=".MainActivity">

            <!-- Parent activity meta-data to support 4.0 and lower -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".MainActivity"/>
        </activity>
        <activity
            android:name=".ShoppingCartActivity"
            android:parentActivityName=".MainActivity">

            <!-- Parent activity meta-data to support 4.0 and lower -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".MainActivity"/>
        </activity>
        <activity
            android:name=".PurchaseActivity"
            android:parentActivityName=".MainActivity">

            <!-- Parent activity meta-data to support 4.0 and lower -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".MainActivity"/>
        </activity>
        <activity
            android:name=".AboutActivity"
            android:parentActivityName=".MainActivity"
            android:theme="@style/AppTheme">

            <!-- Parent activity meta-data to support 4.0 and lower -->
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".MainActivity"/>
        </activity>

        <provider
            android:name=".data.PlantProvider"
            android:authorities="@string/content_authority"
            android:exported="false"/>

        <service android:name="com.google.android.gms.measurement.AppMeasurementService"
            android:enabled="true"
            android:exported="false"/>

        <receiver android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
            android:enabled="true">
            <intent-filter>
                <action android:name="com.google.android.gms.measurement.UPLOAD" />
            </intent-filter>
        </receiver>

    </application>

</manifest>

Project build.gradle
Code:
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
        classpath 'com.google.gms:google-services:3.1.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

App build.gradle
Code:
/*
apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion '25.0.2'
    defaultConfig {
        applicationId "com.google.firebase.udacity.greenthumb"
        minSdkVersion 14
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:25.2.0'
    compile 'com.android.support:design:25.2.0'
    compile 'com.android.support:cardview-v7:25.2.0'
    compile 'com.android.support:support-v4:25.2.0'
    compile 'com.android.support:support-vector-drawable:25.2.0'
}

apply plugin: 'com.google.gms.google-services'

Thank you!!!
 
Back
Top Bottom