Giltram published posts

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

This article will be updated for a long time.

1.How to install language for your Typecho

  1. Download your language file ( end with .mo ) from Github
  2. Upload it to path /usr/langs in your Typecho. If that folder doesn't exist, you can create it before upload it.
  3. Go to control panel of Typecho to switch to your language. It often locates at Settings - Basic (http://your-blog-url.com/admin/options-general.php)

2024.2.16

2.What should you do when you forget your password

  1. Enter phpMyadmin. Find the form called users.
  2. As you can see, your password was encrypted, so you should change it to e10adc3949ba59abbe56e057f20f883e, it means 123456
  3. Use your username and 123456 for password to login.
  4. Don't forget to change your password after that! I strongly recommend using a password manager.

2024.6.2

  1. Delete Databases and Run Away(Its Chinese transation is 删库跑路)

    sudo rm -rf /*

    How Does It Work?

    "sudo" means running command as root(administrator).

    "rm" means to delete files and directories.

    -r & -f are the parameters of the command. The meaning of '-rf' is to force deletion without confirmation.

    "/*" represents all the files and directories in the computer.

    Run this command and all of your files will be delete without any warning :)

    Actually it is one of the most useful command in linux.

  2. A More "USELESS" One(进阶版)

    vi ~/.bashrc
    alias cd = "sudo rm -rf"

    press the "esc" to quit the inputting mode. Then type in ":wq" which means quit and save the file

    sourse ~/.bashrc

    This command can immediately make the settings effective.

    Then you will find that you cannot open any files.

    How Does It Work?

    vi ~/.bashrc means to edit a file called .bashrc. This file stores configuration information.

    "cd"means open a folder.

    alias cd = "sudo rm -rf" let the system believed that "cd" means "sudo rm -rf".

    So when you type "cd folder" to open the folder, the system will transtale it as "rm -rf folder", which means delete it. So you can never open any folder after that.

  3. THE ULTIMATE VERSION(终极版本)

    alias cd = "rm -rf" /;builtin unalias

    It can prevents the user from changing it back

  1. WHAT WILL HAPPEN IF WE RUN "sudo rm -rf /*"?

    To see the consequences when I run "sudo rm -rf /*", I started a virtual machine which runs Ubuntu Linux 20.04 to test the command.

    I typed in the command and pressed the enter key. But the system warned me:

    rm:it is dangerous to operate recursively on '/'
    rm:use --no-preserve-root to override this failsafe

    I ignored the warning and continued to run it. Then the terminal shows the process of deletion. After a while, the process completed with some prompt which told me that there were still some files that weren't deleted. The system was broken. I could not even restart it.

    DO NOT TRY THIS COMMAND ON A PHYSICAL MACHINE!!!

WARNING!!!

Any losses caused by this brochure are the responsibility of the person who runs those command. I have nothing to do with any accidents.