Android compilation fails and logs don't make much sense

daverave1212

  • *
  • Posts: 44
Hello!

I am trying to compile for Android with Stencyl 4.1.0-beta.
Compilation fails and it generates some logs. It generates 3 sets of logs, which is a bit strange, but they all seem the same.

I attached the logs to this post.

What I tried:
- I tried switching to the current live version of Stencyl. Compilation works there, but I can't export to .aab (Google Play no longer accepts .apk files)
- I tried tweaking with Downloading Android Tools and switching up versions of SDK's but they always yield the same result
- I tried reinstalling Stencyl and reimporting the game (export > delete current > import back)
- I tried cleaning up the project from Tools > Game
- I tried deleting the cache of the game

What the logs say:
- I found some errors. Here is what they say:
Code: [Select]
2022-10-12 19:03:46,091 DEBUG [pool-1-thread-1] stencyl.core.lib.io.read.SceneReader: Reading header for Scene: 4 (TownScene) from: scenes\4.xml
2022-10-12 19:03:46,102 ERROR [pool-1-thread-1] stencyl.core.lib.io.read.SceneReader: Actor "GateActor 1" does not refrence an Actor Type: id = 46
2022-10-12 19:03:46,102 ERROR [pool-1-thread-1] stencyl.core.lib.io.read.SceneReader: Could not load actor. Likely an Actor Type that no longer exists.
- The problem here is that GateActor 1 does not exist in the scene. My TownScene as it is called has 0 actors in it. All my actors are generated through code.
- Moreover, I took a look inside scenes\4.xml as it says in the logs and it contains nothing of that sort. Here is the entire content of 4.xml:
Code: [Select]
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<scene depth="14" desc="" eventsnippetid="45" extheight="384" extwidth="1504" extx="-32" exty="-32" format="4.0.1" gravx="-0.0" gravy="0.0" height="320" id="4" name="TownScene" revision="" savecount="0" tiled="1" tileh="32" tilew="32" type="standard" width="1440">
    <layers>
        <color-bg blue="255" green="255" red="255"/>
        <background blendMode="normal" customScrollFactor="false" id="1" locked="true" name="TownSceneTemporaryBG" opacity="100" order="14" rid="36" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="100,168,234" id="14" locked="false" name="Town" opacity="100" order="13" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="100,168,234" id="0" locked="false" name="NPCs" opacity="100" order="12" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,175,175" id="5" locked="false" name="PlayerCharacters" opacity="100" order="11" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="0,255,0" id="2" locked="false" name="UI" opacity="100" order="10" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="0,0,255" id="7" locked="false" name="CharacterUI" opacity="100" order="9" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,0,0" id="8" locked="false" name="CharacterModel" opacity="100" order="8" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,200,0" id="6" locked="false" name="CharacterUIIcons" opacity="100" order="7" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,255,0" id="9" locked="false" name="CharacterUIBars" opacity="100" order="6" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="0,255,0" id="10" locked="false" name="CharacterUIBarsOverlay" opacity="100" order="5" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,0,255" id="12" locked="false" name="CharacterUIStatBackgrounds" opacity="100" order="4" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="64,64,64" id="11" locked="false" name="CharacterUIStatBonus" opacity="100" order="3" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="64,64,64" id="3" locked="false" name="Inventory" opacity="100" order="2" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,0,255" id="4" locked="false" name="ItemPopup" opacity="100" order="1" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
        <layer blendMode="normal" color="255,175,175" id="13" locked="false" name="ItemPopupStatBackgrounds" opacity="100" order="0" scrollFactorX="1.0" scrollFactorY="1.0" visible="true"/>
    </layers>
    <joints/>
    <regions/>
    <terrainRegions/>
    <actors/>
    <snippets/>
    <terrain/>
    <atlases members="" retainAtlases="false"/>
</scene>

Can anyone help? I am at a loss, I don't know what else to try or why it fails to compile on 4.1.0-beta.

Justin

  • *
  • Posts: 4666
Last time you posted about android problems on Discord, you were using b11028, and I recommended that you update to the latest private build.

At he top of your logs, I see this:
Code: [Select]
Stencyl Version: 4.1.0-beta [ci/410-beta3] (b11028)
So it looks like you're still using the same Stencyl build you were using back then.

Near the end of your logs, I see this:

Code: [Select]
Manifest merger failed : android:exported needs to be explicitly specified for <activity>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

This is precisely the problem that was fixed in 4.1.0-beta3/b11106.  See this Stencyl issue for more details: Android target API 32 (12L) : Failed merge Manifest

If you update to the latest private build, and you still see the same exact error, my advice in the linked issue stands:
Quote
It's possible for the same problem to be present in engine extensions you're using, which will also need to be updated for Android 12+ support. Running without any custom engine extensions should allow the game to compile.

If you post links to the engine extensions you're using, I can try to make any necessary updates.


The latest private build should allow you to export both apk and aab, and it should work with Android 12+. If that's not the case, let me know and I'll fix it.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

Justin

  • *
  • Posts: 4666
The things you posted about the deleted actor in the scene is unrelated to your Android issues.

It looks like you later opened that scene and then saved the game. That would have caused the deleted actors to be permanently removed from the scene. So if you opened the xml file afterward, that would explain their absence. You shouldn't see those errors in your logs anymore.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

daverave1212

  • *
  • Posts: 44
Hi, Justin!

Thanks for the response!

I downloaded the latest Stencyl nightly version (b11118).
I still face the same issue. I get the same error messages.

I tried doing it with a blank project and it seems to work, so indeed maybe it's an issue with the extensions.

I use 2 Engine Extensions:
- Image Shaders
- And another one made by me. This one only has a lot of classes (.hx files) with Haxe code. It has a "blocks.xml" file but it's just the default one. I added no other blocks.

How can I fix this? How do I change the manifest thingy, too?

Thank you!

Justin

  • *
  • Posts: 4666
That's odd. I looked through the log you sent with the previous build, and it has AndroidManifest.xml files being copied from the following locations.

Code: [Select]
- Copying template file: <lime haxelib>/dependencies/extension-api/src/main/AndroidManifest.xml -> Export/android/bin/deps/extension-api/src/main/AndroidManifest.xml
- Copying template file: <google-play-games extension>/dependencies/google/AndroidManifest.xml -> Export/android/bin/deps/google/AndroidManifest.xml
- Copying template file: <stencyl install>/plaf/lime-templates/android/template/app/src/main/AndroidManifest.xml -> Export/android/bin/app/src/main/AndroidManifest.xml

This is all standard stuff, not the result of any custom engine extension. Perhaps you could try doing a clean compile again now that you have the latest build?
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

daverave1212

  • *
  • Posts: 44
Hi Justin!

I made it work!
What I did was:
- Disabled the ImageShaders extension
- Regenerated the Android Certificate. I also think there was an issue with the path to my certificate - it had 2 "\" at some point, so maybe that was screwing with compilation

Cheers and thanks for all the help!

daverave1212

  • *
  • Posts: 44
Hey, Justin!

I am back. I managed to make it work for 1 day and now I am experiencing compilation issues again.

Here are the latest logs: https://drive.google.com/file/d/1qcTgpjyDZIoooRe9kLUnwDqB99k0j5xv/view?usp=sharing

Could you tell me anything about it?
I'm at a loss again :(

Thank you!

Justin

  • *
  • Posts: 4666
I responded on discord, so I'll copy the response here.

Quote
All I can say at the moment is that it's a completely different error.
It's the linker linking together the compiled object files, but there's a mismatch somewhere.
Perhaps some of the files were compiled with different settings from each other, and trying to link these mismatched objects is causing the error.
Ideally hxcpp would recompile files whenever needed, but I've found that it can be a little dumb sometimes.
I kinda hate to give the same advice here, but could you try a clean rebuild again?

If the issue persists I'd be happy to look into it more in-depth.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

daverave1212

  • *
  • Posts: 44
Hi, Justin!

So, I managed to export to .apk again, but I still have an issue (or multiple issues).

First off, the ads don't work. I connected my Google Ad Mob to the project. I even tried uploading the game to Google Play and installing it from the phone. I followed the Stencyl Ad Mob guide and I have test ads enabled.
I tried using both banner ads and interstitial ads and they just don't show up.
I made sure to initiate the ads and load the interstitial.

When the game starts, I initialize ad mob, then load the ad.
To test it, I made an actor that displays the ad when clicked.
I also added a normal banner ad with When Created in a scene.

Second off, testing the game via Test does not work.
It tells me to generate logs. Here are some generated logs: https://drive.google.com/file/d/1zWFu66e9rWa4TI5LbvorBwwUWc9hFBC3/view?usp=sharing
Notes:
- I did try this on a clean project and it still doesn't work
- My USB debugging and all that works because testing a game directly from the engine works for the Godot engine

Any idea what could be causing either of these?
Thanks!

Justin

  • *
  • Posts: 4666
Quote
First off, the ads don't work. I connected my Google Ad Mob to the project. I even tried uploading the game to Google Play and installing it from the phone. I followed the Stencyl Ad Mob guide and I have test ads enabled.
I tried using both banner ads and interstitial ads and they just don't show up.
I made sure to initiate the ads and load the interstitial.

When the game starts, I initialize ad mob, then load the ad.
To test it, I made an actor that displays the ad when clicked.
I also added a normal banner ad with When Created in a scene.

Are all three fields in Settings > Mobile > Monetization > AdMob Ads - Android filled out with the id starting with "ca-app-pub-..."?

Did you wait for the "ad area loads" event before using the "show ad" block for the interstitial? It may be helpful to print debug info to the logs or to the screen so you can see exactly when the events have triggered.
Did you use the events to check for admob "fails to load" error, for both the banner and interstitial?

Quote
Second off, testing the game via Test does not work.
It tells me to generate logs. Here are some generated logs: https://drive.google.com/file/d/1zWFu66e9rWa4TI5LbvorBwwUWc9hFBC3/view?usp=sharing
Notes:
- I did try this on a clean project and it still doesn't work
- My USB debugging and all that works because testing a game directly from the engine works for the Godot engine

Running into the same issue as yesterday again. Searching the logs for "Link: libApplicationMain-", there were a number of attempts to compile the game during this Stencyl session.

It looks like it was failing at first. You tested a different game (Android Game 3) and that worked. Then you went back to Tilefinder, cleaned the project, and tried again. Your first attempt after cleaning the project was to publish an APK. This worked. You published an APK again, and again it worked. Then you tried to test, and it failed with the same linker errors. Later attempt to publish an APK still worked, and later attempts to test still failed.

I'd assume that cleaning the project and then testing would make it work. I think that there's some internal configuration mismatch between testing and publishing that's causing this. I'll try to reproduce it and fix it soon.
For Live Support: Join our discord server and ping me @justin.
I'm most often available between 10am and 10pm Japan time. (GMT+9)

daverave1212

  • *
  • Posts: 44
Hi Justin! Thanks for the reply!

About the ads: the ads fail to load. I have used the events and the only event that fires is the fail-to-load. However, I have used google's demo ads and those ones work. So I assume it has to do with my Google AdMob ads/account. I have posted another thread about this in an android development discord. I'll try to have it fixed there.

About the testing: I managed to make it work in the end! Thanks!

For now, I think that's about it.

Thanks a lot, Justin, for all the help! I appreciate it hugely!