-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config.xml parsing breaks on cordova-android 6.4.0 #206
Comments
From parse config log: Log from example app:
|
Found a workaround, but the situation is pretty unfortunate. cordova-android Apparently, the There isn't much more the UA library can do -- there is no way to request a string from the
I also tried various xml namespace type hints, but that was just flailing. So, workaround?It's nasty. <platform name="android">
<preference name="com.urbanairship.gcm_sender" value="123456789012\" /> <!-- added trailing backslash slash -->
</platform>
<!-- Normal for iOS -->
<preference name="com.urbanairship.gcm_sender" value="123456789012" />
This "just happens to work" with the new XML parser, but it is NOT compatible with iOS or the previous Well, uhThis will need to be addressed going forward toward Thanks for reading! |
Better workaround: Disabling AAPT2So, actually, creating a Unfortunately I don't see a built-in way for plugins to edit this file, but I can now confirm that AAPT2 is causing this xml parsing difference, just like in the SO thread I linked above |
Made a quick plugin: https://github.com/runtrizapps/cordova-android-disable-aapt2 Works on my box™ |
@davidgovea Awesome work. Definitely looks like an AAPT2 bug, not sure how we are going to work around it right now. Ill report back once we have a solution. |
Google issue: https://issuetracker.google.com/issues/69347762 Long term solution we are looking into allowing calling takeOff from JS, however we are running into some migration issues, so its probably not going to happen in the next release. For the short term, we are going to allow prefixing the sender ID with |
[GH-206] Add workaround to AAPT2 issue
Released 6.9.3 with the changes and README updates. |
Thank you! |
Hi UA team,
Just tracked down a weird one.
I was failing to receive push messages on Android, but channel registration and rich push messages were coming in fine.
Inspecting logcat showed
INVALID_SENDER
gcm registration errors (will add log in comment)This was weird, because previous app versions were still working, and the project setup had not changed.
Turns out
the issue is related to
cordova-android
version 6.4.0.Rather than parsing a GCM sender ID as
"123456789012"
, thepluginConfig.getString()
call is returning something like1.23456765E11
. (note the float precision skew, hah)This can be replicated on the sample app, by simply updating the android platform version from
6.3.0
to6.4.0
. Not sure if all GCM sender IDs are numeric, but this doesn't happen if there are any alphanumeric characters in the sender ID.The text was updated successfully, but these errors were encountered: