user3001826
user3001826

Reputation: 21

Delphi XE5 release version of Android app -- Internet disabled

I can create an app with Delphi XE5 (update 2, hotfix 1 -- but same was true in Update 1) that runs when it is created as a DEBUG version. But when I create it as a RELEASE-APPLICATION STORE version Internet stops working.

It seems to overwrite the android.manifest.xml file and take the INTERNET setting out of it. I have tried various ways of manually updating the file and deploying. But you have to run BUILD again to get the change to get incorporated -- and that overwrites the file again.

The app is simple app using REST. Also has a browser, with URL set in another part. Works fine in DEBUG version. In RELEASE-APPLICATION STORE version on REST call it says SOCKET #13 error, also web page does not work. So definitely no INTERNET.

Any thoughts, order for doing the manual change, or ideas would be greatly appreciated.

FOLLOW-UP --- FOUND THE SOLUTION

Unfortunately user permission settings are not not working completely in my environment. I change the INTERNET setting to TRUE in PROJECT | OPTIONS | USER PERMISSIONS and compile/build and the INTERNET setting gets eliminated (overwritten) from the AndroidManifest.xml file created in the project \release folder. In \debug version it is there (INTERNET setting) and is fine.

Solution for me, at least, is to update the AndroidManifest.template.xml file and add the INTERNET setting there -- so it is copied to both \release and \debug versions of the AndroidManifest.xml files.

So my AndroidManifest.Template.xml file .. in the project root looks like this:

... header and other info

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

... other stuff and footer for file

The template files is used to create the \release and \debug versions of the AndroidManifest.xml files so it forces that setting to be put in that file.

This worked and cleared up the socket 13 error I was getting, and no INTERNET access on the release Android versions. YAY!!!

Upvotes: 1

Views: 1651

Answers (3)

user3001826
user3001826

Reputation: 21

I put mine in after ..uses-permission... and it worked fine.

Upvotes: 0

user2880885
user2880885

Reputation: 93

I had the same problem. And setting project settings have no effect on release version. I think it is some kind of bug, because that effect appears only with INTERNET option. My solution is to set this option manually in androidManifest.template. In that case, it is working fine.

Upvotes: 1

Remy Lebeau
Remy Lebeau

Reputation: 598319

You have to go into the Project Options and enable the INTERNET permission. It is enabled by default for Debug builds, and disabled by default for Release builds.

Upvotes: 2

Related Questions