Hey, folks. In preparation for Google's upcoming 64 bit requirement I've enabled that in a game that didn't previously have it, and I've encountered some strange behavior. It's evident that for some portion of users, UrlLoader() isn't working when the app tries to access my server scripts. The app is still getting data from Google Play, since it's showing in-app products that it will only show if it received price data from the store. But when attempting to contact my server, nothing gets through. The server access code looks like this:
local loader = UrlLoader.new(url, UrlLoader.POST, {["Content-Type"] = "application/json"}, JSON:encode(data))
Not only is the app not receiving a response, but the server isn't receiving any data. I have a screen where users can enter a tech support code, and one just sends some diagnostic text to a PHP script that emails that text to me. Even that isn't working.
The only change I made was checking "enable 64 bit libs (android)" in the Require plugin, and moving to target Android version 28. In my own tests on multiple devices everything works fine, but I started hearing from some users who couldn't download content, and there was no trace of interaction between those users and my servers. I unchecked the 64 bit libs and rebuilt, targeting Android version 26, and those users are getting content again.
Any ideas? Are there additional headers, or other things that need to change to post JSON data via UrlLoader, either with 64 bit libraries or when targeting newer versions of Android?
This is a really tough one to troubleshoot, since I can't reproduce the error on any device I have, and my system for sending me diagnostic data from users who are having problems doesn't work in this case, since that uses the same network access that's failing in the first place. Supporting the 64 bit libraries is a must, but currently that causes users to be unable to get the content they're paying for.
Paul
Comments
local ip_loader = UrlLoader.new("https://hub.nobrakes.io:2015/servers/all")
It results in an Event.ERROR, but with no information of the error passed to the function. Logcat is also not telling me what's going on.
What kind of phone are you seeing the issue on?
Replace it in your Gideros installation (unzip it inside the Templates folder on Windows). You should probably make a backup of the official one, just in case.
Likes: Apollo14, totebo, SinisterSoft
@hgy29's fix, above, solved the issue for me. With luck, it will now run a while before the next required upgrade comes!
So I'm still unable to publish an update, as some fraction of my users would lose access to content they've paid for due to the network issue.
Any other ideas? Do I need to try building the APK via Android Studio rather than directly from Gideros? Or go buy a Pixel 2 or 3 phone to troubleshoot on a real device?
Paul
Likes: Apollo14
"What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
“The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
I'd hoped Android Studio would be more straightforward than it was the last time I used it, but when it tells me to use a menu option that doesn't exist, well... it's not what I was hoping for.
I thought this might fix it: I clicked Help, Check for Updates, then accepted the license for all items available for updating. That stalled for half an hour, and evidently did nothing. I restarted AS. Now check for updates says I'm up to date, but there's still no SDK Manager under the Tools menu. And Build, Build APKs does nothing at all. And Build, Build Bundles tells me I need to update Gradle, gives me a button to update, and the button does nothing. I thought Xcode was the worst IDE I'd seen in my long career, but... I'll stop myself from further ranting. I'm going to try really hard not to be so cynical, but what seem like the obvious steps just aren't getting anywhere.
I must be missing something really obvious here. I've exported an Android Studio project from Gideros, opened it in Android Studio, and the build options seem to do nothing, and the SDK manager doesn't seem to be present.
Is there some trick to building an APK from an Android Studio project exported from Gideros? Or to launching the SDK manager, so both Android Studio and Gideros can link APKs with the up-to-date libraries?
Portions of support for Android 9 were not installed. Installing now. We'll see if that helps.
Likes: oleg
I am compiling a new template with that error logged, if you are on gideros slack group we can chat about it today. It is 8:00 AM here, and I am back at my office after holidays...
You can get it using the same link a few posts above.
https://developer.android.com/about/versions/pie/android-9.0-changes-28
Likes: hgy29
Likes: MoKaLux, Apollo14, vitalitymobile
08-07 06:53:33.014: E/Gideros(12754): HTTP exception
08-07 06:53:33.014: E/Gideros(12754): java.io.IOException: Cleartext traffic not permitted: http://www.flyfishingsimulator.com
08-07 06:53:33.014: E/Gideros(12754): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:439)
08-07 06:53:33.014: E/Gideros(12754): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:560)
08-07 06:53:33.014: E/Gideros(12754): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:492)
08-07 06:53:33.014: E/Gideros(12754): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:470)
08-07 06:53:33.014: E/Gideros(12754): at com.giderosmobile.android.player.HTTPThread.run(HTTPManager.java:348)
From the Googling I've done so far it seems there might be a manifest change that might solve this. Anyone familiar with that exception?
Or, the other option would seem to be to encrypt all traffic between the app and my servers.
Likes: MoKaLux
One thing I read about someone dealing with a similar issue on another platform was that enabling clear text traffic could conflict with some other libraries. I don't know if it will be an issue here, but I'll know in the next couple of hours if this gets HTTP working on Android 9 in this app.
Google's automated tests are still running, but my servers have heard from a Google Pixel 3 running the new build on Android 9, so early signs suggest HTTP is working with this change.
Likes: MoKaLux
Likes: MoKaLux
https://deluxepixel.com