question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Sideload failing on Samsung S21 due to "ddms: transfer error: fchown failed"

See original GitHub issue

Describe the bug In order to perform Play Asset Delivery local testing, we run bundletool to sideload APKs on connected device. Running the tool fails due to an ddms: transfer error: fchown failed error.

Bundletool version(s) affected Version: 1.5.0

Stacktrace (Specific app and user names omitted)

> java -jar path\to\bundletool-all.jar install-apks --apks=.\app\build\apks\MyApp.apks  --adb="C:\path\to\Android\sdk\platform-tools\adb.exe"
The APKs have been extracted in the directory: C:\Users\myuser\AppData\Local\Temp\3404055966948919610
The APKs have been extracted in the directory: C:\Users\myuser\AppData\Local\Temp\3404055966948919610
ADB << rm -rf '/sdcard/Android/data/com.mycompany.myapp/files/local_testing'
ADB >> OK
ADB << mkdir -p '/sdcard/Android/data/com.mycompany.myapp/files/local_testing' && rmdir '/sdcard/Android/data/com.mycompany.myapp/files/local_testing' && mkdir -p '/sdcard/Android/data/com.mycompany.myapp/files/local_testing'
ADB >> OK
11:55:12 E/ddms: transfer error: fchown failed: Operation not permitted
11:55:12 E/Device: Error during Sync: fchown failed: Operation not permitted
[BT:1.5.0] Error: Pushing additional splits for local testing failed. Your app might still have been installed correctly, but you won't be able to test dynamic modules.
com.android.tools.build.bundletool.model.exceptions.CommandExecutionException: Pushing additional splits for local testing failed. Your app might still have been installed correctly, but you won't be able to test dynamic modules.
        at com.android.tools.build.bundletool.model.exceptions.InternalExceptionBuilder.build(InternalExceptionBuilder.java:57)
        at com.android.tools.build.bundletool.device.DdmlibDevice.pushApks(DdmlibDevice.java:205)
        at com.android.tools.build.bundletool.commands.InstallApksCommand.lambda$pushSplits$8(InstallApksCommand.java:267)
        at com.android.tools.build.bundletool.device.AdbRunner.run(AdbRunner.java:81)
        at com.android.tools.build.bundletool.device.AdbRunner.run(AdbRunner.java:43)
        at com.android.tools.build.bundletool.commands.InstallApksCommand.pushSplits(InstallApksCommand.java:267)
        at com.android.tools.build.bundletool.commands.InstallApksCommand.execute(InstallApksCommand.java:179)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:89)
        at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:47)
Caused by: com.android.ddmlib.SyncException: fchown failed: Operation not permitted
        at com.android.ddmlib.SyncService.doPushFile(SyncService.java:716)
        at com.android.ddmlib.SyncService.pushFile(SyncService.java:406)
        at com.android.ddmlib.Device.pushFile(Device.java:803)
        at com.android.tools.build.bundletool.device.DdmlibDevice.pushApks(DdmlibDevice.java:189)
        ... 7 more

To Reproduce

  1. Connect a Samsung S21 to development machine.
  2. Have ready a project using Play Asset Delivery with multiple assets packs.
  3. Build AAB from command line:
    CALL .\gradlew.bat :app:bundleDebug
    DEL .\app\build\apks\MyApp.apks
    
  4. Build APK set (line wrapped in this report for clarity):
    java -jar path\to\bundletool-all.jar build-apks 
      --bundle=.\app\build\outputs\bundle\bundleDebug\app-debug.aab 
      --output=.\app\build\apks\MyApp.apks 
      --local-testing
    
  5. Install APK set (line wrapped in this report for clarity):
    java -jar path\to\bundletool-all.jar install-apks 
      --apks=.\app\build\apks\MyApp.apks  
      --adb="C:\path\to\Android\sdk\platform-tools\adb.exe"
    

Expected behavior APK set installation completing without errors. APK files installed on device.

Known workaround None.

Environment: OS: Android 11
Device: Samsung S21 (regular version, non Plus, non Ultra)

Additional context All assets packs folders together, as measured on development machine file system, weight around 3 GB.
No issues happen on other - older or less performant - devices.
BTW we also looked at #196 , without luck

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
ymakhnocommented, Apr 8, 2021

Thank you for the report, I’m investigating the issue.

0reactions
ymakhnocommented, Apr 28, 2021

Fix is available in 1.6.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Samsung S10e] adb sideload Error:21 while installing ...
With a "new" refurbished S10e I followed this instruction: https://wiki.lineageos.org/devices/beyond0lte/install installed adb (V1.0.41 ...
Read more >
TWRP adb sideload error - XDA Forums
I've installed a version 311, but the adb sideload just hangs when you start it. the pc doesn't recognise any adb devices. I...
Read more >
ADB Sideload Not Working, Showing Error Cannot Read File
Are you facing ADB sideload not working problem? If so, here's a guide on how to fix ADB Sideload Not Working, Showing Error...
Read more >
adb shell "operation not permitted" for every command
I did not even have to adb remount . The problem still remains, why am I unable to use the shell? – ealfonso....
Read more >
bundletool - bytemeta
Sideload failing on Samsung S21 due to "ddms: transfer error: fchown failed". chao2zhang. chao2zhang OPEN · Updated 1 year ago ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found