cordova edit-config not updating AndroidManifest.xml

风格不统一 提交于 2019-12-10 10:26:25

问题


I am trying to update the AndroidManifest.xml file with the following in config.xml:

<platform name="android">
  <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
  <application android:icon="@mipmap/appicons" android:roundIcon="@mipmap/appicons_round" />
  </edit-config>
</platform>

and it doesn't update anything. I tried to remove the full path and just leave it as file="app/src/main/AndroidManifest.xml" and that's also not working. I am using command line with Android 7.0.0 and I'm absolutely lost.

Both config.xml and AndroidManifest.xml pass XML tests.

If I update AndroidManifest.xml manually with the changes, the app runs fine and all changes are visible, but I believe that's not the proper way of doing it.

I am completely lost..

UPDATE: Could it be related to this? https://issues.apache.org/jira/browse/CB-13514?jql=text%20~%20%22edit-config%22


回答1:


Found the solution! <edit-config apparently cannot be inside the <platform></platform> tags. It has to be outside of it and it will work. Like this:

<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
  <application android:icon="@mipmap/appicons" android:roundIcon="@mipmap/appicons_round" />
</edit-config>

<platform name="android">
  ...
</platform>

Hope this helps someone else save a few hours.



来源:https://stackoverflow.com/questions/53279993/cordova-edit-config-not-updating-androidmanifest-xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!