Android : Gradle buildTypes + flavors - providers and GCM

on Tuesday, January 27, 2015


====PROBLEM====


I am trying to allow the installation of both debug and release versions on one device. My app is made of few modules and I have 3 flavors. All of these modules have different packages in their manifest. The way I'm dealing with my ContentProviders is:



<provider
android:name="com.myapp.testapp.modules.mailboxes.MailboxesProvider"
android:authorities="${applicationId}.provider.MailboxesProvider"
android:exported="false"
android:multiprocess="true" >
</provider>

private static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".provider.MailboxesProvider";


And it looks like its ok but when I am trying to install second one(debug) I get error [INSTALL_FAILED_CONFLICTING_PROVIDER], also whenever I install the first one(release) there is info about problem with GCM persmissions even tho I am changing its package accordingly:



<permission android:protectionLevel="signature"
android:name="${applicationId}.permission.C2D_MESSAGE" />
<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"/>


====QUESTION====


Is applicationId enough to deal with all different packages? Why I'm getting GCM errors even tho I change the package info?


0 comments:

Post a Comment