[Android Q&A, Help & Troubleshooting] Mladen Nochev:
Hello all,

I have problem with adb bakup on my android phone - it is Lenovo Vibe Shot Z90a40, Android version 5.1. I'm trying to backup Viber, but the problem happens for other packages and full backup too. Produced .ab file size is always 41 bytes and contains the following hex values

414e 4452 4f49 4420 4241 434b 5550 0a33
0a31 0a6e 6f6e 650a 78da 6360 1805 a360
148c 5400 0004 0000 01

I've create .bat script where executing logcat to see what happens in device.

@echo off
echo Connecting.
"%~dp0adb" version
"%~dp0adb" kill-server
"%~dp0adb" wait-for-device

"%~dp0adb" shell am force-stop com.viber.voip

echo Enter Backup My Data on Android phone screen.
"%~dp0adb" backup -f "%~dp0viber.ab" com.viber.voip

ping -n 10 127.0.0.1>nul
"%~dp0adb" shell logcat -d > "%~dp0log.txt"
"%~dp0adb" kill-server

echo "press any key to exit."
pause

I see in the log error which tells that there is not enough free space:

I/BackupManagerService( 1136): --- Performing full-dataset adb backup ---

I/BackupManagerService( 1136): Initiating bind of OBB service on com.android.server.backup.BackupManagerService$FullBackupObbConnection@3bc92971

W/ContextImpl( 1136): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1809 com.android.server.backup.BackupManagerService$FullBackupObbConnection.establish:2998 com.android.server.backup.BackupManagerService$PerformAdbBackupTask.run:3620 java.lang.Thread.run:818 <bottom of call stack>

E/Cryptfs ( 304): not running with encryption, aborting

I/BackupManagerService( 1136): OBB service connection com.android.internal.backup.IObbBackupService$Stub$Proxy@22da70c4 connected on com.android.server.backup.BackupManagerService$FullBackupObbConnection@3bc92971

D/BackupManagerService( 1136): Binding to full backup agent : com.viber.voip

W/BackupManagerService( 1136): ensureAvailableSpace

D/BackupStrogeUtils( 1136): freeCacheStorage bytes=230686720

D/BackupStrogeUtils( 1136): freeCacheStorage Start bytes:230686720

D/BackupStrogeUtils( 1136): listFilesRecursive start uid=1000

D/BackupStrogeUtils( 1136): listFilesRecursive file = /cache/recovery/last_log_r file.stat.st_uid=0

D/BackupStrogeUtils( 1136): listFilesRecursive file = /cache/recovery/last_install file.stat.st_uid=0

D/BackupStrogeUtils( 1136): listFilesRecursive file = /cache/recovery/last_locale file.stat.st_uid=0

D/BackupStrogeUtils( 1136): freeCacheStorage Found 0 on cache

D/BackupStrogeUtils( 1136): freeCacheStorage End

D/BackupStrogeUtils( 1136): Not enough free space; 230686720 requested, 220848128 available

D/BackupManagerService( 1136): backupOnePackage ensureAvailableSpace failed : com.viber.voip

D/BackupManagerService( 1136): Full backup processing complete.

D/bu (26755): Finished.

But I have a lot of free space on device. I executed df command:

@echo off
"%~dp0adb" kill-server
"%~dp0adb" shell df > df.txt
"%~dp0adb" kill-server
echo Done!
pause

And here is result:

* daemon not running. starting it now on port 5037 *
* daemon started successfully *
Filesystem Size Used Free Blksize

/dev 1.4G 76.0K 1.4G 4096

/sys/fs/cgroup 1.4G 12.0K 1.4G 4096

/mnt/asec 1.4G 0.0K 1.4G 4096

/mnt/obb 1.4G 0.0K 1.4G 4096

/system 1.9G 1.7G 255.5M 4096

/data 25.4G 12.3G 13.1G 4096

/preload 387.4M 127.5M 259.9M 4096

/cache 248.0M 220.0K 247.7M 4096

/persist 27.5M 184.0K 27.3M 4096

/firmware 64.0M 51.1M 12.9M 16384

/mnt/shell/emulated 25.3G 12.3G 13.1G 4096

/storage/emulated/legacy 25.3G 12.3G 13.1G 4096

/storage/sdcard0 25.3G 12.3G 13.1G 4096

I have almost 13GB free on /data partition. The strange situation is that backup restore function works, I successfully transferred viber package from my old phone to this phone.

Does anyone has an idea what is wrong ?

Any help is appreciated. Thanks in advance

Mladen