1

We are currently trying to update our System to the newest Android Studio/Gradle Tools and are expieriencing some errors on the way.

We do have 2 libraries using the permission.C2D_MESSAGE, namely Firebase and XtremePush. The problem is, as soon as we want to build our application the Manifest Merger fails the build because he wasn't able to complete the merge with the error "No records found. (This is a bug in the manifest merger.)".

When we looked into the issue we found following definitions:

Firebase

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

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

XtremePush

<permission
    android:name=".permission.C2D_MESSAGE"
    android:protectionLevel="signature" />

<uses-permission android:name=".permission.C2D_MESSAGE" />

As both definitions are in external libraries, we are not able to set merging rules or change the manifest details. Also, both libraries are up to date as of today, so there seems to be no solution either on the respective developers side. Setting the permission in our manifest also did not change anything.

Thanks a lot!

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Essi
  • 141
  • 8
  • 1
    "we are not able to set merging rules or change the manifest details" -- define the elements in your own manifest and use `tools:overrideLibrary`, IIRC. – CommonsWare Dec 18 '17 at 14:03
  • Right now both attributes (permission and uses-permission) are right unter the root -tag and i don't have -tag, except for the facebook library. Can i just create another one with the package-names of the libraries and add the overrideLibrary there? – Essi Dec 18 '17 at 14:18
  • 1
    You would put the `` and `` elements in your manifest, configured as you want them, and include `tools:overrideLibrary` on those elements. Then hope for the best. – CommonsWare Dec 18 '17 at 14:20
  • Thanks! This was the correct solution, sadly i can't mark the comment as correct answer. Also another side note, I had to set ${applicationId}.permission.C2D_MESSAGE as the name of the attributes, since we are working with a multi-application-setup and it would not recognize the override for all applications. – Essi Dec 18 '17 at 14:26
  • I suggest that you answer the question yourself, with the actual elements that you used. That will be of greater value to people encountering this question than anything that I can write. – CommonsWare Dec 18 '17 at 14:30

2 Answers2

1

In your Android Manifest file add:

<uses-sdk tools:overrideLibrary="com.example.firebase, com.example.xtremepush"/>
Ege Kuzubasioglu
  • 5,991
  • 12
  • 49
  • 85
0

I solved the problem by first finding out which libraries do clash. For me it was XtremePush with the package name 'ie.imobile.extremepush' and Firebase with the package name 'com.google.firebase'.

Then i change my implementation to..

<permission
    android:name="${applicationId}.permission.C2D_MESSAGE"
    android:protectionLevel="signature"
    tools:overrideLibrary="com.google.firebase, ie.imobile.extremepush" />

<uses-permission android:name="${applicationId}.permission.C2D_MESSAGE"
                 tools:overrideLibrary="com.google.firebase, ie.imobile.extremepush"/>

..so that my manifest would override both manifests, which were clashing and resulted in the merging issue. This was no problem as they both already were nearly identical in function.

Essi
  • 141
  • 8