javaandroidadsflurryflurry-analytics

Flurry integration Android throwing errors


I'm trying to integrate flurry into my android app. I'm using the recommended setting and have repositories{jcenter()} and

// Required for Flurry Analytics integration compile 'com.flurry.android:analytics:8.2.0@aar' // Optional - If you want to use the Ads SDK compile 'com.flurry.android:ads:8.2.0@aar'

in the gradle as the docs suggest. I keep getting errors in the that Application is not resolved. The docs really blow and I'm not 100% sure what going on. I've never integrated flurry before can someone please help! I put the manifest and the class i'm using below. I know it doesn't have a key I'm still working on removing errors. I'm dumping the that class in the main file for simplicity for now.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="tempconversion.october.com.myapplication">
    <!-- Required permissions - Internet access -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <!-- Highly Recommended permission - External memory pre-caching -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <!-- Optional permission - Location based ad targeting -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <application

        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="F to C and K"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>

class in main file

    public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        new FlurryAgent.Builder()
                .withLogEnabled(true)
                .withCaptureUncaughtExceptions(true)
                .withContinueSessionMillis(10)
                .withLogLevel(VERBOSE)
                .build(this, FLURRY_API_KEY);
    }
}

Solution

  • Declare the application name in manifest.xml file.

     <application
        android:name=".MyApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="F to C and K"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
    
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
    
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>