You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2021/01/12 08:40:34 UTC

[GitHub] [cordova-android] infacto commented on issue #758: App config.xml does not update AndroidManifest.xml file's versionCode, versionName or anything

infacto commented on issue #758:
URL: https://github.com/apache/cordova-android/issues/758#issuecomment-758499692


   In my case I have a monorepo with one cordova setup and multiple Ionic apps with shared code base. Anyway, as I see, the app id is embedded anywhere in files and path name in platforms folder. I know that this issue is about the version, now. But initially also about the app-id. So just for clarification and self-interest:
   
   I found some files in platforms folder with the app-id: 
   
   **app/src/main/res/xml/config.xml**
   
   ```xml
   <widget id="your.app.id">
   ```
   
   
   **app/src/main/java/your/app/id/MainActivity.java** (app id in path name)
   
   ```java
   package your.app.id
   ```
   
   **android.json**
   
   ```json
   {
     "installed_plugins": {
       "several": {
         "PACKAGE_NAME": "your.app.id"
       }
     }
   }
   ```
   
   You see that the app-id occurs in some files and folder names. I don't know why Google chose this architecture. In my opinion it should be one source for these meta data. But anyway...
   
   It's hard to update all this existing data. You we have to remove the platforms folder when changing meta data like the app id.
   The downside is that the build will take more time to get these files again. I doubt we can find a better solution here, right?
   
   Please correct me if I'm wrong or missed something.
   What files / folder should be removed when the app-id, name, etc. are changed? Only the platforms folder?
   
   Is there a way to detect this via Cordova? Show a warning that the app-id, etc. of config.xml does not match the platforms files. 
   The current behavior is either confusing (not related) error or no error. In some cases you can detect an issue when trying to run the app. (instant crashes). It's annoying. ... 
   
   Spontaneous solution:
   Store the meta data (app id, etc.) in a separate file to detect changes. Remove the related platforms folder before build, when data have been changed. This can be archieved with an own custom build script. (just thinking aloud).
   Or check the android.json (or another file in platforms) to check the app-id. Or just remove the platforms folder before every build. But that can delay development time. ...
   
   Ideas are welcome. ...
   We could add a new CLI option to rebuild the platforms files. In best case just related files / folders.
   
   
   
   
   
   
   
   
   
   
   
   


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org