Android Question could not read ok from ADB Server

pjsmith

Member
Licensed User
Longtime User
OK, I've had this working before fine, but not used it in a couple months. Need to do a bit of work today and have changed my phone, but no matter what I do, I cannot connect via the IDE to the phone via USB or the b4a bridge.

The bridge itself is working. Shows as connected on the device (at least the icon changes from broken to connected). The file explorer in the b4a gui works to the device, so it must be working, but try to upload the app, and it fails with this error, which does not make sense as I thought the bridge did not use ADB?

ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Generating R file. (0.10s)
Compiling generated Java code. (1.31s)
Convert byte code - optimized dex. (0.92s)
Packaging files. (0.25s)
Copying libraries resources (0.00s)
Signing package file (private key). (0.51s)
ZipAlign file. (0.05s)
Installing file to device. Error
* daemon not running; starting now at tcp:5037
could not read ok from ADB Server
* failed to start daemon
error: cannot connect to daemon


I've restarted. Am running the latest SDK and Platform tools. I've tried via USB with 'install from unknown devices' enabled on the device and the usb debug option enabled. Same error. The b4a bridge has been allowed to install unknown apps. Restarted everything. Uninstalled and re-installed bridge etc. Can't figure out why this isn't working anymore.

Any ideas at all?

Thanks.
 

DonManfred

Expert
Licensed User
Longtime User
OK, I've had this working before fine, but not used it in a couple months
You are using which B4A Version?
Am running the latest SDK and Platform tools.
Android stopped supporting the old SDK Manager a year ago.

Follow this steps to setup a new SDK.

3. B4A
  • Download B4A Trial Version
  • Open B4A.
  • Choose Tools > Configure Paths.
  • Set the path to "javac.exe" if it is empty (C:\Program Files\Java\jdk1.8.0_102\bin\javac.exe).
  • Click on Open Sdk Manager button.
  • Set the path to "sdkmanager.bat" (C:\Android\tools\bin\sdkmanager.bat) and install all recommended items.
  • Read and accept the licenses when asked for.
  • Return to B4A and set the path to "android.jar" (C:\Android\platforms\android-27\android.jar).
If you are using a B4A Version <7.8 then follow this Tutorial:
https://www.b4x.com/android/forum/t...ewer-versions-of-android-tools.80090/#content
 
Upvote 0

pjsmith

Member
Licensed User
Longtime User
Thank you. Running latest 7.8. Am downloading tools now. Hopefully that will fix. Much appreciated.
 
Upvote 0

pjsmith

Member
Licensed User
Longtime User
Hi - Despite doing this, I still get the same errors. I've also tried downloading the SDK from the button link and updating the tools folder folder (moved the old one out).

b4a seems to connect to the bridge, but the file does not transfer. Anything else to try? This was all fine until I installed the 7.8 update and this is the first time I have used it since the prior versions (not sure which prior build I was on, but it was probably at least 6 months old).

ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Generating R file. (0.10s)
Compiling generated Java code. (1.44s)
Convert byte code - optimized dex. (0.84s)
Packaging files. (0.26s)
Copying libraries resources (0.00s)
Signing package file (private key). (0.43s)
ZipAlign file. (0.05s)
Installing file to device. Error
* daemon not running; starting now at tcp:5037
could not read ok from ADB Server
* failed to start daemon
error: cannot connect to daemon

I currently have this

2018-01-09 20_05_46-B4A Sdk Manager (Small).png


my configure paths I have

C:\Program Files\Java\jdk1.8.0_91\bin\javac.exe

and
C:\android\platforms\android-27\android.jar

My development kit may be old?

[have updated jdk to 151 and updated path. Compiles OK, but still same failed to start daemon error.]
 
Last edited:
Upvote 0

pjsmith

Member
Licensed User
Longtime User
I tried via USB again. I get a different error now.

B4A Version: 7.80
Parsing code. (0.02s)
Compiling code. Error
Access to the path 'C:\Users\Paulhome\Google Drive\Development\Android\Intervalveometer\Objects\src\com\PJSMobile\Intervalveometer\main.java' is denied.

And even I as admin of the machine cannot delete it/change the permissions :( Something screwy going on.
 
Upvote 0

pjsmith

Member
Licensed User
Longtime User
Hi,

Have just started afresh today and tried that. As it happens, that file was gone on a restart, but I still get the same 'failed to start' daemon error from b4a., even though the bridge is connected

B4A Version: 7.80
Parsing code. (0.01s)
Compiling code. (0.04s)
Compiling layouts code. (0.00s)
Organizing libraries. (0.00s)
Generating R file. (0.09s)
Compiling debugger engine code. (1.33s)
Compiling generated Java code. (1.20s)
Convert byte code - optimized dex. (0.76s)
Packaging files. (0.22s)
Copying libraries resources (0.00s)
Signing package file (private key). (0.44s)
ZipAlign file. (0.05s)
Installing file to device. Error
* daemon not running; starting now at tcp:5037
could not read ok from ADB Server
* failed to start daemon
error: cannot connect to daemon


I'm stumped as nothing has changed that I can think off bar my upgrading to 7.8.
 
Upvote 0

pjsmith

Member
Licensed User
Longtime User
I thought the bridge didn't use ADB?

This is what I have in paths

2018-01-10 11_39_51-Paths Configuration (Small).png


And this is in that folder

c:\users\paulhome>cd C:\android\platforms\android-27\

C:\android\platforms\android-27>dir
Volume in drive C has no label.
Volume Serial Number is EEFA-B888

Directory of C:\android\platforms\android-27

09/01/2018 19:24 <DIR> .
09/01/2018 19:24 <DIR> ..
04/01/2018 16:59 3,328,790 android-stubs-src.jar
04/01/2018 16:59 29,514,833 android.jar
04/01/2018 16:59 1,938 build.prop
04/01/2018 17:00 <DIR> data
04/01/2018 17:00 10,305 framework.aidl
04/01/2018 16:59 <DIR> optional
09/01/2018 19:24 17,347 package.xml
04/01/2018 16:59 209 sdk.properties
04/01/2018 16:59 <DIR> skins
04/01/2018 17:00 16,948 source.properties

When I downloaded the newer SDK, I moved the old 'tools' folder out of 'android' folder and put the new SDK in there

C:\android\platforms\android-27>dir c:\android
Volume in drive C has no label.
Volume Serial Number is EEFA-B888

Directory of c:\android

09/01/2018 20:02 <DIR> .
09/01/2018 20:02 <DIR> ..
10/01/2018 11:41 16 .knownPackages
22/06/2016 11:22 <DIR> add-ons
14/10/2015 01:51 220,209 AVD Manager.exe
09/01/2018 19:48 <DIR> build-tools
09/01/2018 19:55 <DIR> emulator
09/01/2018 19:24 <DIR> extras
09/01/2018 19:46 <DIR> licenses
09/01/2018 19:46 <DIR> patcher
09/01/2018 19:24 <DIR> platform-tools
04/01/2018 17:01 <DIR> platforms
14/10/2015 01:51 220,721 SDK Manager.exe
14/10/2015 01:51 1,170 SDK Readme.txt
04/01/2018 17:19 <DIR> sources
22/06/2016 11:57 <DIR> system-images
09/01/2018 18:37 <DIR> temp
09/01/2018 19:46 <DIR> tools
22/06/2016 11:23 71,075 uninstall.exe
5 File(s) 513,191 bytes
14 Dir(s) 33,336,619,008 bytes free


C:\android\tools>dir
Volume in drive C has no label.
Volume Serial Number is EEFA-B888

Directory of C:\android\tools

09/01/2018 19:46 <DIR> .
09/01/2018 19:46 <DIR> ..
09/01/2018 19:43 5,666 android.bat
09/01/2018 19:43 <DIR> bin
09/01/2018 19:43 626,176 emulator-check.exe
09/01/2018 19:43 871,936 emulator.exe
09/01/2018 19:46 <DIR> lib
09/01/2018 19:43 232,224 mksdcard.exe
09/01/2018 19:43 947 monitor.bat
09/01/2018 19:43 640,605 NOTICE.txt
09/01/2018 19:46 919 package.xml
09/01/2018 19:43 <DIR> proguard
09/01/2018 19:43 139 source.properties
09/01/2018 19:44 <DIR> support
8 File(s) 2,378,612 bytes
6 Dir(s) 33,336,078,336 bytes free


I think that's everything in place?
 
Upvote 0

pjsmith

Member
Licensed User
Longtime User
Finally managed to resolve this. Uninstall Android development kit from add/remove programs. Re-install using SDK manager in b4a... Hope this helps anyone else upgrading.
 
Upvote 0

Dave O

Well-Known Member
Licensed User
Longtime User
I had the same adb-version problem, but installing the latest Android platform (android-28) in B4A's SDK Manager, and then using Configure Paths to point to that latest android.jar solved it for me.
 
Upvote 0
Top