skip to Main Content

I am looking my problem solution. I try many method to solve this problem. ( I am using MacOS)

I am trying to run Flutter Demo App on Android Studio before the updating everything working perfectly. But now I have problem with adb server.

When I run the app on my Phone with Device Manager I get below errors:

    Launching lib/main.dart on SM A525F in debug mode...
Running Gradle task 'assembleDebug'...
✓  Built build/app/outputs/flutter-apk/app-debug.apk.
adb server version (40) doesn't match this client (41); killing...
* daemon started successfully
Installing build/app/outputs/flutter-apk/app.apk...
Error: ADB exited with exit code 1
Performing Streamed Install

adb: failed to install /Users/duygu/StudioProjects/android_test/build/app/outputs/flutter-apk/app.apk:
Error launching application on SM A525F.

So What I have try:

I open the adb file location: cd /Users/duygu/Library/Android/sdk/platform-tools

and run this commands:

./adb kill-server
./adb start-server

There is nothing to changed.
And than I add adb path to my.bash_profile file:

export PATH=Users/duygu/Library/Android/sdk/tools:$PATH
export PATH=Users/duygu/Library/Android/sdk/platform-tools:$PATH

export PATH="$PATH:/Users/duygu/development/flutter/bin"

And than it does not work.And than I create bashrc file with nano ~/.bashrc

than I add to this path here

export PATH=/Users/duygu/Library/Android/sdk/tools:$PATH
export PATH=/Users/duygu/Library/Android/sdk/platform-tools:$PATH

And run this command source ~/.bashrc than run which adb command

I get: /Users/duygu/Library/Android/sdk/platform-tools/adb

And again I have same issue. How can I solve this problem please help

This is the flutter doctor -v output:

 flutter doctor -v
[✓] Flutter (Channel stable, 2.10.4, on macOS 12.3.1 21E258 darwin-arm, locale tr-TR)
    • Flutter version 2.10.4 at /Users/duygu/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c860cba910 (4 weeks ago), 2022-03-25 00:23:12 -0500
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    • Android SDK at /Users/duygu/Library/Android/sdk
    • Platform android-32, build-tools 32.1.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)

[✓] VS Code (version 1.64.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.36.0

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 100.0.4896.88
    ! Device RXXXXXXXX is not authorized.
      You might need to check your device for an authorization dialog.

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

2

Answers


  1. what worked for me.

    My Android Studio has an adb file inside /home/myuser/Android/Sdk/platform-tools/ and with the version 1.0.41.

    Note where I put myuser could be your name, whatever, just locate your Android path.

    My error was:
    adb server version (41) doesn’t match this client (39)

    When you type just adb in terminal, this command will be related with the adb archive inside /usr/bin.

    So, I did these steps inside terminal:

    1.adb version
    Android Debug Bridge version 1.0.39

    2.cd /usr/bin

    3.sudo rm adb

    4.cd /home/myuser/Android/Sdk/platform-tools/

    5.Please check if there is an adb file inside your path

    6.Now copy to /usr/bin

    sudo cp adb /usr/bin

    7.adb version again Android Debug Bridge version 1.0.41

    With this done, right now I have the same adb file to both of them, so, if in the future the SDK Manager ask to upgrade platform-tools, remember to do it again if the error back to appear.

    Login or Signup to reply.
  2. I just hit this problem. It was caused by having multiple Android SDKs installed… in my case I have the normal one at ~/Library/Android/sdk and several other versions inside various Unity installations.

    Now, I had Android Studio running which had open a project referencing one of the older Unity-based Android SDK. Every time I killed adb from the command-line, Android Studio would quietly spin up a new instance – using the old Android SDK. So when I tried my next adb command – using the normal SDK – it would find an incompatible version already running: adb server version (40) doesn't match this client (41); killing...

    The solution was just to close Android Studio to stop it instantly spinning up an out of date adb before I could start the right one.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search