firebase_core : "Found duplicate classes", "No package ID 7a found for ID 0x7a0b0007", "Missing google_app_id"

30 Views Asked by At

I've been trying to insert firebase_auth, firebase_core, firebase_crashlytics, google_sign_in in a flutter project with Android Studio running on a windows PC. While the app appears to "work" (except firebase analytics and its debug view), I keep getting odd outputs in the run window including

  • "Found duplicate classes",
  • "No package ID 7a found for ID 0x7a0b0007",
  • "Missing google_app_id. Firebase Analytics disabled.", which I still cannot solve and suggest unexpected behaviour(s) will eventually lead to stronger problems (for instance could it explain that analytics does not work with the app).

To reproduce the issue,

  • a basic new flutter project (the simple default counter app) was created with only the android platform,
  • gradle files (see at the very end of the post) were written following the last migration and according to https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply.
  • a firebase app was set up with FlutterFire CLI following https://codewithandrea.com/articles/flutter-firebase-flutterfire-cli/, leading to firebase_options.dart to be created in the lib> directory,
  • google-service.json was downloaded and transferred in android>app>
  • progressively, the pubspec.yaml file was fed with the above mentioned and up-to-date dependencies,
  • progressively, main() {...} was slightly altered and the import adjusted accordingly... Running File > Invalidate Caches… > Invalidate and Restart does not have any impact on the outcome.

Case 1: the result seems to be as excepted, for the following alterations

Future<void> main() async {
  runApp(const MyApp());
}

and firebase_core: ^2.27.2 The Run window indicates

Launching lib\main.dart on ANDROID_SMART_PHONE in debug mode... Running Gradle task 'assembleDebug'... Built build\app\outputs\flutter-apk\app-debug.apk. Debug service listening on ws://127.0.0.1:52462/BW_hVD0kpE0=/ws Syncing files to device ANDROID_SMART_PHONE... I/SurfaceControl(19164): nativeRelease nativeObject s[-5476376633990793776] I/SurfaceControl(19164): nativeRelease nativeObject e[-5476376633990793776] I/SurfaceControl(19164): assignNativeObject: nativeObject = 0 Surface(name=null)/@0x3c3fb5 / android.view.SurfaceControl.readFromParcel:1121 android.view.IWindowSession$Stub$Proxy.relayout:1824 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995 I/SurfaceControl(19164): nativeRelease nativeObject s[-5476376633990796416] I/SurfaceControl(19164): nativeRelease nativeObject e[-5476376633990796416] I/SurfaceControl(19164): nativeRelease nativeObject s[-5476376633990797296] I/SurfaceControl(19164): nativeRelease nativeObject e[-5476376633990797296] I/ViewRootImpl@9b00478MainActivity: Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)0 dur=10 res=0x3 s={true -5476376629696038048} ch=false fn=1 I/ViewRootImpl@9b00478MainActivity: updateBoundsLayer: shouldReparent = false t = android.view.SurfaceControl$Transaction@35d48ee sc = Surface(name=Bounds for - com.ORGANIZATION.PACKAGE_NAME/com.ORGANIZATION.PACKAGE_NAME.MainActivity@0)/@0x104c18f frame = 1 I/tek.luni_fixin(19164): WaitForGcToComplete blocked RunEmptyCheckpoint on ProfileSaver for 6.274ms I/SurfaceView(19164): applySurfaceTransforms: t = android.view.SurfaceControl$Transaction@59a2c1c surfaceControl = Surface(name=SurfaceView - com.ORGANIZATION.PACKAGE_NAME/com.ORGANIZATION.PACKAGE_NAME.MainActivity@615543e@0)/@0x5bd8025 frame = 1 I/ViewRootImpl@9b00478MainActivity: MSG_WINDOW_FOCUS_CHANGED 1 1 D/InputMethodManager(19164): prepareNavigationBarInfo() DecorView@22cbb8c[MainActivity] D/InputMethodManager(19164): getNavigationBarColor() -16711423 D/InputMethodManager(19164): prepareNavigationBarInfo() DecorView@22cbb8c[MainActivity] D/InputMethodManager(19164): getNavigationBarColor() -16711423 V/InputMethodManager(19164): Starting input: tba=com.ORGANIZATION.PACKAGE_NAME ic=null mNaviBarColor -16711423 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false D/InputMethodManager(19164): startInputInner - Id : 0 I/InputMethodManager(19164): startInputInner - mService.startInputOrWindowGainedFocus D/InputTransport(19164): Input channel constructed: 'ClientS', fd=105 D/InputMethodManager(19164): prepareNavigationBarInfo() DecorView@22cbb8c[MainActivity] D/InputMethodManager(19164): getNavigationBarColor() -16711423 V/InputMethodManager(19164): Starting input: tba=com.ORGANIZATION.PACKAGE_NAME ic=null mNaviBarColor -16711423 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false D/InputMethodManager(19164): startInputInner - Id : 0 I/SurfaceControl(19164): nativeRelease nativeObject s[-5476376633990806800] I/SurfaceControl(19164): nativeRelease nativeObject e[-5476376633990806800] I/SurfaceControl(19164): nativeRelease nativeObject s[-5476376633990793776] I/SurfaceControl(19164): nativeRelease nativeObject e[-5476376633990793776] I/ViewRootImpl@9b00478MainActivity: ViewPostIme pointer 0 I/ViewRootImpl@9b00478MainActivity: ViewPostIme pointer 1

Case 2: the result seems to be as excepted, for the following alterations

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  runApp(const MyApp());
}

and firebase_core: ^2.27.2

Case 3: the issues pop up in the Run window, for the following alterations

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform);
  runApp(const MyApp());
}

and firebase_core: ^2.27.2 The Run window indicates

Launching lib\main.dart on ANDROID_SMART_PHONE in debug mode... Running Gradle task 'assembleDebug'... Built build\app\outputs\flutter-apk\app-debug.apk. Installing build\app\outputs\flutter-apk\app-debug.apk... Debug service listening on ws://127.0.0.1:60890/z703CCcwzb0=/ws Syncing files to device ANDROID_SMART_PHONE... D/SessionsDependencies( 3427): Dependency to CRASHLYTICS added. I/FirebaseApp( 3427): Device unlocked: initializing all Firebase APIs for app [DEFAULT] I/FirebaseCrashlytics( 3427): Initializing Firebase Crashlytics 18.6.2 for com.ORGANIZATION.PACKAGE_NAME D/SessionsDependencies( 3427): Subscriber CRASHLYTICS registered. I/DynamiteModule( 3427): Considering local module com.google.android.gms.measurement.dynamite:100 and remote module com.google.android.gms.measurement.dynamite:103 I/DynamiteModule( 3427): Selected remote version of com.google.android.gms.measurement.dynamite, version >= 103 V/DynamiteModule( 3427): Dynamite loader version >= 2, using loadModule2NoCrashUtils W/System ( 3427): ClassLoader referenced unknown path: W/tek.luni_fixin( 3427): ClassLoaderContext classpath size mismatch. expected=10, found=6 (DLC[];PCL[base.apk863731480:base.apk!classes2.dex3007330542:base.apk!classes3.dex1408638101:base.apk!classes4.dex1216702553:base.apk!classes5.dex1665190303:base.apk!classes6.dex3776216989:base.apk!classes7.dex487523168:base.apk!classes8.dex441022647:base.apk!classes9.dex973263633:base.apk!classes10.dex3975975976]{PCL[/system/framework/org.apache.http.legacy.jar876722329]#PCL[/system/framework/com.android.media.remotedisplay.jar1573936315]#PCL[/system/framework/com.android.location.provider.jar1664931834]#PCL[/system/framework/org.apache.http.legacy.jar876722329]} | DLC[];PCL[/data/app/~~W-BYdT5Eh9RuG2pW1HHUUw==/com.ORGANIZATION.PACKAGE_NAME-mq0uRGz7gMjN94hs2NZvJQ==/base.apk1869693140:/data/app/~~W-BYdT5Eh9RuG2pW1HHUUw==/com.ORGANIZATION.PACKAGE_NAME-mq0uRGz7gMjN94hs2NZvJQ==/base.apk!classes2.dex543656433:/data/app/~~W-BYdT5Eh9RuG2pW1HHUUw==/com.ORGANIZATION.PACKAGE_NAME-mq0uRGz7gMjN94hs2NZvJQ==/base.apk!classes3.dex1906820599:/data/app/~~W-BYdT5Eh9RuG2pW1HHUUw==/com.ORGANIZATION.PACKAGE_NAME-mq0uRGz7gMjN94hs2NZvJQ==/base.apk!classes4.dex4073976722:/data/app/~~W-BYdT5Eh9RuG2pW1HHUUw==/com.ORGANIZATION.PACKAGE_NAME-mq0uRGz7gMjN94hs2NZvJQ==/base.apk!classes5.dex3143324598:/data/app/~~W-BYdT5Eh9RuG2pW1HHUUw==/com.ORGANIZATION.PACKAGE_NAME-mq0uRGz7gMjN94hs2NZvJQ==/base.apk!classes6.dex1847986046]) W/tek.luni_fixin( 3427): Found duplicate classes, falling back to extracting from APK : /data/app/~~5lhJWOf6mrCiZhJgPHn2JA==/com.google.android.gms-9VIFrfqIQZc6T1EusUxO4Q==/split_MeasurementDynamite.apk W/tek.luni_fixin( 3427): NOTE: This wastes RAM and hurts startup performance. W/tek.luni_fixin( 3427): Found duplicated class when checking oat files: 'Landroid/support/v4/graphics/drawable/IconCompatParcelizer;' in /data/app/~~5lhJWOf6mrCiZhJgPHn2JA==/com.google.android.gms-9VIFrfqIQZc6T1EusUxO4Q==/split_MeasurementDynamite.apk and /data/app/~~W-BYdT5Eh9RuG2pW1HHUUw==/com.ORGANIZATION.PACKAGE_NAME-mq0uRGz7gMjN94hs2NZvJQ==/base.apk D/libcrashlytics( 3427): Initializing libcrashlytics version 3.2.0 D/libcrashlytics( 3427): Initializing native crash handling successful. I/FirebaseCrashlytics( 3427): No version control information found D/FirebaseSessions( 3427): Initializing Firebase Sessions SDK. E/tek.luni_fixin( 3427): No package ID 7a found for ID 0x7a0b0007. I/FA ( 3427): App measurement initialized, version: 85014 I/FA ( 3427): To enable debug logging run: adb shell setprop log.tag.FA VERBOSE I/FA ( 3427): To enable faster debug mode event logging run: I/FA ( 3427): adb shell setprop debug.firebase.analytics.app com.ORGANIZATION.PACKAGE_NAME E/FA ( 3427): Missing google_app_id. Firebase Analytics disabled. See https:// goo.gl/ NAOOOI E/FA ( 3427): Uploading is not possible. App measurement disabled D/LifecycleServiceBinder( 3427): Binding service to application. D/SessionLifecycleService( 3427): Service bound to new client on process 3427 D/SessionLifecycleService( 3427): App has not yet foregrounded. Using previously stored session: null D/SessionLifecycleService( 3427): Client android.os.Messenger@4cf5372 bound at 434847708. Clients: 1 D/SessionLifecycleClient( 3427): Connected to SessionLifecycleService. Queue size 0 I/SurfaceControl( 3427): nativeRelease nativeObject s[-5476376633990794480] I/SurfaceControl( 3427): nativeRelease nativeObject e[-5476376633990794480] I/SurfaceControl( 3427): assignNativeObject: nativeObject = 0 Surface(name=null)/@0x4eb9697 / android.view.SurfaceControl.readFromParcel:1121 android.view.IWindowSession$Stub$Proxy.relayout:1824 android.view.ViewRootImpl.relayoutWindow:9005 android.view.ViewRootImpl.performTraversals:3360 android.view.ViewRootImpl.doTraversal:2618 android.view.ViewRootImpl$TraversalRunnable.run:9971 android.view.Choreographer$CallbackRecord.run:1010 android.view.Choreographer.doCallbacks:809 android.view.Choreographer.doFrame:744 android.view.Choreographer$FrameDisplayEventReceiver.run:995 I/SurfaceControl( 3427): nativeRelease nativeObject s[-5476376633990797120] I/SurfaceControl( 3427): nativeRelease nativeObject e[-5476376633990797120] I/SurfaceControl( 3427): nativeRelease nativeObject s[-5476376633990799584] I/SurfaceControl( 3427): nativeRelease nativeObject e[-5476376633990799584] I/ViewRootImpl@ef83d42MainActivity: Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)0 dur=15 res=0x3 s={true -5476376629696038048} ch=false fn=1 I/ViewRootImpl@ef83d42MainActivity: updateBoundsLayer: shouldReparent = false t = android.view.SurfaceControl$Transaction@4ff7d17 sc = Surface(name=Bounds for - com.ORGANIZATION.PACKAGE_NAME/com.ORGANIZATION.PACKAGE_NAME.MainActivity@0)/@0xfaf7504 frame = 1 I/SurfaceView( 3427): applySurfaceTransforms: t = android.view.SurfaceControl$Transaction@8743aed surfaceControl = Surface(name=SurfaceView - com.ORGANIZATION.PACKAGE_NAME/com.ORGANIZATION.PACKAGE_NAME.MainActivity@bc71ed8@0)/@0x3bf7d22 frame = 1 I/ViewRootImpl@ef83d42MainActivity: MSG_WINDOW_FOCUS_CHANGED 1 1 D/InputMethodManager( 3427): prepareNavigationBarInfo() DecorView@3ae1bb6[MainActivity] D/InputMethodManager( 3427): getNavigationBarColor() -16711423 D/InputMethodManager( 3427): prepareNavigationBarInfo() DecorView@3ae1bb6[MainActivity] D/InputMethodManager( 3427): getNavigationBarColor() -16711423 V/InputMethodManager( 3427): Starting input: tba=com.ORGANIZATION.PACKAGE_NAME ic=null mNaviBarColor -16711423 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false D/InputMethodManager( 3427): startInputInner - Id : 0 I/InputMethodManager( 3427): startInputInner - mService.startInputOrWindowGainedFocus D/InputTransport( 3427): Input channel constructed: 'ClientS', fd=123 D/InputMethodManager( 3427): prepareNavigationBarInfo() DecorView@3ae1bb6[MainActivity] D/InputMethodManager( 3427): getNavigationBarColor() -16711423 V/InputMethodManager( 3427): Starting input: tba=com.ORGANIZATION.PACKAGE_NAME ic=null mNaviBarColor -16711423 mIsGetNaviBarColorSuccess true , NavVisible : true , NavTrans : false D/InputMethodManager( 3427): startInputInner - Id : 0 I/SurfaceControl( 3427): nativeRelease nativeObject s[-5476376633990837248] I/SurfaceControl( 3427): nativeRelease nativeObject e[-5476376633990837248] I/SurfaceControl( 3427): nativeRelease nativeObject s[-5476376633990794480] I/SurfaceControl( 3427): nativeRelease nativeObject e[-5476376633990794480] I/ViewRootImpl@ef83d42MainActivity: ViewPostIme pointer 0 I/ViewRootImpl@ef83d42MainActivity: ViewPostIme pointer 1

Case 3b: as suggested I ran adb shell setprop debug.firebase.analytics.app com.ORGANIZATION.PACKAGE_NAME in the terminal leading to the following output

adb server version (41) doesn't match this client (39); killing... could not read ok from ADB Server failed to start daemon error: cannot connect to daemon

Case 3c: unsurprisingly adding more dependencies does not help...

The problem to be answered could be related to Missing google_app_id. Firebase Analytics disabled, even though it seems broader that what SwamiJi has describded.

For information

andoid > app > build.gradle

plugins {
    id "com.android.application"
    id "com.google.firebase.crashlytics"
    id "com.google.gms.google-services"
    id "dev.flutter.flutter-gradle-plugin"
    id "kotlin-android"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

android {
    namespace "com.lunitek.luni_fixing"
    compileSdk flutter.compileSdkVersion
    ndkVersion flutter.ndkVersion

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }

    defaultConfig {
        applicationId "com.ORGANIZATION.PACKAGE_NAME"
        minSdkVersion 23    // flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

    buildTypes {
        release {
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
        }
    }
}

flutter {
    source '../..'
}

dependencies {
    implementation("com.google.android.gms:play-services-auth:21.0.0")
    implementation("com.google.firebase:firebase-analytics")
    implementation("com.google.firebase:firebase-auth")
    implementation("com.google.firebase:firebase-crashlytics-ndk")
    implementation(platform("com.google.firebase:firebase-bom:32.7.4"))
}

andoid > build.gradle

allprojects {
    repositories {
        google()
        mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
    project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
    delete rootProject.buildDir
}

andoid > settings.gradle

pluginManagement {
    def flutterSdkPath = {
        def properties = new Properties()
        file("local.properties").withInputStream { properties.load(it) }
        def flutterSdkPath = properties.getProperty("flutter.sdk")
        assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
        return flutterSdkPath
    }
    settings.ext.flutterSdkPath = flutterSdkPath()

    includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}

plugins {
    id "com.android.application" version "7.3.0" apply false
    id "com.google.firebase.crashlytics" version "2.9.9" apply false
    id "com.google.gms.google-services" version "4.4.1" apply false
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "org.jetbrains.kotlin.android" version "1.9.0" apply false
}

include ":app"

0

There are 0 best solutions below