0

I was trying to recompile an android application that was written around 2014. Most of the stuff is working except LocalSocketAddress issue. Here is sample of code which is not working

private final LocalSocketAddress mSocketPath;    

mSocketPath = new LocalSocketAddress(socketPath, Namespace.FILESYSTEM);
try {
    s.connect(mSocketPath);
    synchronized(this) {
        mSocket = s;
        mInputStream = s.getInputStream();
        mOutputStream = s.getOutputStream();
    }
    return true;
} catch (IOException e) {
    e.printStackTrace();
}

In the Logcat I see the following exception:

12-13 10:48:33.373 13951 14035 W System.err: java.io.IOException: No such file or directory
12-13 10:48:33.373 13951 14035 W System.err:    at android.net.LocalSocketImpl.connectLocal(Native Method)
12-13 10:48:33.373 13951 14035 W System.err:    at android.net.LocalSocketImpl.connect(LocalSocketImpl.java:299)
12-13 10:48:33.373 13951 14035 W System.err:    at android.net.LocalSocket.connect(LocalSocket.java:130)  
12-13 10:48:33.373 13951 14035 W System.err:    at gpsplus.rtkgps.RtklibLocalSocketThread.connectLoop(RtklibLocalSocketThread.java:165)
12-13 10:48:33.373 13951 14035 W System.err:    at gpsplus.rtkgps.RtklibLocalSocketThread.run(RtklibLocalSocketThread.java:246)

Present compiler andriod: 2.2.3. My buid.gradle file I mentioned the minSdkversion is 23 as well as tagetSdkversion is 23. Also set user permission on manifests file.

Can anybody please help me to solve this issue?

Volo
  • 28,673
  • 12
  • 97
  • 125
  • Can you share also the permissions that you use, also on the phone check in the app settings that those permissions are granted, Storage one in particular, since you ported the app I believe that you are not handling them like https://developer.android.com/training/permissions/requesting.html ? – petrumo Dec 12 '16 at 09:45
  • I use following permission in manifest file: "android.permission.ACCESS_NETWORK_STATE" "android.permission.BLUETOOTH" "android.permission.INTERNET" "android.permission.WAKE_LOCK" "android.permission.WRITE_EXTERNAL_STORAGE" "android.permission.USB_PERMISSION" "android.permission.ACCESS_MOCK_LOCATION" "android.permission.ACCESS_WIFI_STATE" "android.permission.ACCESS_COARSE_LOCATION" "android.permission.BLUETOOTH_ADMIN" – user974194 Dec 12 '16 at 10:11
  • than in this case, go to the app settings and grant the app the storage permission, http://www.howtogeek.com/230683/how-to-manage-app-permissions-on-android-6.0/, any changes in the output? – petrumo Dec 12 '16 at 10:29
  • Thanks @petrumo. did that – user974194 Dec 13 '16 at 01:19

1 Answers1

0

For migrating the permission to newer android 6 and higher, you need to handle them in this way: https://developer.android.com/training/permissions/requesting.html and more posts on it Android 6.0 multiple permissions. I can't say though if this is the only problem that is causing the error.

Community
  • 1
  • 1
petrumo
  • 1,116
  • 9
  • 18