infacto edited a comment 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.
   But Cordova should detect changes and rebuild the platform automatically. 
   Or is it possible to set different paths for different app-ids? e.g. a CLI 
option. Set path for the platforms folder.
   
   
   
   
   
   
   
   


----------------------------------------------------------------
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:
[email protected]



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

Reply via email to