Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple application android:name tags in manifest

I am using two libraries(SUGAR ORM and Instabug). They both require me to use the android:name tag of the application in my manifest. However, it seems you cannot have duplicates.Is there a way around this?

My manifest:

 <application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:icon="@drawable/runrouter_biggest"
        android:theme="@style/MyTheme"
        tools:replace="android:icon"
        android:name="com.orm.SugarApp"
        //I need to declare a second android:name here>

Thanks, Matt

like image 247
Matt Boyle Avatar asked Dec 25 '22 22:12

Matt Boyle


1 Answers

You seem to be out of luck. You can have only one instance of application class so you can specify only one android:name there.

However, you are actually not out of luck. Instabug does not require you to use their application class, all they need is to call Instanbug.initialize(...)... which you can easily do in your application class derived from SugarApp:

class MyApplication extends SugarApp
{
    @Override
    void onCreate()
    {
        super.onCreate();
        Instabug.initialize(this)
            .setAnnotationActivityClass(InstabugAnnotationActivity.class)
            .setShowIntroDialog(true)
            .setEnableOverflowMenuItem(true);
    }
}

And define this application class in android:name.

like image 184
StenSoft Avatar answered Jan 06 '23 12:01

StenSoft