Signed Release APK (Android) still can't connect to wss:// signalling server ?

1 favourites
  • 4 posts
From the Asset Store
Create your own wss server and ws server with ssl and without ssl.
  • About a year ago, conclusion about wss:// websocket connection in Signed Release APK was that due to a bug in Webview, connecting to wss://multiplayer.scirra.com returns an error.

    Any news about this signed APK bug in Webview ? Will it ever be solved ??

    I have my game published on Google Playstore. It's a turn based card game, early reviews are very positive, but the game needs new features to grow, most important on the roadmap is multiplayer.

    All is working fine, until exporting to Signed Release APK (tried whitelisting, tried not minifying, tried new keystore, tried everything I could find on this topic...)

    * I'm using GooglePlay plugin to connect players with their Google account. That is working fine in all tests (localhost, debug APK, signed APK).

    * Google Play Leaderboard is working fine too (localhost, debug APK, signed APK)

    * Right now I want to work on multiplayer. I'm using the Multiplayer plugin connecting to the Scirra signalling server "wss://multiplayer.scirra.com". Connection for both host and peer is working fine on local host, remote preview and Debug APK, but still NOT in Signed Release APK.

    Is there anything I can do to make it work ?

    Any workaround ? Any news ? Any other method to establish turn based card game in a Signed Release APK ?

    Since bug report bugs.chromium.org/p/chromium/issues/detail is closed and still no news after a year, what can I do to help bring this under attention of the right people ?

    Could I make it work with another signalling server or is Webview simply blocking wss:// connections ?

    Is multiplayer on Google Playstore even possible using C3 ?

    Please help...

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • For anyone that can benefit from it, I found a solution !

    Apparantly the AndroidManifest.xml in your Signed Release APK needs some extra permissions to be able to connect to the websocket server. You would expect these permissions should be there when using the Multiplayer plugin, but they are not.

    Here is what you do:

    1. Download and install APK Editor Studio

    2. Open your signed release APK in APK Editor Studio, it will unpack so you can edit the file system

    3. In file system, open AndroidManifest.xml and add following lines under "<supports-screens android:anyDensity="true"....":

    <uses-permission android:name="android.permission.INTERNET" />

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    4. In menu 'Tools' select 'Key Manager' and add your keystore.jks + password + your alias + password

    5. In meny 'File' select 'Save APK'

    Upload your APK to Google Play and connecting to the Scirra signalling server wss://multiplayer.scirra.com will work !

    Maybe the C3 devs can add these permissions as an option in the export menu or fix that when you are using the Multiplayer Plugin, these permissions are auto put in AndroidManifest.xml ?

  • Every device I ever tried, that permission was not needed and it successfully connected anyway. I've no idea why this is the case. I usually try to avoid adding hacks like this, since the hacks themselves can later on cause problems of their own, and if you take away the hack then you're back to square one. The best approach is to solve the real problem, and I can't understand what that might be.

  • Every device I ever tried, that permission was not needed and it successfully connected anyway. I've no idea why this is the case. I usually try to avoid adding hacks like this, since the hacks themselves can later on cause problems of their own, and if you take away the hack then you're back to square one. The best approach is to solve the real problem, and I can't understand what that might be.

    I have no clue either, but to be honest I was close to dropping my project (and along with it C3) because of this. So I'm glad this 'hack' does the job. I don't really think adding these 2 permissions will cause problems, since they are standard permissions besides many more permissions that can be used in an AndroidManifest.xml

    I understand from your point of view that you want to stay away from it as long as you don't completely understand why this is an issue for some devices (or APK's?), but here it really was the only solution for as far as my knowledge reaches. After all C2/C3 still should be as easy as possible as a 'no programming knowledge requiered' tool.

    If you ever want to analyse this further, feel free to contact me to explore my specific settings, APK's,... I'll be glad to help. Being a fan of your work since 2014 Ashley, keep that in mind ;)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)