Hi Xavier,
I just went through the description of the new merger and it seems very 
nice.

However I came to realize that it alone might not save me from the GCM 
issue.

I will have to test it again, but if I remember correctly, GCM grants 
permission only to the application with its same package name, meaning that 
it needs to be in a specific folder structure for each flavor and buildType.

So, for example, if I keep GCMIntentService in main (again, where it 
belongs in my opinion), it will not register because its package will be 
my.application and it won't be accessible from the application 
my.application.flavor1.type1 (and I would find out only by guessing at logs 
at runtime, btw).

In fact now I have a GCMIntentService in each possible combination i need 
(it gives me the creeps).

Could you please tell me I am doing it wrong? I cannot believe the GCM 
implementation is so "wrong".

Anybody else able to have one single GCMIntentService.java working for 
multiple build variants?

On Tuesday, April 1, 2014 6:52:54 PM UTC+2, Xavier Ducrohet wrote:
>
> There's no easy fix right now but we're working on a new manifest merger 
> that will support this use case.
>
>
> On Tue, Apr 1, 2014 at 8:41 AM, Diego Costantini 
> <[email protected]<javascript:>
> > wrote:
>
>> Hi guys,
>> is it possible to have this combination working without file manipulation 
>> in gradle?
>>
>> The problem is that GCM wants to be in the manifest, with an absolute 
>> package name, which instead changes based on the buildvariant.
>> All of this because I couldn't have GCM working while keeping 
>> GCMIntentService.java in main, where it belongs.
>>
>> Do you know how I could solve this?
>>
>> Here is the manifest I had to force for the particular buildVariant I 
>> need now:
>>
>> <?xml version="1.0" encoding="utf-8"?>
>>> <manifest xmlns:android="http://schemas.android.com/apk/res/android";
>>>     package="com.my.app.flavor1" >
>>>
>>>     <permission
>>>         android:name="com.my.app.flavor1.debugQA.permission.C2D_MESSAGE"
>>>         android:protectionLevel="signature" />
>>>
>>>     <application>
>>>         <service 
>>> android:name="com.my.app.flavor1.debugQA.GCMIntentService"/>
>>>         <receiver
>>>             android:name="com.google.android.gcm.GCMBroadcastReceiver"
>>>             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.my.app.flavor1" />
>>>             </intent-filter>
>>>         </receiver>
>>>     </application>
>>> </manifest>
>>>
>>
>> Thanks
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "adt-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Xavier Ducrohet
> Android SDK Tech Lead
> Google Inc.
> http://developer.android.com | http://tools.android.com
>
> Please do not send me questions directly. Thanks! 
>

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to