2024 - 6

1.Flutter App stuck at "Running Gradle task 'assembleDebug'... " on Android

  1. Open your flutter Project directory.
  2. Change directory to android directory in your flutter project directory cd android
  3. clean gradle ./gradlew clean
  4. Build gradle ./gradlew build or you can combine both commands with just ./gradlew clean build
  5. Now run your flutter project. If you use vscode, press F5. First time gradle running assembleDebug will take time.

PS: Delete gradle in case of all that steps don't work

From:https://stackoverflow.com/questions/59516408/flutter-app-stuck-at-running-gradle-task-assembledebug/60691179#60691179?newreg=491db26b77394065865f5ac5f1ce61e3

2024.3.4

2.Flutter App stuck at "Installing build/app/outputs/flutter-apk/app-debug.apk..." on Android

Delete the App on your android and restart your flutter project.

2024.3.4

3.Demostrate a picture with flutter app on macOS

I get the following error:

The following SocketException was thrown resolving an image codec:
Connection failed (OS Error: Operation not permitted, errno = 1), address = my_website.top, port = 80

macOS needs you to request a specific entitlement in order to access the network. To do that open macos/Runner/DebugProfile.entitlements and add the following key-value pair.

<key>com.apple.security.network.client</key>
<true/>

Then do the same thing in macos/Runner/Release.entitlements.

You can read more about this in the Desktop support for Flutter documentation.

From:https://stackoverflow.com/questions/65458903/socketexception-connection-failed-os-error-operation-not-permitted-errno-1

2024.3.26

4.I can't send network request with flutter app on macOS

I was trying to implement a login function but it said Connection Failed.

I use the following command to check and found it wasn't the server's problem.

curl -X POST http://your-server-ip:3000/login -H "Content-Type: application/json" -d '{"username":"admin","password":"password"}'

So I decided to check settings of client. Then I realize that macOS is strict with the network permissions.

Open macos/Runner/DebugProfile.entitlements and macos/Runner/Release.entitlements. Add the following key-value pairs in order to allow the app to connect network.

<key>com.apple.security.network.client</key>
<true/>

2024.6.2