I have a main project which references a library project. They both are compiled with Gradle. 

This is the defaultConfig for the main project gradle file: 

```
defaultConfig {
    applicationId "com.example.app"
    minSdkVersion 15
    targetSdkVersion 21
    versionCode 2
    versionName "1.0"
}

```

And this is the defaultConfig for the library project gradle file:

```
defaultConfig {
    minSdkVersion 11
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}

```

As you can see, I don't declare any applicationId inside the library.

I have a **permission** defined inside my **library** project as below:

```
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.example.library">

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

```

When I build the project, the *applicationId* gets replaced with *com.example.library* (the library package name). And that's not what I want. I want it to be replaced with *com.example.app* since it's my app's *applicationId*.

If I put the **${applicationID}** placeholder inside app's manifest file, everything works. 

Does anyone knows if this can be accomplished and how?