03-02 21:03:03.087 6253-6253/ D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
03-02 21:03:03.093 6253-6253/ D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
03-02 21:03:03.099 6253-6253/ I/FA: App measurement is starting up, version: 9256
03-02 21:03:03.099 6253-6253/ I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
03-02 21:03:03.120 6253-6253/ I/FA: Collection disabled with firebase_analytics_collection_enabled=0
03-02 21:03:03.129 6253-6253/ I/FirebaseInitProvider: FirebaseApp initialization successful
<receiver
android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
android:enabled="true"
android:exported="false" />
<service
android:name="com.google.android.gms.measurement.AppMeasurementService"
android:enabled="true"
android:exported="false" />
<!--Task exception on worker thread: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist-->
<provider
android:name="com.google.firebase.provider.FirebaseInitProvider"
android:authorities="com.mi.android.globalpersonalassistant.firebaseinitprovider"
android:exported="false"
android:initOrder="100" />
<!--end-->
In my Application, not init it! why FirebaseApp is atuo-start! Can it disable it not start.
Firebase initializes automatically when integrated using the documented steps because it brings in a ContentProvider which is initialized automatically by Android when the app launches. The JavaDoc for FirebaseApp talks a little bit about this.
This blog goes into even more detail.
Related
This is the code I use to connect and write to the database (I want to create a new child node userand assign the value alex to it.
DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();
mDatabase.child("user").setValue("alex");
Note: I have followed the correct set-up instructions and have changed the authorisation of read and write to true. The code was working for about a month but now I can't figure out why its not writing to the database.
Below is my logcat
03-12 14:43:38.882 12158-12158/? I/art: Late-enabling -Xcheck:jni
03-12 14:43:38.900 12158-12165/? I/art: Debugger is no longer active
03-12 14:43:38.900 12158-12165/? I/art: Starting a blocking GC Instrumentation
03-12 14:43:38.923 12158-12158/? W/System: ClassLoader referenced unknown path: /data/app/anaysingh.anaytyproject-1/lib/arm
03-12 14:43:38.932 12158-12158/? I/InstantRun: Instant Run Runtime started. Android package is anaysingh.anaytyproject, real application class is null.
03-12 14:43:39.090 12158-12158/? W/System: ClassLoader referenced unknown path: /data/app/anaysingh.anaytyproject-1/lib/arm
03-12 14:43:39.127 12158-12158/? D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
03-12 14:43:39.136 12158-12158/? D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
03-12 14:43:39.247 12158-12158/? V/FA: Cancelling job. JobID: -129726599
03-12 14:43:39.253 12158-12158/? V/FA: Registered activity lifecycle callback
03-12 14:43:39.255 12158-12158/? I/FirebaseInitProvider: FirebaseApp initialization successful
03-12 14:43:39.264 12158-12174/? V/FA: Collection enabled
03-12 14:43:39.264 12158-12174/? V/FA: App package, google app id: anaysingh.anaytyproject, 1:1025179625916:android:afeaaa816280de9a
03-12 14:43:39.266 12158-12174/? I/FA: App measurement is starting up, version: 11910
03-12 14:43:39.266 12158-12174/? I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
03-12 14:43:39.266 12158-12174/? I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app anaysingh.anaytyproject
03-12 14:43:39.266 12158-12174/? D/FA: Debug-level message logging enabled
03-12 14:43:39.278 12158-12174/? V/FA: Connecting to remote service
03-12 14:43:39.293 12158-12174/? V/FA: Connection attempt already in progress
03-12 14:43:39.379 12158-12158/? W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
03-12 14:43:39.384 12158-12158/? V/FA: onActivityCreated
03-12 14:43:39.534 12158-12158/? D/Connection: https://anaytyproject.firebaseio.com/Nigga
03-12 14:43:39.551 12158-12174/? V/FA: Connection attempt already in progress
03-12 14:43:39.556 12158-12174/? I/FA: Tag Manager is not found and thus will not be used
03-12 14:43:39.557 12158-12174/? D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-4541290412013862895}]
03-12 14:43:39.559 12158-12177/? I/DynamiteModule: Considering local module com.google.android.gms.firebase_database:4 and remote module com.google.android.gms.firebase_database:6
03-12 14:43:39.559 12158-12177/? I/DynamiteModule: Selected remote version of com.google.android.gms.firebase_database, version >= 6
03-12 14:43:39.566 12158-12177/? W/System: ClassLoader referenced unknown path:
03-12 14:43:39.573 12158-12174/? V/FA: Connection attempt already in progress
03-12 14:43:39.574 12158-12174/? V/FA: Activity resumed, time: 4225355
03-12 14:43:39.582 12158-12177/? W/System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/0000004c/n/armeabi-v7a
03-12 14:43:39.582 12158-12177/? W/System: ClassLoader referenced unknown path: /data/user_de/0/com.google.android.gms/app_chimera/m/0000004c/n/armeabi
03-12 14:43:39.604 12158-12178/? I/Adreno: QUALCOMM build : bc479b6, I15255e4b4a
Build Date : 02/22/17
OpenGL ES Shader Compiler Version: XE031.09.00.03
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.5.5.R1.07.00.00.269.019
Remote Branch : NONE
Reconstruct Branch : NOTHING
03-12 14:43:39.608 12158-12178/? I/OpenGLRenderer: Initialized EGL, version 1.4
03-12 14:43:39.608 12158-12178/? D/OpenGLRenderer: Swap behavior 1
03-12 14:43:39.625 12158-12179/? D/NetworkSecurityConfig: No Network Security Config specified, using platform default
03-12 14:43:39.659 12158-12174/? D/FA: Connected to remote service
03-12 14:43:39.660 12158-12174/? V/FA: Processing queued up service tasks: 4
03-12 14:43:44.701 12158-12174/anaysingh.anaytyproject V/FA: Inactivity, disconnecting from the service
03-12 14:43:56.840 12158-12174/anaysingh.anaytyproject V/FA: Recording user engagement, ms: 17290
03-12 14:43:56.840 12158-12174/anaysingh.anaytyproject V/FA: Connecting to remote service
03-12 14:43:56.842 12158-12174/anaysingh.anaytyproject V/FA: Activity paused, time: 4242644
03-12 14:43:56.844 12158-12174/anaysingh.anaytyproject D/FA: Logging event (FE): user_engagement(_e), Bundle[{firebase_event_origin(_o)=auto, engagement_time_msec(_et)=17290, firebase_screen_class(_sc)=MainActivity, firebase_screen_id(_si)=-4541290412013862895}]
03-12 14:43:56.852 12158-12174/anaysingh.anaytyproject V/FA: Connection attempt already in progress
03-12 14:43:56.852 12158-12174/anaysingh.anaytyproject D/FA: Connected to remote service
03-12 14:43:56.852 12158-12174/anaysingh.anaytyproject V/FA: Processing queued up service tasks: 2
What am I doing wrong, my firebase database still shows null. However when I add data manually and read via JS it is working correctly.
The errors tell you that you haven't linked Firebase to your project.
03-12 14:43:39.127 12158-12158/? D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
03-12 14:43:39.136 12158-12158/? D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
Use the Firebase Assistant to set it up:
To open the Firebase Assistant in Android Studio:
Click Tools > Firebase to open the Assistant window.
Click to expand one of the listed features (for example, Analytics), then click the provided tutorial link (for example, Log an Analytics event).
Click the Connect to Firebase button to connect to Firebase and add the necessary code to your app.
Full documentation here.
I'm trying to show an notification with custom sound. I used firebase console to throw an notification.
Here is my code:
Notification notification = builder.setSmallIcon(icon).setTicker(title).setWhen(0)
.setAutoCancel(true)
.setContentTitle(title)
.setContentIntent(pendingIntent)
.setSound(notificationSound)
.setStyle(inboxStyle)
.setWhen(getTimeInMilliSec(timeStamp))
.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), icon))
.setContentText(message).build();
NotificationManager notificationManager = (NotificationManager) context.getSystemService(NOTIFICATION_SERVICE);
notificationManager.notify(NOTIFICATION_ID_SMALL_IMAGE, notification);
Here notificationSound = Uri.parse(SCHEME_ANDROID_RESOURCE + "://" + context.getPackageName() + "/raw/notification");
I placed my notification.mp3 file here: res/raw/notification.
I got the notification as expected but I didn't get any notification sound.
Here are the logs when I get notification:
11-14 10:08:31.200 16509-16509/com.hago.ntr D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
11-14 10:08:31.220 16509-16509/com.hago.ntr D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
11-14 10:08:31.272 16509-16509/com.hago.ntr I/FA: App measurement is starting up, version: 9683
11-14 10:08:31.272 16509-16509/com.hago.ntr I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
11-14 10:08:31.272 16509-16509/com.hago.ntr D/FA: Debug-level message logging enabled
11-14 10:08:31.272 16509-16509/com.hago.ntr D/FA: AppMeasurement singleton hash: 266608187
11-14 10:08:31.299 16509-16509/com.hago.ntr V/FA: Collection enabled
11-14 10:08:31.299 16509-16509/com.hago.ntr V/FA: App package, google app id: com.hago.ntr, 1:317122300577:android:6c0b483c0a4e3f40
11-14 10:08:31.299 16509-16509/com.hago.ntr I/FA: To enable faster debug mode event logging run:
adb shell setprop firebase.analytics.debug-mode com.hago.ntr
11-14 10:08:31.343 16509-16509/com.hago.ntr V/FA: Registered activity lifecycle callback
11-14 10:08:31.345 16509-16509/com.hago.ntr I/FirebaseInitProvider: FirebaseApp initialization successful
11-14 10:08:31.347 16509-16509/com.hago.ntr I/InstantRun: starting instant run server: is main process
11-14 10:08:31.354 16509-16552/com.hago.ntr V/FA: Using measurement service
11-14 10:08:31.368 16509-16552/com.hago.ntr V/FA: Connecting to remote service
11-14 10:08:31.459 16509-16552/com.hago.ntr I/FA: Tag Manager is not found and thus will not be used
11-14 10:08:31.465 16509-16552/com.hago.ntr D/FA: Logging event (FE): _nr, Bundle[{_o=fcm, _ndt=0, _nmt=1510634308, _nmid=7758633434821297510}]
11-14 10:08:31.468 16509-16552/com.hago.ntr V/FA: Using measurement service
11-14 10:08:31.468 16509-16552/com.hago.ntr V/FA: Connection attempt already in progress
11-14 10:08:31.473 16509-16552/com.hago.ntr D/FA: Connected to remote service
11-14 10:08:31.473 16509-16552/com.hago.ntr V/FA: Processing queued up service tasks: 2
11-14 10:08:36.494 16509-16552/com.hago.ntr V/FA: Inactivity, disconnecting from the service
What might be the issue ?
Try to add this code below Pending intent
try {
Uri defaultSoundUri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.fileName);
Ringtone r = RingtoneManager.getRingtone(getApplicationContext(), defaultSoundUri);
r.play();
} catch (Exception e) {
e.printStackTrace();
}
For more please follow below links
https://github.com/firebase/quickstart-android/tree/master/messaging
https://firebase.google.com/docs/cloud-messaging/android/client
Also if you want to manage or customize notifications bar please follow below link
https://developer.android.com/guide/topics/ui/notifiers/notifications.html
I am trying to integrate Firebase analytics and Google tag manager into my Android app. I have configured some tags and triggers over my GTM console. But i see the following error in my debug console in Android studio. What i am trying to achieve is send my events to both Firebase analytics, GTM and then push the same event to Google analytics using Google tag manager. My events are successfully pushed to Firebase analytics, but not to Google analytics.
Firebase event tracking:
Bundle params = new Bundle();
params.putString("screen_name", "Main activity");
mFirebaseAnalytics.logEvent("screenview", params);
Debug log:
04-06 21:27:19.701 14388-23135/com.droidowl.googletagmanager V/FA: Activity resumed, time: 1495667
04-06 21:27:21.098 14388-23135/com.droidowl.googletagmanager D/FA: Passing event to registered event handler (FE): screenview, Bundle[{screen_name=Main activity}]
04-06 21:27:21.103 14388-14829/com.droidowl.googletagmanager D/FA: Fetching user attributes (FE)
04-06 21:27:21.109 14388-23135/com.droidowl.googletagmanager V/FA: Using measurement service
04-06 21:27:21.109 14388-23135/com.droidowl.googletagmanager V/FA: Connecting to remote service
04-06 21:27:21.157 14388-23135/com.droidowl.googletagmanager D/FA: Connected to remote service
04-06 21:27:21.158 14388-23135/com.droidowl.googletagmanager V/FA: Processing queued up service tasks: 1
04-06 21:27:21.170 14388-14829/com.droidowl.googletagmanager W/GoogleTagManager: No user property available for "item_id" and no default value was defined. Returning "undefined".
04-06 21:27:21.174 14388-14829/com.droidowl.googletagmanager W/GoogleTagManager: No user property available for "item_id" and no default value was defined. Returning "undefined".
04-06 21:27:21.179 14388-23135/com.droidowl.googletagmanager D/FA: Logging event (FE): screenview, Bundle[{screen_name=Main activity, _o=app+gtm}]
04-06 21:27:26.190 14388-23135/com.droidowl.googletagmanager V/FA: Inactivity, disconnecting from AppMeasurementService
Play services version: 9.4.0
I want added Firebase into my application. I write below codes, but when running application I can't see TOKEN in log!
My dependencies :
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7'
compile 'com.google.firebase:firebase-messaging:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Manifest :
<application>
...
<!--Firebase service-->
<service android:name=".CloudMSG.MyFirebaseInctanceIdService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
</application>
MyFirebaseInctanceIdService :
public class MyFirebaseInctanceIdService extends FirebaseInstanceIdService {
private static final String TAG = "MyFirebaseInctance";
#Override
public void onTokenRefresh() {
// Get updated InstanceID token.
String refreshedToken = FirebaseInstanceId.getInstance().getToken();
Log.d("MyFirebaseInctance", "Refreshed token: " + refreshedToken);
// If you want to send messages to this application instance or
// manage this apps subscriptions on the server side, send the
// Instance ID token to your app server.
//sendRegistrationToServer(refreshedToken);
}
}
Logs:
03-30 13:36:42.943 9487-9487/? I/art: Late-enabling -Xcheck:jni
03-30 13:36:43.218 9487-9487/com.example.mohammad.a1_firebase D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
03-30 13:36:43.269 9487-9487/com.example.mohammad.a1_firebase W/InstanceID/Rpc: Found 10004
03-30 13:36:43.298 9487-9487/com.example.mohammad.a1_firebase D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
03-30 13:36:43.364 9487-9487/com.example.mohammad.a1_firebase I/FA: App measurement is starting up, version: 10084
03-30 13:36:43.364 9487-9487/com.example.mohammad.a1_firebase I/FA: To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
03-30 13:36:43.364 9487-9487/com.example.mohammad.a1_firebase D/FA: Debug-level message logging enabled
03-30 13:36:43.364 9487-9487/com.example.mohammad.a1_firebase D/FA: AppMeasurement singleton hash: 720240273
03-30 13:36:43.404 9487-9487/com.example.mohammad.a1_firebase V/FA: Collection enabled
03-30 13:36:43.404 9487-9487/com.example.mohammad.a1_firebase V/FA: App package, google app id: com.example.mohammad.a1_firebase, 1:685652680518:android:0280a3bc1c6da8cb
03-30 13:36:43.405 9487-9487/com.example.mohammad.a1_firebase I/FA: To enable faster debug mode event logging run:
adb shell setprop debug.firebase.analytics.app com.example.mohammad.a1_firebase
03-30 13:36:43.463 9487-9487/com.example.mohammad.a1_firebase V/FA: Registered activity lifecycle callback
03-30 13:36:43.465 9487-9487/com.example.mohammad.a1_firebase I/FirebaseInitProvider: FirebaseApp initialization successful
03-30 13:36:43.467 9487-9487/com.example.mohammad.a1_firebase I/InstantRun: Starting Instant Run Server for com.example.mohammad.a1_firebase
03-30 13:36:43.471 9487-9587/com.example.mohammad.a1_firebase V/FA: Using measurement service
03-30 13:36:43.489 9487-9587/com.example.mohammad.a1_firebase V/FA: Connecting to remote service
03-30 13:36:43.528 9487-9587/com.example.mohammad.a1_firebase W/GooglePlayServicesUtil: Google Play services out of date. Requires 10084000 but found 6599430
03-30 13:36:43.612 9487-9487/com.example.mohammad.a1_firebase D/ContextHelper: convertTheme. context->name=com.example.mohammad.a1_firebase themeResourceId=2131230883
03-30 13:36:43.656 9487-9487/com.example.mohammad.a1_firebase W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
03-30 13:36:43.690 9487-9487/com.example.mohammad.a1_firebase V/FA: onActivityCreated
03-30 13:36:43.696 9487-9487/com.example.mohammad.a1_firebase I/PhoneWindow: [generateLayout] setColorNavigationBar => color=0x ff000001
03-30 13:36:43.718 9487-9487/com.example.mohammad.a1_firebase D/PhoneWindowEx: [PWEx][generateLayout] setNavigationBarColor2 : colors=0xfff5f5f5
03-30 13:36:43.718 9487-9487/com.example.mohammad.a1_firebase I/PhoneWindow: [setNavigationBarColor2] color=0x fff5f5f5
03-30 13:36:43.859 9487-9587/com.example.mohammad.a1_firebase V/FA: Using measurement service
03-30 13:36:43.859 9487-9587/com.example.mohammad.a1_firebase V/FA: Connection attempt already in progress
03-30 13:36:43.864 9487-9587/com.example.mohammad.a1_firebase V/FA: Activity resumed, time: 1436094125
03-30 13:36:43.879 9487-9612/com.example.mohammad.a1_firebase D/OpenGLRenderer: Render dirty regions requested: true
03-30 13:36:43.881 9487-9612/com.example.mohammad.a1_firebase I/Adreno-EGL: <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.00.02.042.013_msm8974_LA.BF.1.1.1_RB1__release_AU ()
OpenGL ES Shader Compiler Version: E031.25.03.00
Build Date: 01/21/15 Wed
Local Branch: mybranch7061829
Remote Branch: quic/LA.BF.1.1.1_rb1.7
Local Patches: NONE
Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.1_RB1.05.00.02.042.013 + NOTHING
03-30 13:36:43.882 9487-9612/com.example.mohammad.a1_firebase I/OpenGLRenderer: Initialized EGL, version 1.4
03-30 13:36:43.910 9487-9612/com.example.mohammad.a1_firebase D/OpenGLRenderer: Enabling debug mode 0
03-30 13:36:43.916 9487-9487/com.example.mohammad.a1_firebase D/Atlas: Validating map...
03-30 13:36:43.927 9487-9487/com.example.mohammad.a1_firebase W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
03-30 13:36:43.936 9487-9592/com.example.mohammad.a1_firebase D/FirebaseInstanceId: background sync failed: SERVICE_NOT_AVAILABLE, retry in 30s
03-30 13:36:44.008 9487-9502/com.example.mohammad.a1_firebase W/art: Suspending all threads took: 5.068ms
03-30 13:36:44.047 9487-9487/com.example.mohammad.a1_firebase W/art: Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView
03-30 13:36:44.183 9487-9487/com.example.mohammad.a1_firebase I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#755dbad time:128236912
03-30 13:37:14.017 9487-10051/com.example.mohammad.a1_firebase D/FirebaseInstanceId: background sync failed: SERVICE_NOT_AVAILABLE, retry in 60s
How can I fix this issue and show Firebase token in logs?
Firebase onTokenRefresh() will only be called if your token changes. Before that you should invoke
FirebaseInstanceId.getInstance().getToken()
in your initial activity (like MainActivity) maybe.
why you not tried integrated android studio with firebase directly using Tools menu-->firebase
add this line Gradle :-Module(app)
compile 'com.google.firebase:firebase-crash:10.2.0'
compile 'com.google.firebase:firebase-auth:10.2.0'
Try to uninstall the application and re-install , you will see the
Refreshed token in the logcat.
Also check in firebase console that Anonymous sign-in status is
Enabled or not in Authentication menu -> Sign in method
I have implement firebase analytics in my app, but not show up any event or log in fire base console.
Add bellow code in each fragment in onCreateView() method.
private void addFragmentInFirebaseAnalytics() {
FirebaseAnalytics firebaseAnalytics = FirebaseAnalytics.getInstance(getContext());
FragmentItem fragmentItem = new FragmentItem();
fragmentItem.setFragmentId(Constant.FM_ID_MOIST_AIR);
fragmentItem.setFragmentName(MoistAirActivity.class.getSimpleName());
Bundle bundle = new Bundle();
bundle.putInt(FirebaseAnalytics.Param.ITEM_ID, fragmentItem.getFragmentId());
bundle.putString(FirebaseAnalytics.Param.ITEM_NAME, fragmentItem.getFragmentName());
//Logs an app event.
firebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundle);
Log.d(TAG,"bundle >>"+bundle);
}
Used dependency is :
compile 'com.google.firebase:firebase-core:9.4.0'
used plugin :
apply plugin: 'com.google.gms.google-services'
Its work fine and show log like this in debug console,
09-14 12:30:42.967 D/FA ( 8821): Logging event (FE): select_content, Bundle
[{_o=app, _ev=item_id, item_name=MoistAirActivity, content_type=Navigation Menu,
_err=4}]
09-14 12:30:42.977 V/FA ( 8821): Using measurement service
09-14 12:30:42.977 V/FA ( 8821): Connecting to remote service
09-14 12:30:43.217 D/FA ( 8821): Connected to remote service
09-14 12:30:43.217 V/FA ( 8821): Processing queued up service tasks: 1
09-14 12:30:43.217 E/FA ( 8821): Task exception on worker thread: java.lang
.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist. : com.goo
gle.android.gms.measurement.internal.zzt.zzEd(Unknown Source)
09-14 12:30:48.217 V/FA ( 8821): Inactivity, disconnecting from AppMeasurem
entService
but not show any uploading message in debug console and firebase console after 24 hours,
So, whats wrong here ? please help.
Finally i resolved this problem by replacing tools:node="replace" to tools:node="merge" and add tools:replace="android:label" in menifest file.
Reference : FirebaseApp with name [DEFAULT] doesn't exist
For me this worked:
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
in the AndroidManifest.xml.
I've not specified any tools attribute.
There are a few things that could be going on here. You will see more diagnostic messages if you run:
adb shell setprop log.tag.FA VERBOSE
and if your test device has Google Play Services installed, also run:
adb shell setprop log.tag.FA-SVC VERBOSE
Those commands will display more information in your logcat. Are there any errors from FA or FA-SVC on application startup?