0

In starters, I have read this thread: Remove firebase analytics from android app completely - but it didn't give me answer to my problem. In app I am developing I had to implement push notifications. I wanted to start with GCM, then I discovered Firebase. I added it to my project and then realized the pricing on it. I decided to scrap it and come back to GCM. I removed all Firebase-related stuff from my code and I thought everything will be allright.

Lately I started to work on an optimization of that app and noticed certain information in debug log:

07-06 07:03:39.310 13286-13474/com.example.myapp D/FirebaseInstanceId: background sync failed: MISSING_INSTANCEID_SERVICE, retry in 20s

It goes on and on, doubling the retry time. I'm not sure how does it affect my app (hovewer, once I saw big loss of frames everytime it happened), but I am completely dumbfound about Firebase still being in my app. Only instances of it are located in build folder, which means I can't erase them myself. I tried to use configurations, I tried to exclude this for GCM exclusively, still nothing.

configurations {
    all*.exclude group: 'com.google.firebase', module: 'firebase-core'
    all*.exclude group: 'com.google.firebase', module: 'firebase-iid'
    all*.exclude group: 'com.google.firebase', module: 'firebase-common'
}

It is right in the beggining of my build.gradle file. Not sure if it's important, but Android Studio tells me that it can't resolve symbol "exclude" in here. I also tried to put this in compile GCM (of course without all* in there), but it didn't change anything.

tl;dr I want to get rid of Firebase and still have GCM in my project. Any ideas?

Community
  • 1
  • 1
n4zArh
  • 68
  • 1
  • 8
  • remove dependency of firebase analytic from gradle(module) – Vishal Patoliya ツ Jul 06 '16 at 11:52
  • FCM is upgraded version of GCM , and it is recommended by google to use FCM, anyways your problen is diffrent, remove google play services dependancy and use `com.google.android.gms:play-services-gcm:9.2.0` – Gaurav Jul 06 '16 at 12:30

2 Answers2

0

also remove FirebaseMessagingService and InstanceIDReceiver from the manifest.xml file.

Remove the following from module manifest file.

        <service
            android:name=".MyFirebaseMessagingService">
            <intent-filter>
                <action android:name="com.google.firebase.MESSAGING_EVENT"/>
            </intent-filter>
        </service>
        <!-- [END firebase_service] -->
        <!-- [START firebase_iid_service] -->
        <service
            android:name=".MyFirebaseInstanceIDService">
            <intent-filter>
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
            </intent-filter>
        </service>

And also remove dependencies from your module level buil gradle file.

Saini
  • 734
  • 3
  • 8
  • Manifest file is cleared since a long time. And I can find no dependencies in any build.gradle files. – n4zArh Jul 06 '16 at 17:16
0

I had the same problem. I have searched in google already, did a small thing and now it works.

Replace dependencies build.gradle (app_name)

dependencies {
    ....
    classpath 'com.google.gms:google-services:1.5.0-beta2'
    ....
}

And

Replace dependencies in app/build.gradle

dependencies {
    ....
    compile "com.google.android.gms:play-services:8.3.0"
    ....
}

Clean project and rebuild project.

Why in classpath must be in 1.5.0-beta2 version? Because version after this already included firebase.

I hope this can help.

YakovL
  • 7,557
  • 12
  • 62
  • 102