0

I am working on a simple TCP socket application (through flutter on VS) that is acting as a remote control to a Server. The issue is that the app seems to work on certain android devices. I have a Samsung Galaxy phone in which the app runs on, it is able to connect to the server and send commands to the server on occasion, it will not connect to the server. I am unsure at this point what to do as it will function on both the emulator and somewhat on my phone. To clarify i am downloading the build app off the internal testing tab on the android play store.

I believe the issue happens when the shrinking takes place when making the app bundle. (has 99.9% reduction after tree shake). I have tried using multidexEnabled, minifyEnabled and ShrinkResorces. I also tried ending the connection to the socket after sending a command to attempt to send the command. I made sure to add the following permissions:

<uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.NEARBY_WIFI_DEVICES"
                     android:usesPermissionFlags="neverForLocation" />

my gradle file:

defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        multiDexEnabled true
        minSdkVersion 19
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }
 buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            signingConfig signingConfigs.release
        debug{
            minifyEnabled true
        }
        proguardFiles getDefaultProguardFile(
                    'proguard-android-optimize.txt'),
                    'proguard-rules.pro'

       }

}

Donovan
  • 1
  • 1

0 Answers0