flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

[cloud_firestore]: When Fetching(write, read, create) data from firebaseFireStore, I'm getting this error

Open vedatsalmis opened this issue 1 year ago • 73 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues.

Which plugins are affected?

cloud_firestore

Which platforms are affected?

Android

Description

When I press the button to add data to firestore, I get this error. When the application is running and I press the same button again later, I do not get this error a second time. Even though I get this error, it saves the data to firestore properly.

Note :

I encounter the same error whether I perform the Firebase setup by referring to the documentation or use the Firebase CLI for the installation.

Reproducing the issue

After the application is built, when I press the button, an error occurs. When I press the same button again, no error occurs. But even when an error message occurs, it saves the data to firestore properly. 1- Launch the application on an Android device. 2- press the floating action button.

Firebase Core version

3.6.0

Flutter Version

3.24.3

Relevant Log Output

W/DynamiteModule( 9614): Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
I/DynamiteModule( 9614): Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
W/ProviderInstaller( 9614): Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0.
D/nativeloader( 9614): Configuring clns-7 for other apk /system/framework/org.apache.http.legacy.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/lib/x86_64:/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
D/nativeloader( 9614): Configuring clns-8 for other apk /system/framework/com.android.media.remotedisplay.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/lib/x86_64:/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
W/r_application_1( 9614): Loading /data/misc/apexdata/com.android.art/dalvik-cache/x86_64/system@[email protected]@classes.odex non-executable as it requires an image which we failed to load
D/nativeloader( 9614): Configuring clns-9 for other apk /system/framework/com.android.location.provider.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/lib/x86_64:/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
D/ApplicationLoaders( 9614): Returning zygote-cached class loader: /system_ext/framework/androidx.window.extensions.jar
D/ApplicationLoaders( 9614): Returning zygote-cached class loader: /system_ext/framework/androidx.window.sidecar.jar
W/r_application_1( 9614): Loading /data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/oat/x86_64/base.odex non-executable as it requires an image which we failed to load
D/nativeloader( 9614): Configuring clns-10 for other apk /data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/lib/x86_64:/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
W/ProviderInstaller( 9614): Failed to report request stats: com.google.android.gms.common.security.ProviderInstallerImpl.reportRequestStats [class android.content.Context, long, long]
D/nativeloader( 9614): Load /data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk!/lib/x86_64/libconscrypt_gmscore_jni.so using ns clns-10 from class loader (caller=/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk!classes3.dex): ok
V/NativeCrypto( 9614): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 305 native methods...
W/r_application_1( 9614): Accessing hidden method Ldalvik/system/VMStack;->getStackClass2()Ljava/lang/Class; (unsupported, reflection, allowed)
I/egsw.a  ( 9614): Unable to retrieve flag snapshot for com.google.android.gms.providerinstaller#com.google.android.gms, using defaults.
W/r_application_1( 9614): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (unsupported, reflection, allowed)
I/ProviderInstaller( 9614): Installed default security provider GmsCore_OpenSSL
D/TrafficStats( 9614): tagSocket(155) with statsTag=0xffffffff, statsUid=-1
W/r_application_1( 9614): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (unsupported, reflection, allowed)
W/r_application_1( 9614): Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (unsupported, reflection, allowed)
I/flutter ( 9614): success
E/GoogleApiManager( 9614): Failed to get service from broker.
E/GoogleApiManager( 9614): java.lang.SecurityException: Unknown calling package name 'com.google.android.gms'.
E/GoogleApiManager( 9614): 	at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
E/GoogleApiManager( 9614): 	at android.os.Parcel.createException(Parcel.java:3041)
E/GoogleApiManager( 9614): 	at android.os.Parcel.readException(Parcel.java:3024)
E/GoogleApiManager( 9614): 	at android.os.Parcel.readException(Parcel.java:2966)
E/GoogleApiManager( 9614): 	at amrz.a(:com.google.android.gms@[email protected] (190800-681941525):36)
E/GoogleApiManager( 9614): 	at amqg.z(:com.google.android.gms@[email protected] (190800-681941525):143)
E/GoogleApiManager( 9614): 	at alxh.run(:com.google.android.gms@[email protected] (190800-681941525):54)
E/GoogleApiManager( 9614): 	at android.os.Handler.handleCallback(Handler.java:958)
E/GoogleApiManager( 9614): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/GoogleApiManager( 9614): 	at bqww.mv(:com.google.android.gms@[email protected] (190800-681941525):1)
E/GoogleApiManager( 9614): 	at bqww.dispatchMessage(:com.google.android.gms@[email protected] (190800-681941525):5)
E/GoogleApiManager( 9614): 	at android.os.Looper.loopOnce(Looper.java:205)
E/GoogleApiManager( 9614): 	at android.os.Looper.loop(Looper.java:294)
E/GoogleApiManager( 9614): 	at android.os.HandlerThread.run(HandlerThread.java:67)

Flutter dependencies

description: "A new Flutter project."

publish_to: 'none' 


version: 1.0.0+1

environment:
  sdk: ^3.5.3


dependencies:
  flutter:
    sdk: flutter


  cupertino_icons: ^1.0.8
  firebase_core: ^3.6.0
  cloud_firestore: ^5.4.4

dev_dependencies:
  flutter_test:
    sdk: flutter


  flutter_lints: ^4.0.0

flutter:


  uses-material-design: true

Additional context and comments

main.dart

import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(const MyApp());
}

Future<void> sendFeedback() async {
  Map<String, dynamic> feedback = {
    'subject': 'test',
    'description': 'test',
    'e-mail': 'test',
    'platform': 'test',
    'date': FieldValue.serverTimestamp(),
  };
  try {
    await FirebaseFirestore.instance.collection("feedbackTest").add(feedback);

    print('success');
  } catch (e) {
    print(e.toString());
  }
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    _counter++;

    sendFeedback();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}

settings.gradle

    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
    }()

    includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

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

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "8.7.0" apply false
    id "org.jetbrains.kotlin.android" version "2.0.20" apply false
    id 'com.google.gms.google-services' version '4.4.2' apply false
}

include ":app"

AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <application
        android:label="flutter_application_1"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:taskAffinity=""
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
    <!-- Required to query activities that can process text, see:
         https://developer.android.com/training/package-visibility and
         https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

         In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
    <queries>
        <intent>
            <action android:name="android.intent.action.PROCESS_TEXT"/>
            <data android:mimeType="text/plain"/>
        </intent>
    </queries>
</manifest>

flutter doctor -v

    • Flutter version 3.24.3 on channel stable at D:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (4 weeks ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\asus\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java       
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.2.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.2.32526.322
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.94.1)
    • VS Code at C:\Users\asus\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.76.0

[√] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 14 (API 34) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.19045.4894]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 129.0.6668.90
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 129.0.2792.79

[√] Network resources
    • All expected network resources are available.

• No issues found!

android/app/build.gradle

    id "com.android.application"
    id "kotlin-android"
    // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
    id "dev.flutter.flutter-gradle-plugin"
    id 'com.google.gms.google-services'
}

android {
    namespace = "com.example.flutter_application_1"
    compileSdk = 34

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId = "com.example.flutter_application_1"
        // You can update the following values to match your application needs.
        // For more information, see: https://flutter.dev/to/review-gradle-config.
        minSdk = 24
        targetSdk = 34
        versionCode = flutter.versionCode
        versionName = flutter.versionName
    }

    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 {
  // Import the Firebase BoM
  implementation platform('com.google.firebase:firebase-bom:33.4.0')


  // TODO: Add the dependencies for Firebase products you want to use
  // When using the BoM, don't specify versions in Firebase dependencies
  implementation 'com.google.firebase:firebase-analytics'
  implementation("com.google.firebase:firebase-firestore")


  // Add the dependencies for any other desired Firebase products
  // https://firebase.google.com/docs/android/setup#available-libraries
}

android/build.gradle

    repositories {
        google()
        mavenCentral()
    }
}

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

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

firestore rules

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
    match /feedback/{document=**} {
        allow create, write: if true;
    }
    match /feedbackTest/{document=**} {
        allow create, write: if true;
    }
    match /appContents/{document=**} {
      allow read: if true;
  	}
  }
}

vedatsalmis avatar Oct 10 '24 12:10 vedatsalmis

I am experiencing the same issue. After creating a new project and setting up Firebase, I encounter the same error when trying to write data to Firestore.

Note: Whether you set up Firebase using the Firebase CLI or follow the documentation manually, you still encounter the same error.

Cengizhanerturan avatar Oct 10 '24 12:10 Cengizhanerturan

I have the same problem. I encounter this error when I try to write data to Firestore and I haven't found a solution yet. When I try to install with Firebase CLI, the result is the same. Can anyone who has experienced this problem and solved it help me?

yigityesiladaa avatar Oct 10 '24 14:10 yigityesiladaa

i have same problem when i request first time it is showing error like this

Roshan-pcy avatar Oct 11 '24 02:10 Roshan-pcy

the first time mine works, after that errors all over the palce.

photoplyr avatar Oct 11 '24 04:10 photoplyr

try {
    ProviderInstaller.installIfNeeded(context)
} catch (GooglePlayServicesRepairableException e) {
    // Prompt user to update Play Services
} catch (GooglePlayServicesNotAvailableException e) {
    // Play Services not available
}
  1. Add error handling for ProviderInstaller as shown above
  2. Double-check if the google-services.json file is in the right directory.
  3. Verify that the SHA-1 and SHA-256 fingerprints are added in the Firebase Console.

Is there an existing issue for this?

  • [x] I have searched the existing issues.

Which plugins are affected?

Cloud Functions

Which platforms are affected?

Android

Description

When I press the button to add data to firestore, I get this error. When the application is running and I press the same button again later, I do not get this error a second time. Even though I get this error, it saves the data to firestore properly.

Note :

I encounter the same error whether I perform the Firebase setup by referring to the documentation or use the Firebase CLI for the installation.

Reproducing the issue

After the application is built, when I press the button, an error occurs. When I press the same button again, no error occurs. But even when an error message occurs, it saves the data to firestore properly. 1- Launch the application on an Android device. 2- press the floating action button.

Firebase Core version

3.6.0

Flutter Version

3.24.3

Relevant Log Output

W/DynamiteModule( 9614): Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
I/DynamiteModule( 9614): Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
W/ProviderInstaller( 9614): Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0.
D/nativeloader( 9614): Configuring clns-7 for other apk /system/framework/org.apache.http.legacy.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/lib/x86_64:/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
D/nativeloader( 9614): Configuring clns-8 for other apk /system/framework/com.android.media.remotedisplay.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/lib/x86_64:/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
W/r_application_1( 9614): Loading /data/misc/apexdata/com.android.art/dalvik-cache/x86_64/system@[email protected]@classes.odex non-executable as it requires an image which we failed to load
D/nativeloader( 9614): Configuring clns-9 for other apk /system/framework/com.android.location.provider.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/lib/x86_64:/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
D/ApplicationLoaders( 9614): Returning zygote-cached class loader: /system_ext/framework/androidx.window.extensions.jar
D/ApplicationLoaders( 9614): Returning zygote-cached class loader: /system_ext/framework/androidx.window.sidecar.jar
W/r_application_1( 9614): Loading /data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/oat/x86_64/base.odex non-executable as it requires an image which we failed to load
D/nativeloader( 9614): Configuring clns-10 for other apk /data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/lib/x86_64:/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk!/lib/x86_64, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
W/ProviderInstaller( 9614): Failed to report request stats: com.google.android.gms.common.security.ProviderInstallerImpl.reportRequestStats [class android.content.Context, long, long]
D/nativeloader( 9614): Load /data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk!/lib/x86_64/libconscrypt_gmscore_jni.so using ns clns-10 from class loader (caller=/data/app/~~D0otSPDQ6ze3M8w6brTTrA==/com.google.android.gms-xN_U7Ba9Fcm8BTSBEE9ncA==/base.apk!classes3.dex): ok
V/NativeCrypto( 9614): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 305 native methods...
W/r_application_1( 9614): Accessing hidden method Ldalvik/system/VMStack;->getStackClass2()Ljava/lang/Class; (unsupported, reflection, allowed)
I/egsw.a  ( 9614): Unable to retrieve flag snapshot for com.google.android.gms.providerinstaller#com.google.android.gms, using defaults.
W/r_application_1( 9614): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (unsupported, reflection, allowed)
I/ProviderInstaller( 9614): Installed default security provider GmsCore_OpenSSL
D/TrafficStats( 9614): tagSocket(155) with statsTag=0xffffffff, statsUid=-1
W/r_application_1( 9614): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (unsupported, reflection, allowed)
W/r_application_1( 9614): Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (unsupported, reflection, allowed)
I/flutter ( 9614): success
E/GoogleApiManager( 9614): Failed to get service from broker.
E/GoogleApiManager( 9614): java.lang.SecurityException: Unknown calling package name 'com.google.android.gms'.
E/GoogleApiManager( 9614): 	at android.os.Parcel.createExceptionOrNull(Parcel.java:3057)
E/GoogleApiManager( 9614): 	at android.os.Parcel.createException(Parcel.java:3041)
E/GoogleApiManager( 9614): 	at android.os.Parcel.readException(Parcel.java:3024)
E/GoogleApiManager( 9614): 	at android.os.Parcel.readException(Parcel.java:2966)
E/GoogleApiManager( 9614): 	at amrz.a(:com.google.android.gms@[email protected] (190800-681941525):36)
E/GoogleApiManager( 9614): 	at amqg.z(:com.google.android.gms@[email protected] (190800-681941525):143)
E/GoogleApiManager( 9614): 	at alxh.run(:com.google.android.gms@[email protected] (190800-681941525):54)
E/GoogleApiManager( 9614): 	at android.os.Handler.handleCallback(Handler.java:958)
E/GoogleApiManager( 9614): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/GoogleApiManager( 9614): 	at bqww.mv(:com.google.android.gms@[email protected] (190800-681941525):1)
E/GoogleApiManager( 9614): 	at bqww.dispatchMessage(:com.google.android.gms@[email protected] (190800-681941525):5)
E/GoogleApiManager( 9614): 	at android.os.Looper.loopOnce(Looper.java:205)
E/GoogleApiManager( 9614): 	at android.os.Looper.loop(Looper.java:294)
E/GoogleApiManager( 9614): 	at android.os.HandlerThread.run(HandlerThread.java:67)

Flutter dependencies

description: "A new Flutter project."

publish_to: 'none' 


version: 1.0.0+1

environment:
  sdk: ^3.5.3


dependencies:
  flutter:
    sdk: flutter


  cupertino_icons: ^1.0.8
  firebase_core: ^3.6.0
  cloud_firestore: ^5.4.4

dev_dependencies:
  flutter_test:
    sdk: flutter


  flutter_lints: ^4.0.0

flutter:


  uses-material-design: true

Additional context and comments

main.dart

import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Firebase.initializeApp();
  runApp(const MyApp());
}

Future<void> sendFeedback() async {
  Map<String, dynamic> feedback = {
    'subject': 'test',
    'description': 'test',
    'e-mail': 'test',
    'platform': 'test',
    'date': FieldValue.serverTimestamp(),
  };
  try {
    await FirebaseFirestore.instance.collection("feedbackTest").add(feedback);

    print('success');
  } catch (e) {
    print(e.toString());
  }
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    _counter++;

    sendFeedback();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}

settings.gradle

    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
    }()

    includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

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

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "8.7.0" apply false
    id "org.jetbrains.kotlin.android" version "2.0.20" apply false
    id 'com.google.gms.google-services' version '4.4.2' apply false
}

include ":app"

AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.gms.permission.ACTIVITY_RECOGNITION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
    <application
        android:label="flutter_application_1"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">
        <activity
            android:name=".MainActivity"
            android:exported="true"
            android:launchMode="singleTop"
            android:taskAffinity=""
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. -->
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
    <!-- Required to query activities that can process text, see:
         https://developer.android.com/training/package-visibility and
         https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

         In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
    <queries>
        <intent>
            <action android:name="android.intent.action.PROCESS_TEXT"/>
            <data android:mimeType="text/plain"/>
        </intent>
    </queries>
</manifest>

flutter doctor -v

    • Flutter version 3.24.3 on channel stable at D:\src\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (4 weeks ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at C:\Users\asus\AppData\Local\Android\sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java       
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.2.3)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.2.32526.322
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2022.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)

[√] VS Code (version 1.94.1)
    • VS Code at C:\Users\asus\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.76.0

[√] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 14 (API 34) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.19045.4894]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 129.0.6668.90
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 129.0.2792.79

[√] Network resources
    • All expected network resources are available.

• No issues found!

android/app/build.gradle

    id "com.android.application"
    id "kotlin-android"
    // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
    id "dev.flutter.flutter-gradle-plugin"
    id 'com.google.gms.google-services'
}

android {
    namespace = "com.example.flutter_application_1"
    compileSdk = 34

    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId = "com.example.flutter_application_1"
        // You can update the following values to match your application needs.
        // For more information, see: https://flutter.dev/to/review-gradle-config.
        minSdk = 24
        targetSdk = 34
        versionCode = flutter.versionCode
        versionName = flutter.versionName
    }

    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 {
  // Import the Firebase BoM
  implementation platform('com.google.firebase:firebase-bom:33.4.0')


  // TODO: Add the dependencies for Firebase products you want to use
  // When using the BoM, don't specify versions in Firebase dependencies
  implementation 'com.google.firebase:firebase-analytics'
  implementation("com.google.firebase:firebase-firestore")


  // Add the dependencies for any other desired Firebase products
  // https://firebase.google.com/docs/android/setup#available-libraries
}

android/build.gradle

    repositories {
        google()
        mavenCentral()
    }
}

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

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

firestore rules

service cloud.firestore {
  match /databases/{database}/documents {
    match /{document=**} {
      allow read, write: if true;
    }
    match /feedback/{document=**} {
        allow create, write: if true;
    }
    match /feedbackTest/{document=**} {
        allow create, write: if true;
    }
    match /appContents/{document=**} {
      allow read: if true;
  	}
  }
}

ARYPROGRAMMER avatar Oct 13 '24 21:10 ARYPROGRAMMER

try {
    ProviderInstaller.installIfNeeded(context)
} catch (GooglePlayServicesRepairableException e) {
    // Prompt user to update Play Services
} catch (GooglePlayServicesNotAvailableException e) {
    // Play Services not available
}

I checked json file directory and fingerptints. There is no problem with these. However, The code block you share, when I paste it, it doesn't recognize de ProviderInstaller class

vedatsalmis avatar Oct 14 '24 06:10 vedatsalmis

try {
    ProviderInstaller.installIfNeeded(context)
} catch (GooglePlayServicesRepairableException e) {
    // Prompt user to update Play Services
} catch (GooglePlayServicesNotAvailableException e) {
    // Play Services not available
}

I checked json file directory and fingerptints. There is no problem with these. However, The code block you share, when I paste it, it doesn't recognize de ProviderInstaller class

maybe try adding

implementation 'com.google.android.gms:play-services-base:18.2.0'

in build.gradle (app-level)

If this still does not work let's go through the error more precisely

ARYPROGRAMMER avatar Oct 14 '24 07:10 ARYPROGRAMMER

try {
    ProviderInstaller.installIfNeeded(context)
} catch (GooglePlayServicesRepairableException e) {
    // Prompt user to update Play Services
} catch (GooglePlayServicesNotAvailableException e) {
    // Play Services not available
}

I checked json file directory and fingerptints. There is no problem with these. However, The code block you share, when I paste it, it doesn't recognize de ProviderInstaller class

maybe try adding

implementation 'com.google.android.gms:play-services-base:18.2.0'

in build.gradle (app-level)

If this still does not work let's go through the error more precisely

I implement "implementation 'com.google.android.gms:play-services-base:18.2.0'" to app-level build.gradle file to dependecies but i does not work

vedatsalmis avatar Oct 14 '24 07:10 vedatsalmis

can you provide a repo where you could reproduce the error in that app, keep apikey as .env rest same

try {
    ProviderInstaller.installIfNeeded(context)
} catch (GooglePlayServicesRepairableException e) {
    // Prompt user to update Play Services
} catch (GooglePlayServicesNotAvailableException e) {
    // Play Services not available
}

I checked json file directory and fingerptints. There is no problem with these. However, The code block you share, when I paste it, it doesn't recognize de ProviderInstaller class

maybe try adding

implementation 'com.google.android.gms:play-services-base:18.2.0'

in build.gradle (app-level) If this still does not work let's go through the error more precisely

I implement "implementation 'com.google.android.gms:play-services-base:18.2.0'" to app-level build.gradle file to dependecies but i does not work

ARYPROGRAMMER avatar Oct 14 '24 07:10 ARYPROGRAMMER

Which apikey. Apikeys in the google-services.json file?

can you provide a repo where you could reproduce the error in that app, keep apikey as .env rest same

try {
    ProviderInstaller.installIfNeeded(context)
} catch (GooglePlayServicesRepairableException e) {
    // Prompt user to update Play Services
} catch (GooglePlayServicesNotAvailableException e) {
    // Play Services not available
}

I checked json file directory and fingerptints. There is no problem with these. However, The code block you share, when I paste it, it doesn't recognize de ProviderInstaller class

maybe try adding

implementation 'com.google.android.gms:play-services-base:18.2.0'

in build.gradle (app-level) If this still does not work let's go through the error more precisely

I implement "implementation 'com.google.android.gms:play-services-base:18.2.0'" to app-level build.gradle file to dependecies but i does not work

vedatsalmis avatar Oct 14 '24 07:10 vedatsalmis

Which apikey. Apikeys in the google-services.json file?

can you provide a repo where you could reproduce the error in that app, keep apikey as .env rest same

try {
    ProviderInstaller.installIfNeeded(context)
} catch (GooglePlayServicesRepairableException e) {
    // Prompt user to update Play Services
} catch (GooglePlayServicesNotAvailableException e) {
    // Play Services not available
}

I checked json file directory and fingerptints. There is no problem with these. However, The code block you share, when I paste it, it doesn't recognize de ProviderInstaller class

maybe try adding

implementation 'com.google.android.gms:play-services-base:18.2.0'

in build.gradle (app-level) If this still does not work let's go through the error more precisely

I implement "implementation 'com.google.android.gms:play-services-base:18.2.0'" to app-level build.gradle file to dependecies but i does not work

yes in json , all specific to you configurations remove that or if since we are doing for testing purposes you can keep it same and reproduce the error their so that i can pr to fix it. If it still persists then it might be due to deprecated flutterfire_cli

ARYPROGRAMMER avatar Oct 14 '24 07:10 ARYPROGRAMMER

I marked repo as test. So didnt change the apikey. It is the repo link : https://github.com/vedatsalmis/testapp

Which apikey. Apikeys in the google-services.json file?

can you provide a repo where you could reproduce the error in that app, keep apikey as .env rest same

try {
    ProviderInstaller.installIfNeeded(context)
} catch (GooglePlayServicesRepairableException e) {
    // Prompt user to update Play Services
} catch (GooglePlayServicesNotAvailableException e) {
    // Play Services not available
}

I checked json file directory and fingerptints. There is no problem with these. However, The code block you share, when I paste it, it doesn't recognize de ProviderInstaller class

maybe try adding

implementation 'com.google.android.gms:play-services-base:18.2.0'

in build.gradle (app-level) If this still does not work let's go through the error more precisely

I implement "implementation 'com.google.android.gms:play-services-base:18.2.0'" to app-level build.gradle file to dependecies but i does not work

yes in json , all specific to you configurations remove that or if since we are doing for testing purposes you can keep it same and reproduce the error their so that i can pr to fix it. If it still persists then it might be due to deprecated flutterfire_cli

vedatsalmis avatar Oct 14 '24 07:10 vedatsalmis

I marked repo as test. So didnt change the apikey. It is the repo link : https://github.com/vedatsalmis/testapp

Which apikey. Apikeys in the google-services.json file?

can you provide a repo where you could reproduce the error in that app, keep apikey as .env rest same

try {
    ProviderInstaller.installIfNeeded(context)
} catch (GooglePlayServicesRepairableException e) {
    // Prompt user to update Play Services
} catch (GooglePlayServicesNotAvailableException e) {
    // Play Services not available
}

I checked json file directory and fingerptints. There is no problem with these. However, The code block you share, when I paste it, it doesn't recognize de ProviderInstaller class

maybe try adding

implementation 'com.google.android.gms:play-services-base:18.2.0'

in build.gradle (app-level) If this still does not work let's go through the error more precisely

I implement "implementation 'com.google.android.gms:play-services-base:18.2.0'" to app-level build.gradle file to dependecies but i does not work

yes in json , all specific to you configurations remove that or if since we are doing for testing purposes you can keep it same and reproduce the error their so that i can pr to fix it. If it still persists then it might be due to deprecated flutterfire_cli

without adding anything to code, just configuring flutterfire_cli i was getting

D/CompatChangeReporter( 4674): Compat change id reported: 150939131; UID 10196; state: ENABLED D/ActivityThread( 4674): Package [com.google.android.apps.youtube.music] reported as REPLACED, but missing application info. Assuming REMOVED. D/ActivityThread( 4674): Package [com.google.android.apps.youtube.music] reported as REPLACED, but missing application info. Assuming REMOVED. D/EGL_emulation( 4674): app_time_stats: avg=3301.06ms min=6.91ms max=45756.61ms count=14 I/flutter ( 4674): success

where the comments above I/flutter are due to deprecated versions not being resolved, they are warnings

and the o/p addition is done :

image

So yes it might be a warning for the sdk which i dont think so is conflicting with development of the app

ARYPROGRAMMER avatar Oct 14 '24 08:10 ARYPROGRAMMER

I marked repo as test. So didnt change the apikey. It is the repo link : https://github.com/vedatsalmis/testapp

Which apikey. Apikeys in the google-services.json file?

can you provide a repo where you could reproduce the error in that app, keep apikey as .env rest same

try {
    ProviderInstaller.installIfNeeded(context)
} catch (GooglePlayServicesRepairableException e) {
    // Prompt user to update Play Services
} catch (GooglePlayServicesNotAvailableException e) {
    // Play Services not available
}

I checked json file directory and fingerptints. There is no problem with these. However, The code block you share, when I paste it, it doesn't recognize de ProviderInstaller class

maybe try adding

implementation 'com.google.android.gms:play-services-base:18.2.0'

in build.gradle (app-level) If this still does not work let's go through the error more precisely

I implement "implementation 'com.google.android.gms:play-services-base:18.2.0'" to app-level build.gradle file to dependecies but i does not work

yes in json , all specific to you configurations remove that or if since we are doing for testing purposes you can keep it same and reproduce the error their so that i can pr to fix it. If it still persists then it might be due to deprecated flutterfire_cli

without adding anything to code, just configuring flutterfire_cli i was getting

D/CompatChangeReporter( 4674): Compat change id reported: 150939131; UID 10196; state: ENABLED D/ActivityThread( 4674): Package [com.google.android.apps.youtube.music] reported as REPLACED, but missing application info. Assuming REMOVED. D/ActivityThread( 4674): Package [com.google.android.apps.youtube.music] reported as REPLACED, but missing application info. Assuming REMOVED. D/EGL_emulation( 4674): app_time_stats: avg=3301.06ms min=6.91ms max=45756.61ms count=14 I/flutter ( 4674): success

where the comments above I/flutter are due to deprecated versions not being resolved, they are warnings

and the o/p addition is done :

image

So yes it might be a warning for the sdk which i dont think so is conflicting with development of the app

Failed to get service from broker. E/GoogleApiManager( 9614): java.lang.SecurityException: Unknown calling package name 'com.google.android.gms'. E/GoogleApiManager( 9614): at android.os.Parcel.createExceptionOrNull(Parcel.java:3057) E/GoogleApiManager( 9614): at android.os.Parcel.createException(Parcel.java:3041) E/GoogleApiManager( 9614): at android.os.Parcel.readException(Parcel.java:3024) E/GoogleApiManager( 9614): at android.os.Parcel.readException(Parcel.java:2966) E/GoogleApiManager( 9614): at amrz.a(:com.google.android.gms@[email protected] (190800-681941525):36) E/GoogleApiManager( 9614): at amqg.z(:com.google.android.gms@[email protected] (190800-681941525):143) E/GoogleApiManager( 9614): at alxh.run(:com.google.android.gms@[email protected] (190800-681941525):54) E/GoogleApiManager( 9614): at android.os.Handler.handleCallback(Handler.java:958) E/GoogleApiManager( 9614): at android.os.Handler.dispatchMessage(Handler.java:99) E/GoogleApiManager( 9614): at bqww.mv(:com.google.android.gms@[email protected] (190800-681941525):1) E/GoogleApiManager( 9614): at bqww.dispatchMessage(:com.google.android.gms@[email protected] (190800-681941525):5) E/GoogleApiManager( 9614): at android.os.Looper.loopOnce(Looper.java:205) E/GoogleApiManager( 9614): at android.os.Looper.loop(Looper.java:294) E/GoogleApiManager( 9614): at android.os.HandlerThread.run(HandlerThread.java:67)

So, is there anything that can be done to get rid of these warnings and error messages? Note : I didnt create the project with flutterfire_cli

vedatsalmis avatar Oct 14 '24 08:10 vedatsalmis

I marked repo as test. So didnt change the apikey. It is the repo link : https://github.com/vedatsalmis/testapp

Which apikey. Apikeys in the google-services.json file?

can you provide a repo where you could reproduce the error in that app, keep apikey as .env rest same

try {
    ProviderInstaller.installIfNeeded(context)
} catch (GooglePlayServicesRepairableException e) {
    // Prompt user to update Play Services
} catch (GooglePlayServicesNotAvailableException e) {
    // Play Services not available
}

I checked json file directory and fingerptints. There is no problem with these. However, The code block you share, when I paste it, it doesn't recognize de ProviderInstaller class

maybe try adding

implementation 'com.google.android.gms:play-services-base:18.2.0'

in build.gradle (app-level) If this still does not work let's go through the error more precisely

I implement "implementation 'com.google.android.gms:play-services-base:18.2.0'" to app-level build.gradle file to dependecies but i does not work

yes in json , all specific to you configurations remove that or if since we are doing for testing purposes you can keep it same and reproduce the error their so that i can pr to fix it. If it still persists then it might be due to deprecated flutterfire_cli

without adding anything to code, just configuring flutterfire_cli i was getting D/CompatChangeReporter( 4674): Compat change id reported: 150939131; UID 10196; state: ENABLED D/ActivityThread( 4674): Package [com.google.android.apps.youtube.music] reported as REPLACED, but missing application info. Assuming REMOVED. D/ActivityThread( 4674): Package [com.google.android.apps.youtube.music] reported as REPLACED, but missing application info. Assuming REMOVED. D/EGL_emulation( 4674): app_time_stats: avg=3301.06ms min=6.91ms max=45756.61ms count=14 I/flutter ( 4674): success where the comments above I/flutter are due to deprecated versions not being resolved, they are warnings and the o/p addition is done : image So yes it might be a warning for the sdk which i dont think so is conflicting with development of the app

Failed to get service from broker. E/GoogleApiManager( 9614): java.lang.SecurityException: Unknown calling package name 'com.google.android.gms'. E/GoogleApiManager( 9614): at android.os.Parcel.createExceptionOrNull(Parcel.java:3057) E/GoogleApiManager( 9614): at android.os.Parcel.createException(Parcel.java:3041) E/GoogleApiManager( 9614): at android.os.Parcel.readException(Parcel.java:3024) E/GoogleApiManager( 9614): at android.os.Parcel.readException(Parcel.java:2966) E/GoogleApiManager( 9614): at amrz.a(:com.google.android.gms@[email protected] (190800-681941525):36) E/GoogleApiManager( 9614): at amqg.z(:com.google.android.gms@[email protected] (190800-681941525):143) E/GoogleApiManager( 9614): at alxh.run(:com.google.android.gms@[email protected] (190800-681941525):54) E/GoogleApiManager( 9614): at android.os.Handler.handleCallback(Handler.java:958) E/GoogleApiManager( 9614): at android.os.Handler.dispatchMessage(Handler.java:99) E/GoogleApiManager( 9614): at bqww.mv(:com.google.android.gms@[email protected] (190800-681941525):1) E/GoogleApiManager( 9614): at bqww.dispatchMessage(:com.google.android.gms@[email protected] (190800-681941525):5) E/GoogleApiManager( 9614): at android.os.Looper.loopOnce(Looper.java:205) E/GoogleApiManager( 9614): at android.os.Looper.loop(Looper.java:294) E/GoogleApiManager( 9614): at android.os.HandlerThread.run(HandlerThread.java:67)

So, is there anything that can be done to get rid of these warnings and error messages? Note : I didnt create the project with flutterfire_cli

Yes there are many ways to suppress the warnings and error messages but its recommended to keep those getting logged until and unless you face no issues after complete development, these are useful later for debugging. Otherwise you can use these to supress them (works not for all but some):

  1. FirebaseFirestore.instance.settings = const Settings( persistenceEnabled: false, // Disable persistence if causing issues host: 'localhost', // Set a custom host if needed sslEnabled: true, // Adjust SSL if it's related to errors cacheSizeBytes: Settings.CACHE_SIZE_UNLIMITED, );

  2. FirebaseFirestore.instance.setLoggingEnabled(false);

  3. void main() { debugPrint = (String? message, {int? wrapWidth}) {}; runApp(MyApp()); }

  4. Advanced usages like @pragma('vm:entry-point')

Moreover I strongly advise you to keep developing as these errors do not block stream or create conflicts. Also use cli for configurations as it is highly granular and flexible

ARYPROGRAMMER avatar Oct 14 '24 08:10 ARYPROGRAMMER

also @vedatsalmis you can close the issue if you are satisfied

ARYPROGRAMMER avatar Oct 14 '24 08:10 ARYPROGRAMMER

  • FirebaseFirestore.instance.settings = const Settings( persistenceEnabled: false, // Disable persistence if causing issues host: 'localhost', // Set a custom host if needed sslEnabled: true, // Adjust SSL if it's related to errors cacheSizeBytes: Settings.CACHE_SIZE_UNLIMITED, );
  • FirebaseFirestore.instance.setLoggingEnabled(false);

FirebaseFirestore.instance.settings = const Settings( persistenceEnabled: false, // Disable persistence if causing issues host: 'localhost', // Set a custom host if needed sslEnabled: true, // Adjust SSL if it's related to errors cacheSizeBytes: Settings.CACHE_SIZE_UNLIMITED, );

FirebaseFirestore.instance.setLoggingEnabled(false);

I tried what you wrote above but I keep getting this message :

Failed to get service from broker. E/GoogleApiManager( 9614): java.lang.SecurityException: Unknown calling package name 'com.google.android.gms'. E/GoogleApiManager( 9614): at android.os.Parcel.createExceptionOrNull(Parcel.java:3057) E/GoogleApiManager( 9614): at android.os.Parcel.createException(Parcel.java:3041) E/GoogleApiManager( 9614): at android.os.Parcel.readException(Parcel.java:3024) E/GoogleApiManager( 9614): at android.os.Parcel.readException(Parcel.java:2966) E/GoogleApiManager( 9614): at amrz.a(:com.google.android.gms@[email protected] (190800-681941525):36) E/GoogleApiManager( 9614): at amqg.z(:com.google.android.gms@[email protected] (190800-681941525):143) E/GoogleApiManager( 9614): at alxh.run(:com.google.android.gms@[email protected] (190800-681941525):54) E/GoogleApiManager( 9614): at android.os.Handler.handleCallback(Handler.java:958) E/GoogleApiManager( 9614): at android.os.Handler.dispatchMessage(Handler.java:99) E/GoogleApiManager( 9614): at bqww.mv(:com.google.android.gms@[email protected] (190800-681941525):1) E/GoogleApiManager( 9614): at bqww.dispatchMessage(:com.google.android.gms@[email protected] (190800-681941525):5) E/GoogleApiManager( 9614): at android.os.Looper.loopOnce(Looper.java:205) E/GoogleApiManager( 9614): at android.os.Looper.loop(Looper.java:294) E/GoogleApiManager( 9614): at android.os.HandlerThread.run(HandlerThread.java:67)

vedatsalmis avatar Oct 14 '24 09:10 vedatsalmis

Hi @vedatsalmis , thanks for the report. I was not able to reproduce this issue. I created a new flutter project and configured it with flutterfire_cli. Could you try that and provide feedback if you still see the issue?

SelaseKay avatar Oct 14 '24 09:10 SelaseKay

Hi @vedatsalmis , thanks for the report. I was not able to reproduce this issue. I created a new flutter project and configured it with flutterfire_cli. Could you try that and provide feedback if you still see the issue?

Here is the situation; I got this error when I upgraded Flutter in existing projects for years. Later, when I created a project from scratch and tried it, I saw that I got the same error in that project. When I added an existing project to Firebase again with CLI, I got the same error again when a function related to Cloud Firestore was triggered. Update : ( I created a new flutter project and configured it with flutterfire_cli but same error)

vedatsalmis avatar Oct 14 '24 10:10 vedatsalmis

Can you try updating your Google Play Services?

SelaseKay avatar Oct 14 '24 11:10 SelaseKay

Can you try updating your Google Play Services?

I have already done it

vedatsalmis avatar Oct 14 '24 11:10 vedatsalmis

Have you tested on other Android devices?

SelaseKay avatar Oct 14 '24 17:10 SelaseKay

Have you tested on other Android devices?

Yes, I tried it on my physical device and got the same error. I tried deleting the emulator and reinstalling it but nothing changed.

vedatsalmis avatar Oct 14 '24 18:10 vedatsalmis

I'm also having the same issue

arunpt avatar Oct 15 '24 06:10 arunpt

Same here. Just added firestore to an existing project, and am getting these errors. Everything else seems to be running okay, but I want to resolve these errors that pop up multiple times, every time I run my project.

mayhew3 avatar Oct 16 '24 06:10 mayhew3

Hi @vedatsalmis, I'm finding it hard to reproduce this issue. I tested on your testapp repo and it seems to work fine on my end.

SelaseKay avatar Oct 16 '24 08:10 SelaseKay

Hi @vedatsalmis, I'm finding it hard to reproduce this issue. I tested on your testapp repo and it seems to work fine on my end.

Yes, but as you can see, I am not the only one experiencing this problem. Almost every day, I receive comments saying that I am experiencing the same problem. Therefore, I think the problem is more widespread.

vedatsalmis avatar Oct 16 '24 10:10 vedatsalmis

I also had this problem with two projects that were working just fine. I did use flutterfire_cli to link both projects to Firebase.

Setting implementation 'com.google.android.gms:play-services-base:18.2.0' in my build.gradle did it! I've run a flutter clean and flutter pub get and my new flutter run worked without any logs of the kind. Thanks for the tip!

Hope the OP and everybody else can solve this as well!


Edit

As a possible link for someone (found while searching) https://github.com/firebase/firebase-android-sdk/issues/5024 there was also this list with crashlytics

FMorschel avatar Oct 16 '24 11:10 FMorschel

@vedatsalmis - Look at you stack trace, there is no mention of any FlutterFire package:

E/GoogleApiManager( 9614): java.lang.SecurityException: Unknown calling package name 'com.google.android.gms'. E/GoogleApiManager( 9614): at android.os.Parcel.createExceptionOrNull(Parcel.java:3057) E/GoogleApiManager( 9614): at android.os.Parcel.createException(Parcel.java:3041) E/GoogleApiManager( 9614): at android.os.Parcel.readException(Parcel.java:3024) E/GoogleApiManager( 9614): at android.os.Parcel.readException(Parcel.java:2966) E/GoogleApiManager( 9614): at amrz.a(:com.google.android.gms@[email protected] (190800-681941525):36) E/GoogleApiManager( 9614): at amqg.z(:com.google.android.gms@[email protected] (190800-681941525):143) E/GoogleApiManager( 9614): at alxh.run(:com.google.android.gms@[email protected] (190800-681941525):54) E/GoogleApiManager( 9614): at android.os.Handler.handleCallback(Handler.java:958) E/GoogleApiManager( 9614): at android.os.Handler.dispatchMessage(Handler.java:99) E/GoogleApiManager( 9614): at bqww.mv(:com.google.android.gms@[email protected] (190800-681941525):1) E/GoogleApiManager( 9614): at bqww.dispatchMessage(:com.google.android.gms@[email protected] (190800-681941525):5) E/GoogleApiManager( 9614): at android.os.Looper.loopOnce(Looper.java:205) E/GoogleApiManager( 9614): at android.os.Looper.loop(Looper.java:294) E/GoogleApiManager( 9614): at android.os.HandlerThread.run(HandlerThread.java:67)

I did a quick google of your issue, and here is a possible solution.

russellwheatley avatar Oct 16 '24 12:10 russellwheatley

@vedatsalmis - Look at you stack trace, there is no mention of any FlutterFire package:

E/GoogleApiManager( 9614): java.lang.SecurityException: Unknown calling package name 'com.google.android.gms'. E/GoogleApiManager( 9614): at android.os.Parcel.createExceptionOrNull(Parcel.java:3057) E/GoogleApiManager( 9614): at android.os.Parcel.createException(Parcel.java:3041) E/GoogleApiManager( 9614): at android.os.Parcel.readException(Parcel.java:3024) E/GoogleApiManager( 9614): at android.os.Parcel.readException(Parcel.java:2966) E/GoogleApiManager( 9614): at amrz.a(:com.google.android.gms@[email protected] (190800-681941525):36) E/GoogleApiManager( 9614): at amqg.z(:com.google.android.gms@[email protected] (190800-681941525):143) E/GoogleApiManager( 9614): at alxh.run(:com.google.android.gms@[email protected] (190800-681941525):54) E/GoogleApiManager( 9614): at android.os.Handler.handleCallback(Handler.java:958) E/GoogleApiManager( 9614): at android.os.Handler.dispatchMessage(Handler.java:99) E/GoogleApiManager( 9614): at bqww.mv(:com.google.android.gms@[email protected] (190800-681941525):1) E/GoogleApiManager( 9614): at bqww.dispatchMessage(:com.google.android.gms@[email protected] (190800-681941525):5) E/GoogleApiManager( 9614): at android.os.Looper.loopOnce(Looper.java:205) E/GoogleApiManager( 9614): at android.os.Looper.loop(Looper.java:294) E/GoogleApiManager( 9614): at android.os.HandlerThread.run(HandlerThread.java:67)

I did a quick google of your issue, and here is a possible solution.

These logs appear when I use firestore functions

vedatsalmis avatar Oct 16 '24 12:10 vedatsalmis