Search code examples
androidbuckexopackage

DefaultApplicationLike Won't Work With AndroidStudio


I am setting up Exopackage

You need to extend your Application class from DefaultApplicationLike rather than android.app.Application.

The problem is 2 fold:

  1. Extending from this class gives and error in the AndroidManfest.xml file where you need to assign android:name=".App"

.App is not assignable to android.app.Application

  1. Lifecycle hooks are lost. For example attachBaseContext(Context base) (from Application's implementation of ContextWrapper)

My hope with Buck is that I can still use the Android Studio IDE.

Is there a way to make DefaultApplicationLike implement Application or another way to make exopackage work with an Android Studio project?


Solution

  • It looks like you need to continue reading the guide. The next step is to create a new class that extends from ExopackageApplication. ExopackageApplication extends android.app.Application so if you use that in your AndroidManifest.xml it should work.