I cannot reproduce it, this is my set up :

def final String PACKAGE_NAME = "com.android.tests.flavored"

android {
    compileSdkVersion 19
    buildToolsVersion '19.1.0'

    testBuildType = "staging"

    defaultConfig {
    }

    productFlavors {
        f1 {
            applicationId = PACKAGE_NAME + ".f1"
            versionName = "1.0.0-f1"
        }
        f2 {
            applicationId = PACKAGE_NAME + ".f2"
            versionName = "1.0.0-f2"
        }
    }

    buildTypes {
        debug {
            applicationIdSuffix = ".debug"
            versionNameSuffix = ".D"
        }
        staging {
            applicationIdSuffix = ".staging"
            versionNameSuffix = ".S"
            signingConfig signingConfigs.debug
        }
    }
}

AndroidManifest.xml in src/main :

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

and once built i get :

 ~/oss/adt/sdk/build-tools/android-L/aapt d permissions
./build/outputs/apk/bug-f1-debug.apk

package: com.android.tests.flavored.f1.debug

permission:
com.android.tests.flavored.f1.debug.richpush.permission.C2D_MESSAGE

uses-permission:
name='com.android.tests.flavored.f1.debug.richpush.permission.C2D_MESSAGE'

permission: com.android.tests.flavored.f1.debug.richpush.permission.UA_DATA

uses-permission:
name='com.android.tests.flavored.f1.debug.richpush.permission.UA_DATA'

Can you look in the merged manifest file at

./build/intermediates/manifests/dev/qa/AndroidManifest.xml

and check the permissions ? are they correct or already mangled ?

any overlay manifest file in your project ?

On Wed Jul 30 2014 at 2:20:22 PM Jerome Dochez <[email protected]> wrote:

> this does not seem correct indeed, let me try to reproduce it on my end.
>
> thanks for reporting.
> jerome
>
> On Wed Jul 30 2014 at 12:02:40 PM Ray Hunter <[email protected]>
> wrote:
>
>> I am wondering if anyone has seen this issue. I have searched on the web,
>> but I have not found anything yet.
>>
>> I have the following setup:
>>
>> ------------------------------------------------------------
>> Gradle 1.12
>> ------------------------------------------------------------
>>
>> Build time:   2014-04-29 09:24:31 UTC
>> Build number: none
>> Revision:     a831fa866d46cbee94e61a09af15f9dd95987421
>>
>> Groovy:       1.8.6
>> Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
>> Ivy:          2.2.0
>> JVM:          1.7.0_60 (Oracle Corporation 24.60-b09)
>> OS:           Mac OS X 10.9.4 x86_64
>>
>>
>> The following config:
>>
>> # modified some
>> def final String PACKAGE_NAME = "com.example.marketing.android"
>>
>> android {
>>
>>     compileSdkVersion 19
>>     buildToolsVersion "19.1.0"
>>
>>     defaultConfig {
>>         minSdkVersion 7
>>         targetSdkVersion 19
>>     }
>>
>>     lintOptions {
>>         abortOnError false
>>     }
>>
>>     productFlavors {
>>         dev {
>>             applicationId PACKAGE_NAME + ".dev"
>>         }
>>     }
>>
>>     buildTypes {
>>         debug {
>>             ...
>>             applicationIdSuffix ".debug"
>>             versionNameSuffix " Debug"
>>         }
>>
>>         qa {
>>             ...
>>             applicationIdSuffix ".qa"
>>             versionNameSuffix " QA"
>>         }
>>
>>         release {
>>             ...
>>         }
>>     }
>> }
>>
>> In the AndroidManifest.xml found under src/main. I am using the
>> placeholder ${applicationId} and I am getting some unexpected results when
>> expanded. I am adding Urban Airship to my project and see issues with the
>> permissions, receiver and provider:
>>
>> <permission android:name="${applicationId}.richpush.permission.C2D_MESSAGE"
>> android:protectionLevel="signature"/>
>> <uses-permission android:name="${applicationId}.richpush.permission.C2D_
>> MESSAGE"/>
>> <permission android:name="${applicationId}.richpush.permission.UA_DATA"
>> android:protectionLevel="signature"/>
>> <uses-permission android:name="${applicationId}
>> .richpush.permission.UA_DATA"/>
>>
>>
>> So when I build the DevQa build: ./gradlew clean assembleDevQa
>>
>> I can check the generated apk file with the following command: aapt d
>> permissions marketing/build/outputs/apk/marketing-dev-qa.apk
>>
>> And get the results:
>>
>> package: com.example.marketing.android.dev.qa
>> permission: com.example.marketing.android.dev.qa.dev.
>> qa.richpush.permission.C2D_MESSAGE
>> uses-permission: com.example.marketing.android.dev.qa.dev.
>> qa.richpush.permission.C2D_MESSAGE
>> permission: com.example.marketing.android.dev.qa.dev.
>> qa.richpush.permission.UA_DATA
>> uses-permission: com.example.marketing.android.dev.qa.dev.
>> qa.richpush.permission.UA_DATA
>>
>>
>> Notice that the "dev.qa" portion of the package is duplicated 2 times.
>>
>> This does not seem like the correct behavior, but I wanted to verify. I
>> tried searching for bugs along this to see if someone had submitted
>> anything, but did not find anything. Perhaps I missed something?
>>
>>
>> Thanks,
>> Ray
>>
>>
>>
>>  --
>> 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.
>>
>

-- 
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