0

I've tried to add Firebase Cloud Messaging and Google/Firebase Analytics in my Application.

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.Web"
android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
android:versionCode="26"
android:versionName="1.2.60">
<uses-sdk
    android:minSdkVersion="15"
    android:targetSdkVersion="24" />
<application
    android:name=".AnalyticsTracker"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/MyMaterialTheme">
    <activity
        android:name="com.example.Login"
        android:configChanges="orientation|keyboardHidden"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

    <service
        android:exported="false"
        android:name=".FirebaseMessage">

        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT"/>
        </intent-filter>
    </service>
    <service
        android:exported="false"
        android:name=".FirebaseInstanceID">
        <intent-filter>
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
        </intent-filter>
    </service>
</application>

Running Services

Any thoughts what's causing this? This "MeasurementBrokerService" leaks a lot of memory in my Application for no reason at all. There was a similar post but no solution was found.

I run the latest Google Play Services so nothing is outdated

UPDATED i got the \app\build\intermediates\manifests\full\debug\AndroidManifest.xml

It contains quite a lot "services" and declares, more than the AndroidManifest.xml in the android studio.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.web"
android:versionCode="26"
android:versionName="1.2.60" >

<uses-sdk
    android:minSdkVersion="15"
    android:targetSdkVersion="24" />

<supports-screens
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:xlargeScreens="true" />

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

<permission
    android:name="com.example.web.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />

<uses-permission android:name="com.example.web.permission.C2D_MESSAGE" />

<application
    android:name="com.example.web.AnalyticsTracker"
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/MyMaterialTheme" >
    <meta-data
        android:name="com.samsung.android.sdk.multiwindow.enable"
        android:value="true" />
    <meta-data
        android:name="com.samsung.android.sdk.multiwindow.multiinstance.enable"
        android:value="false" />
    <meta-data
        android:name="com.sec.android.multiwindow.STYLE"
        android:value="fixedRatio" />
    <meta-data
        android:name="com.sec.android.support.multiwindow"
        android:value="true" />

    <activity
        android:name="com.example.web.MainActivity"
        android:configChanges="orientation|keyboardHidden"
        android:label="@string/app_name" />
    <activity
        android:name="com.example.web.Login"
        android:configChanges="orientation|keyboardHidden"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

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

    <service
        android:name="com.example.web.FirebaseMessage"
        android:exported="false" >
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>
           
    <receiver android:name="com.example.web.Autostart" >
        <intent-filter>
            <action android:name="android.intent.action.BOOT_COMPLETED" />
            <action android:name="android.intent.action.QUICKBOOT_POWERON" />
            <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
        </intent-filter>
    </receiver>

    <service
        android:name="com.fexample.web.FirebaseInstanceID"
        android:exported="false" >
        <intent-filter>
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>
    <activity
        android:name="com.google.android.gms.common.api.GoogleApiActivity"
        android:exported="false"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" />

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />

    <service
        android:name="com.google.firebase.messaging.FirebaseMessagingService"
        android:exported="true" >
        <intent-filter android:priority="-500" >
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

    <receiver
        android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
        android:exported="true"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

            <category android:name="com.example.web" />
        </intent-filter>
    </receiver>

    <receiver
        android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
        android:exported="false" />

    <service
        android:name="com.google.firebase.iid.FirebaseInstanceIdService"
        android:exported="true" >
        <intent-filter android:priority="-500" >
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>

    <provider
        android:name="com.google.firebase.provider.FirebaseInitProvider"
        android:authorities="com.example.web.firebaseinitprovider"
        android:exported="false"
        android:initOrder="100" />

    <service
        android:name="com.google.firebase.crash.internal.service.FirebaseCrashReceiverService"
        android:process=":background_crash" />
    <service
        android:name="com.google.firebase.crash.internal.service.FirebaseCrashSenderService"
        android:process=":background_crash" />

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

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

    <activity
        android:name="com.google.android.gms.appinvite.PreviewActivity"
        android:exported="true"
        android:theme="@style/Theme.AppInvite.Preview" >
        <intent-filter>
            <action android:name="com.google.android.gms.appinvite.ACTION_PREVIEW" />

            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.google.android.gms.ads.AdActivity"
        android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
        android:theme="@android:style/Theme.Translucent" />
    <activity
        android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
        android:theme="@style/Theme.IAPTheme" />
    <activity
        android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
        android:excludeFromRecents="true"
        android:exported="false"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" />

    <service
        android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
        android:exported="true"
        android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />
</application>

Community
  • 1
  • 1
  • Can you run `gradle :app:assembleDebug` and then post the output of `cat app/build/intermediates/manifests/full/debug/AndroidManifest.xml` ? – Sam Stern Jul 22 '16 at 16:05
  • Actually from the screenshot it does not look like MeasurementBrokerService is in your application at all, it's a service within Google Play Services. Your app is using Google Play Services to report analytics data to Firebase, as you said. – Sam Stern Jul 22 '16 at 16:06
  • Updated the original question, thanks for the responses! – Antonis Frs Jul 23 '16 at 13:01

0 Answers0