TheGameCreators / AGK-Studio

3 stars 1 forks source link

App Icon Defect - iOS IPA Export #940

Open bluesentinelsec opened 2 years ago

bluesentinelsec commented 2 years ago

Hi there Game Creators. I have the following issue:

Whenever I export an iOS IPA file, AGK seems to ignore the App Icon image, and it instead uses the default iOS App Game Kit icon.

This is problematic because Apple will not approve iOS apps that share the same icon as the AGK mobile and player apps.

Here are the steps to reproduce with supporting screenshots below:

System: MacOS Monterey 12.1 (tested on intel and M1 chips) AGK Studio: V2021.12.06

  1. Make a 1024x1024 PNG image with no transparency. I did this in Aseprite and Procreate. Save as foo.png.
  2. Open an AGK project.
  3. Select File > Export Project to iOS
  4. Set the App Icon field to foo.png.
  5. Fill in the other settings and export (don't forget the App Store provisioning profile).
  6. Create a sample app in Apple Connect.
  7. Add the IPA file to the Transporter app and submit to Apple Connect.
  8. Observe how foo.png was ignored and the default AGK icon is used instead.

I even tried unzipping the IPA file, modifying the icon files, and then re-signing and re-zipping everything. Somehow the app continues to default to the AGK icon.

Can you offer any known work arounds or fixes? Does AGK expect the icon image to be formatted a particular way, beyond 1024x1024 and no transparency?

image image
orvillian commented 2 years ago

@bluesentinelsec The icons I'm currently using are 1024 x 1024, colour space RGB, alpha channel none and saved as PNG. If you can upload one of your icons I can compare it to what I have.

bluesentinelsec commented 2 years ago

@orvillian Thanks for the response.

Here is an icon file that is causing me trouble: image

And here is some supplemental info about the image:

image
orvillian commented 2 years ago

@bluesentinelsec The image you uploaded has an alpha channel. Remove this and your icon will be fine. Here's your icon properties on the left compared to one that works on the right -

Screenshot 2022-02-02 at 13 07 04

bluesentinelsec commented 2 years ago

@orvillian Thanks for the help so far.

I can confirm that I'm using a 1024x1024 image without an alpha channel.

But it seems AGK is still selecting the default icon file.

Here is the icon.png meta data:

image

Can also confirm with the sips tool:

sips -g hasAlpha icon.png  

  hasAlpha: no

Here is the modified icon.png file; I can confirm 100% I'm using that file in AGK's iOS IPA export settings. image

Also note that inside the .IPA file, the default icon images are present:

image

May I ask someone to upload a known good icon file? It might help rule out if the problem is user error / my system / or AGK.

orvillian commented 2 years ago

@bluesentinelsec Please try this icon. I can confirm it works for me -

ios_icon

bluesentinelsec commented 2 years ago

Thanks for the sample icon file @orvillian .

Unfortunately I'm still having the problem.

Notice how the .app file doesn't have an icon.

image

Notice the AGK default icon files.

image

Here's the meta data from Orvillian's icon file:

sips -g all icon.png
/private/tmp/icon.png

  pixelWidth: 1024
  pixelHeight: 1024
  typeIdentifier: public.png
  format: png
  formatOptions: default
  dpiWidth: 300.000
  dpiHeight: 300.000
  samplesPerPixel: 3
  bitsPerSample: 8
  hasAlpha: no
  space: RGB

Here are my IPA export settings:

image

I can confirm AGK has read permissions to the icon file and provisioning certificate.

Otherwise, I've reached the limit of troubleshooting for now.

I'll try this on a different computer, and also try to see if I can just replace the AppIcon60x60@2x.png files manually, and re-sign / re-zip into an IPA.

orvillian commented 2 years ago

@bluesentinelsec Just as a quick test please try placing the app icon, provisioning profile and output file location to the Documents folder. Does it make any difference?

bluesentinelsec commented 2 years ago

@orvillian So I built the IPA with the icon/provisioning profile and output in ~/Documents. Sadly it did not work! It was a good test though, I was really hopeful it would work.🤣

orvillian commented 2 years ago

@bluesentinelsec I took your icon without the alpha channel and was able to export an app and see your icon being used.

What is the install location for AGK as I'm wondering if this is somehow impacting the situation.

Which version of Xcode do you have installed?

bluesentinelsec commented 2 years ago

@orvillian I am running AGK Studio from Steam. The install location is:

/Users/<username>/Library/Application Support/Steam/steamapps/common/AppGameKit Studio

Also, I'm running Xcode Version 13.2.1 (13C100).

So far I've had the issue on both an M1 Mac and an Intel Mac, which makes me think the Steam install is a possible culprit.

orvillian commented 2 years ago

@bluesentinelsec Which version of Xcode do you have installed? Have you updated it recently?

bluesentinelsec commented 2 years ago

I'm running Xcode Version 13.2.1 (13C100).

I don't believe I updated it at all while having this issue.

sartsuk commented 2 years ago

I'm having the exact same issue, and this is not the first time I've exported to IPA with AGK. I've done so successfully in the past with absolutely no issues.

I even used one of the old (and accepted) icons I've used in the past to no avail.

Based on all this, it seems AGKS and AGK2 are simply not taking the custom 1024 x 1024 icon, even though the icon is in the correct format.

My version of XCODE is 13.2.1.

VirtualNomad19 commented 2 years ago

I've done so successfully in the past

@shadowartsuk , do you recall which version you were using (-ish)?

i've no experience here but is rolling back to a previous version of studio an option to get past this hurdle for now where it seems other options may be exhausted? perhaps comparing a version that does use a custom icon to the current version will help find the underlying issue.

orvillian commented 2 years ago

I have uploaded several recent builds on iOS (using Tier 1) and the icon has displayed correctly. Currently on Xcode version 13.0 and Mac OS 11.4. More tests are needed to determine what could cause this problem.

sartsuk commented 2 years ago

Hi,

I have already used various versions of AGK2 and AGKS to no avail. I did that even before reporting the issue. It simply didn't fix it at all.

The Juggling acts is proof that the issue is not with my local configuration, but a problem with AGK2 and AGKS.

The underlying issue is that AGK2 and AGKS are broken. It is simply not picking up the icon. And I bought directly from the website, and not from steam.

I'm on XCODE 13.2.1 and Mac OS Monterey latest version.

sartsuk commented 2 years ago

And by past I'm referring to about 3 years ago. I've been off development for a while.

In the past ? I never has such issues with AGK 2 and AGK S.

sartsuk commented 2 years ago

Good Afternoon,

Any signs of life for this issue ?

Thanks

orvillian commented 2 years ago

@shadowartsuk I will be looking into why it's breaking for some people as part of the next update.

bluesentinelsec commented 2 years ago

I tried rolling back to an earlier version of AGK Studio on Steam per @VirtualNomad19 reccomendation. Sadly the roll back did not solve the icon issue.

Here's the version info if you want to try to reproduce it:

  1. AGK Studio - 2019.08.05
  2. Xcode 13.2.1
  3. MacOS Monterey 12.1
  4. MacBook Pro 16 Inch 2021 / Apple M1 Max

I'm suspicious Xcode is the culprit, otherwise I would have expected the AGK roll back to work.

Is there a way to export Tier1 as an Xcode project file? That would probably give me a way forward, and would also negate the need for me to manually create provisioning profiles.

orvillian commented 2 years ago

@bluesentinelsec Can you see whether reverting back to Xcode 13 solves the problem? You can download older versions from here - https://developer.apple.com/xcode/resources/

You can modify the interpreter Xcode project included with Tier 2, add in your media, Tier 1 bytecode etc. add icons and upload everything via Xcode. It will require more effort to begin with but once set up it's quite easy to upload new versions.

sartsuk commented 2 years ago

I think I'm going to try the roll back tonight too. Will update.

sartsuk commented 2 years ago

AGK Studio V2021.12.06 + XCODE 13.0 (13A233) = Same Problem/Issue not resolved.

orvillian commented 2 years ago

@shadowartsuk Thanks for testing it. At least we can rule out a change in Xcode.

sartsuk commented 2 years ago

Is there an ETA for the resolution of this issue ?

I'm asking because it is causing a lot of problems for me as I cannot update my existing app. I'm not a steam user either, so I do not have the privilege of going back to whatever version last worked.

Thanks

orvillian commented 2 years ago

@shadowartsuk This will be checked as part of the next release that is due in March.

sartsuk commented 2 years ago

Checked ?

orvillian commented 2 years ago

@shadowartsuk I cannot replicate it or find a reason why it's happening at the moment. I will look into it as part of the scheduled work and see what can be done about it.

In the meantime the only option for you is to modify the Tier 2 interpreter project, copy in your bytecode and media and add your project icon into Xcode. This will allow you to submit the app without any issues.

sartsuk commented 2 years ago

Thanks for the suggestion @orvillian

What about the code for the actual project itself ?

orvillian commented 2 years ago

@shadowartsuk You generate the code as normal using the IDE by compiling it, then you copy the media folder into the media folder for the Tier 2 project, run that within Xcode and it will launch your app as it detects bytecode.byc. So everything is still done inside the regular IDE until you want to upload it to App Store Connect.

sartsuk commented 2 years ago

Wow! ok I will try this today and report on the outcome of this work around.

So I first of all create a blank T2 Project where everything is copied into ?

Thanks

orvillian commented 2 years ago

@shadowartsuk Look inside the Tier 2 folder for AGK, then inside apps and then intepreter_ios. For now copy this folder and paste it alongside interpreter_ios, then rename it to something suitable. Do not move it or the other files away from this location otherwise you will run into compile problems. Next open the project in Xcode and attach a device to your Mac. At the top of Xcode you will see the interpreter_ios project name followed by an arrow pointing to the right. Tap on this and a list will be shown e.g. Any iOS device, simulators etc. Select your device and now try and run the project. If that works the next stage is to copy your bytecode and media into the media folder, then try running it again. Next fill in relevant details for the app in the project settings, add your icon etc and you can archive and upload to App Store Connect.

sartsuk commented 2 years ago

Thanks a lot for this. I will try this with the latest version of XCODE.

sartsuk commented 2 years ago

@orvillian

"Select your device and now try and run the project. If that works....."

Nope it didn't.

sartsuk commented 2 years ago

Just to let you know, I received an email from Apple yesterday warning me that my app is 3 years old, and hasn't received any updates.

They have made it clear that my app will be removed from the iOS app store within 30 days if I fail to update it.

Thanks

orvillian commented 2 years ago

@shadowartsuk Go to the Product menu and select Build. Do you get a message saying it succeeded or failed? Look for an exclamation mark to the right of the build information. Is this red or yellow? If it's red click on it and scroll through the list to discover what the error message is.

orvillian commented 2 years ago

@shadowartsuk As a quick alternative for now if you want to send me your Tier 1 project, provisioning profile and private key I can build everything here and send you the IPA.

sartsuk commented 2 years ago

@shadowartsuk Go to the Product menu and select Build. Do you get a message saying it succeeded or failed? Look for an exclamation mark to the right of the build information. Is this red or yellow? If it's red click on it and scroll through the list to discover what the error message is.

Hi, the build failed even after changing the bundle ID and Team in the build settings.

It simply won't build. And I will post the error message tomorrow.

Thanks

sartsuk commented 2 years ago

Good day,

Build finally succeeded this morning and it is running on my iPad. I used AGK instead of AGK Studio

Thanks

orvillian commented 2 years ago

@shadowartsuk Thanks for letting us know how you are getting on. Good news you have it running on your iPad.

sartsuk commented 2 years ago

@orvillian No problem. I've fixed all red exclamation marks as these were mostly to do with provisioning profiles and certificates.

I will follow through with the steps mentioned previously and see what happens.

Any issues will be reported.

Thanks

sartsuk commented 2 years ago

Hi,

Copying over the Media folder + Bytecode does not make a difference to anything.

While I have gotten rid of all the red exclamation marks, what is broadcast to my iPad IS NOT the app I created.

It's just a grey screen with the framerate on it.

orvillian commented 2 years ago

@shadowartsuk Look in the resources section of the project and look for the bytecode, right click on it and select show in finder. Just check that this is the file you copied over and isn't a duplicate that should not be there.

sartsuk commented 2 years ago

I'm sorry but what you have instructed does not correspond with anything that is here.

I already have the bytecode from the T1 project. I copied it AS YOU INSTRUCTED earlier.

But the XCODE project DOES NOT have a RES folder for me to overwrite the byc.

orvillian commented 2 years ago

@shadowartsuk In the project listings look for the Resources folder. If you don't see a media folder in here then drag yours across to it. Add it as a folder reference assuming you have copied your media folder into the project folder.

Screenshot 2022-02-25 at 09 29 53

If your project looks different to this please show a screenshot.

sartsuk commented 2 years ago

@orvillian I've just replaced the BYC in the RES folder (I opened it from XCODE and manually copied the BYC from the Application folder to the RES folder to replace it). I know I did this because Finder asked if I wanted the BYC replaced, and I said yes.

I restarted XCODE and built it successfully, but it still shows the grey screen.

So in other words, the BYC is replaced, but for some reason it still chooses to show the Grey screen.

I've also checked, and all the folders have been copied over verbatim.

sartsuk commented 2 years ago

I will now run a test with a fresh install. I will delete the app from the ipad and run it with new BYC.

sartsuk commented 2 years ago

No Joy.

orvillian commented 2 years ago

@shadowartsuk The best way to solve this is for you to upload your Xcode project and share it with me. If you want to do this send me a link on email - orvillian@googlemail.com.

bluesentinelsec commented 2 years ago

I had to fight with the ios_interpreter projects quite a bit to be able to build my Tier1 app in Xcode. First, I can't build the ios_interpreter because of this error: Provisioning profile "iOS Team Provisioning Profile: com.my.bundleid" doesn't include the com.apple.developer.networking.multicast entitlement.

I had success building ios_interpreter_lite. Here's the general process:

  1. Enable Automatically manage signing under the Signing and Capabilities window.
  2. Update your team and bundle identifier for both release and debug; I believe this requires a paid Apple developer account.
  3. Try to build the project on a physical device; I had linker errors regarding the PromisesObjC.framework. I fixed this by right clicking Frameworks > Add files to agkinterpreter... > platform/apple/Source/Social Plugins/PromisesObjC.framework.
  4. Hopefully your interpreter builds and runs at this point... if so, create a directory called "media" in finder under the ios_interpreter_lite folder. Copy everything in your Tier1 media folder into ios_interpreter_lite/media.
  5. In Xcode, right-click Resources > Add files to agkinterpreter... > select your media folder. I did not select 'copy items if needed' but try clicking it if your build doesn't work.
  6. My build was working at this point (and there was much rejoicing!).

In light of this exercise, I have a request for the AGK team:

Please publish an official guide on building Tier1 projects in Xcode.

Building Tier1 projects in Xcode is the only recourse we have if there are defects, such as missing icons or if Apple has objections that require us to modify the Xcode project settings or the source files.

Finally, for the sake of brevity, I'll suggest that additional conversations about building the iOS_interpreter be moved to a side channel or a separate git issue.