ionic-team / trapeze

The mobile project configuration toolbox. Manage native iOS, Android, Ionic/Capacitor, React Native, and Flutter apps through a simple YAML format.
https://trapeze.dev
Other
319 stars 39 forks source link

Bug: Incompatible with latest Capacitor V5 Android Platform #188

Closed tobiasmuecksch closed 1 year ago

tobiasmuecksch commented 1 year ago

Description

Since I cannot reopen https://github.com/ionic-team/trapeze/issues/185, I'm creating this new issue.

After running npx @trapezedev/configure run platform-config.yml (Version 7.0.9, I double checked that) Android Studio isn't able to start the app anymore and shows the following error:

Bildschirmfoto 2023-05-09 um 11 11 34

I assume this bug was introduced while fixing https://github.com/ionic-team/trapeze/issues/185.

Reproduction

  1. Clone Repo: https://github.com/tobiasmuecksch/cap5-trapeze-bug
  2. Install dependencies npm i
  3. run ionic cap sync
  4. run npx @trapezedev/configure run platform-config.yml
  5. run ionic cap open android
  6. Start the app in an emulator
  7. See the aforementioned error
tobiasmuecksch commented 1 year ago

I suspect that this particular spot is where things are going wrong:

Bildschirmfoto 2023-05-09 um 11 06 42

But I don't know where this is coming from. I've search-and-replaced all occurrences of "io.ionic.starter" but this issue still persists.

mlynch commented 1 year ago

I wonder if this is because it's setting some additional manifest fields that aren't expected. I'll double check and improve my tests

mlynch commented 1 year ago

Can you try @trapezedev/configure@next? It won't add any more package info to the manifest if there wasn't any there before and will only change the gradle applicationId and namespace

tobiasmuecksch commented 1 year ago

@mlynch I just tested it using npx @trapezedev/configure@next run platform-config.yml, but the error is still there

mlynch commented 1 year ago

Did you make sure the changes from the last run were undone first? I will be able to test it again later once i'm back on better internet

tobiasmuecksch commented 1 year ago

I'm 100% sure. I've rolled back all changes and double checked that by starting the app in the emulator (which is working in the original state). Afterwards I re-ran trapeze using npx @trapezedev/configure@next run platform-config.yml and restarted the emulator - the error was back.

I even checked which version of trapeze I'm using npx @trapezedev/configure@next --version (it shows 7.0.10-next.0)

mlynch commented 1 year ago

I just tested it, ran into the same issue, and fixed it by invalidating caches and restarting android studio. This appears to just be a bug with android studio caching and not an issue with the tool

tobiasmuecksch commented 1 year ago

@mlynch I'm sorry, I had no idea. I will test it on my machine also and close this issue, if that fixes the problem for me too. Will do it tomorrow.

WillPoulson commented 1 year ago

For anyone running into these issues with the @trapezedev/project package, installing 7.0.10-next.0 resolved the issue for me as Max suggested above 😄.

This issue just saved me an hour or two debugging. Thanks guys!

mlynch commented 1 year ago

Sounds like this is working fine then so I'll ship a new latest

tobiasmuecksch commented 1 year ago

@mlynch Yes, I can also confirm it does. Thank you very much! 😃

mlynch commented 1 year ago

7.0.10 is live with this fixed