Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
BrainCrumbz opened this issue Apr 6, 2021 · 5 comments

Comments

@BrainCrumbz
Copy link

BrainCrumbz commented Apr 6, 2021

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

@ymakhno
Copy link

ymakhno commented Apr 8, 2021

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

@janbolat
Copy link

janbolat commented Apr 9, 2021

Same here.
Can't upload on emulator (Android 11).

07:40:32 E/ddms: transfer error: fchown failed: Operation not permitted
07:40:32 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.

@sylwek845
Copy link

Same for me, it fails with my Pixel 5 API 30 but work with API 27 Pixel XL.

@ymakhno
Copy link

ymakhno commented Apr 14, 2021

Just a quick update. We identified the issue and working on the fix.

@ymakhno
Copy link

ymakhno commented Apr 28, 2021

Fix is available in 1.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants