-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
cordova-build-override does not override for Android #5840
Comments
Thanks for the PR @horner. We'll take a look. |
Any update on this, we are having similar issue |
@martijnwalraven accepted the PR #5792 on Jan 7th. In the meantime, I rename the cordova-build-override, build, then put it back and build again... but only after a reset. It's a lot of extra work but it gets it done. |
We are experiencing a similar issue here. Our "meteor build" command fails to take our cordova-build-override/AndroidManifest.xml . We've tried copying this file to .meteor/local/cordova-build/platforms/android before the build ... but to no avail. Can you please provide some guidance on exactly what steps should be taken to ensure that the AndroidManifest.xml file is properly included in the APK? Also, how can we easily verify that it has been copied? Under the build directory, should we be lookinig at /android/project/CordovaLib/AndroidManifest.xml, or android/project/AndroidManifest.xml ... or both? or some other place? Thanks for any assistance you can provide! |
I'm looking at possible changes to the Why do you feel you need to modify |
Thanks for the reply. We are trying to use a Cordova plugin for Mixpanel: https://github.com/samzilverberg/cordova-mixpanel-plugin . This plugin is only a wrapper around native functionality. It seems that we are required to modify permissions in AndroidManifest.xml in order to make Mixpanel push notifications work properly. See https://mixpanel.com/help/reference/android#push_init |
The inability to override AndroidManifest.xml continues to be a major issue for us. We are now confronted with the same problem trying to integrate Branch.io. Is there any workaround to this issue? See Specifically:
:processReleaseResources FAILED FAILURE: Build failed with an exception. AndroidManifest.xml line 62 is cited as the source of the problem no matter how we change cordova-build-override/AndroidManifest.xml. |
Here is where things stand: Added to the top of cordova-build-override/config.xml (which is actually taken):
Each of these hook scripts looks exactly the same : #!/bin/bash Then: chmod a+x projdir/hooks/* We see that the scripts are properly executed when we do: meteor build --verbose builddir --server=$server but STILL the same error is displayed from the original, unaltered AndroidManifest.xml file, indicating that we have still not managed to copy this file at the right time during the build. Here is the output: Building Cordova app for platform Android % Running command: /home/mad/projdir/.meteor/local/cordova-build/hooks/before_prepare.sh /home/mad/projdir/.meteor/local/cordova-build % Running command: /home/mad/projdir/.meteor/local/cordova-build/hooks/after_prepare.sh /home/mad/projdir/.meteor/local/cordova-build % Running command: /home/mad/projdir/.meteor/local/cordova-build/hooks/before_compile.sh /home/mad/projdir/.meteor/local/cordova-build % Running command: /home/mad/projdir/.meteor/local/cordova-build/platforms/android/cordova/build --release
... /home/mad/projdir/.meteor/local/cordova-build/platforms/android/build/intermediates/manifests/full/release/AndroidManifest.xml:51: error: No resource identifier found for attribute 'autoVerify' in package 'android' /home/mad/projdir/.meteor/local/cordova-build/platforms/android/build/intermediates/manifests/full/release/AndroidManifest.xml:75: error: No resource identifier found for attribute 'autoVerify' in package 'android' :processReleaseResources FAILED FAILURE: Build failed with an exception.
|
It seems the error Could you try this with Meteor 1.3 beta, which uses Android SDK version 23? There is also an issue with the |
Thanks for all that useful info! So, first I tried: $ meteor update --release 1.3-modules-beta.8 $ meteor --version This had no impact. The build still gives the same error, same line number, so it appears that my AndroidManifest.xml override is STILL not being taken. I'll be rolling back to 1.2.1 and diving into writing a custom Cordova plugin now, as you suggest.... |
So I've created a Cordova plugin project with a single file in it: plugin.xml, as you suggested. I've now spent a good hour trying to understand how to add this plugin to my project. I've tried many variations of "meteor add cordova: ...", but nothing has worked so far. Sometimes, the command pretends to work, and I see something added when I do "meteor list", but then nothing changes in the build. Other times, I am told "Meteor requires either an exact version (e.g. https://marcadonis@1.0.0), a Git URL with a SHA reference, or a local path." I would be happy to add the plugin from a local path... but I can find no documentation on how to accomplish this. Is "meteor add" documented somewhere? See http://stackoverflow.com/questions/35938360/add-cordova-plugin-to-meteor-from-local-path |
To add a plugin called |
Wow... that actually worked! Thanks for that! BUT There's a big problem with this approach. According to the Cordova plugin docs here: "The config-file element only allows you to append new children to an XML document tree." This is no good, as I still have the same issue with autoVerify due to the fact that I can't replace the offending bit, which is:
Resulting in the same old error: .meteor/local/cordova-build/platforms/android/build/intermediates/manifests/full/release/AndroidManifest.xml:73: error: No resource identifier found for attribute 'autoVerify' in package 'android' (but at a new line number! Hooray!) My own version of this section is correctly inserted into the file, but this bad old code remains. Any other ideas?? Thanks so much for your help getting this far! |
resource-file doesn't seem to be the answer, either. The problem might be that I don't know what "target" to set. I have:
... but my AndroidManifest.xml is not taken in the build. I've tried various locations for "target", including "", "/", "/platforms/android", and variations on ".meteor/local/cordova-build/platforms/android/build/intermediates/manifests/full/release". All of these fail in various ways. So... still searching for a way to override the generated erroneous AndroidManifest.xml . |
@martijnwalraven, it was not working so we used this workaround #7693 in our case. |
PR #5792 was merged to fix the original issue. If there are other related problems here, please consider opening them in new issues. Closing - thanks! |
Create a cordova-build-override/platforms/android/build-extras.gradle
Then run:
While processing a clean build (ie: meteor reset) this error occurs, because the platform directory exists but it empty. It appears that the directory is copied over to the destination before the builder.copyBuildOverride() operation is done. The order should be reversed, per documentation: https://github.com/meteor/meteor/wiki/Meteor-Cordova-integration#advanced-build-customization
Others have issues too: #5373
I developed a pull request with a possible fix, but is has not been accepted. #5792
The text was updated successfully, but these errors were encountered: