GitToTheHub commented on issue #267:
URL: https://github.com/apache/cordova-common/issues/267#issuecomment-5460569761

   I wonder that you write:
   
   > from package.json should be set into AndroidManifest.xml 
android:versionCode="XXXXX" android:versionName="X.X.X"
   
   `android:versionCode` and `android:versionName` are set by `config.xml` not 
`package.json`. They are set by `<widget version="x.x.x>"`, or additonally, 
`android:versionCode` can be set separately by `<widget 
android-versionCode="x.x.x>"`.
   
   In your `edit-config` rule, the `file` attribute can be set directly to 
`AndroidManifest.xml` like:
   
   ```xml
   <edit-config file="AndroidManifest.xml" target="/manifest" mode="merge">
      <manifest xmlns:tools="http://schemas.android.com/tools"; />
   </edit-config>
   ```
   
   I tested the `edit-config` rule and it worked:
   
   config.xml:
   
   ```xml
   <widget id="org.apache.cordova.hellocordova" version="1.2.4" 
xmlns="http://www.w3.org/ns/widgets"; 
xmlns:cdv="http://cordova.apache.org/ns/1.0";>
   
       ...
   
       <platform name="android">
           <edit-config file="AndroidManifest.xml" target="/manifest" 
mode="merge">
               <manifest xmlns:tools="http://schemas.android.com/tools"; />
           </edit-config>
       </platform>
   
       ...
   
   </widget>
   ```
   
   Result in `platforms/android/app/src/main/AndroidManifest.xml`:
   
   ```xml
   <manifest android:hardwareAccelerated="true" android:versionCode="10204" 
android:versionName="1.2.4" 
xmlns:android="http://schemas.android.com/apk/res/android"; 
xmlns:tools="http://schemas.android.com/tools";>
   ```
   
   Maybe there is problem with a plugin or you accidentally thought 
`package.json` updates the versionCode and versionName.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to