gayanvoice / android-vpn-client-ics-openvpn

⭐ Create your Android VPN App by using Android Studio and publish to Google Play Store 🤖
https://gayanvoice.medium.com/develop-a-vpn-app-in-java-using-android-studio-6f1f2d66031e
MIT License
586 stars 318 forks source link

java.lang.NumberFormatException: For input string: "NULL" #28

Closed ElysiumGit closed 4 years ago

ElysiumGit commented 4 years ago

This is a weird error because it happens most of the time, but sometimes there is no issue. The crash occurs when clicking on flag icon in the top right corner, to select the server location. java.lang.NumberFormatException: For input string: "NULL" at ServerActivity.java:452 int ID = Integer.valueOf(ConnectionDetails.getString("id", "1"));

Also when the crash doesn't occur and the server is selected, it doesn't connect to the VPN. After 30 seconds of waiting it goes back to saying server is ready, with the connect button.

Tested on android 9 and android 10

I'm not sure if there's something wrong with my json files. I used a json validator, and the servers i've used are from vpngate, they're pretty quick. appdetails: https://api.myjson.com/bins/eeb8c filedetails.json: https://api.myjson.com/bins/cdfrw

gayanvoice commented 4 years ago

Where is the filedetails JSON? The error crashed up the app because there is no particular file ID in filedetails JSON.

ElysiumGit commented 4 years ago

Where is the filedetails JSON? The error crashed up the app because there is no particular file ID in filedetails JSON.

my bad: this is the filedetails json https://api.myjson.com/bins/fawuc and this is app details https://api.myjson.com/bins/rt0jo

gayanvoice commented 4 years ago

Have you validated the JSON files?

ElysiumGit commented 4 years ago

Have you validated the JSON files?

Yeah i validated them on https://jsonlint.com/ and even if it was invalid wouldn't have been accepted by myjson.com Apparently it should work and Ive tried with both TCP AND UDP network protocols. Got the .ovpn files from https://www.vpngate.net/en/

gayanvoice commented 4 years ago

Can you post the log or even images explaining the error?