Closed Logan2014 closed 5 years ago
Hello, What is the exact build error you are seeing? Thanks
@rgomezp I think @Logan2014 described the problem well in the bug report. I.e. the receiver attribute should be enclosed in the application tag of the AndroidManifest not outside it. https://developer.android.com/guide/topics/manifest/receiver-element
The build error is aapt finding an "unexpected element". Also have the same issue
I see. Will have to investigate deeper. Thanks for your patience
Howdy, What Gradle version are you using? Also, if you don't use aapt do you still see the issue?
@rgomep it's Xamarin. So no gradle. I have to say the fix appears quite simple. Put the attribute where it's supposed to be ?? As described in the android documents.
Take a look at this thread. It's Cordova but they were also running into issues with aapt. Maybe you can learn something from their response
Closing due to no response
@rgomezp not sure why you have closed this. It's still a bug regardless of whether it occurs on Cordova as well.
Howdy @ndastur , Could you please try the suggestion from the Edit: Cordova thread? Thanks
@rgomezp can you please confirm which thread you are talking about? Just in case, if you mean the suggestion to turn linking off, that's not a solution. All that does is stop the appt2 tool from running and results in a massive unlinked app
Howdy endastur, First, the receiver isn't required for the SDK to work. Second, if you want to use it, it has to go inside an application tag in your manifest. In other words, this has nothing to do with our SDK since the receiver isn't even required. Hopefully, you can glean something from the Cordova thread, which the other gentleman was able to successfully resolve. I recommend taking another look at his reply. Cheers
Thanks @rgomezp would you mind getting the OneSignal Xamarin SDK documentation updated to reflect that. See your page https://documentation.onesignal.com/docs/xamarin-sdk-setup Section 3.2 could be removed by what you say?
Howdy endastur, We can't remove that as it is our receiver, which of course is needed. The receiver I referenced in the above comment is the Firebase receiver.
Thanks @ndastur for moral support. As I can see this issue was resolved 5 days ago at 3.4.0 release: https://github.com/OneSignal/OneSignal-Xamarin-SDK/releases/tag/3.4.0 (Replaced GCM dependency with Firebase Messaging dependency)
Description:
I receive two build errors when enable "Use incremental Android packaging system (aapt2)" build option: "unexpected element
<receiver>
found in<manifest>
".Environment
Xamarin.Android SDK 9.3.0.22 NuGet Package Manager 5.1.0 Com.OneSignal NuGet package 3.3.0
Steps to Reproduce Issue:
Enable "Use incremental Android packaging system (aapt2)" Android build option.
Self investigation: OneSignal SDK adds receiver tags to AndroidManifest.xml at build stage:
Aapt2 enables more strict checks for AndroidManifest.xml: receiver should be inside application tag.