Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Unable to push a zip file to my Android device

未关闭
#1,840 7 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 5 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
停滞
技术栈
android, java
领域
mobile

调研方向

首先跟踪 Java 驱动程序的 pushFile 入口点,直到报告中显示的 POST /session/.../appium/device/push_file 端点。使用较小的 zip 文件和 900 MB 的 zip 文件重现问题,然后检查报告的 raw-body 错误附近是如何处理请求正文的。完成的标准是确定一种受支持的修复方案,或记录文件大小限制及其预期行为。

由索引模型根据 Issue 内容生成。

描述

Description

I am trying to push a zip file of 900 MB size to my Android device.
Command:
driver.pushFile("/sdcard/Android/data/com.example.demoapp/files/file.zip", new File("C:\\Users\\rajdeep.dodiya\\resources\\apk\\file.zip"))

I am getting the below error:

uncaughtException: Invalid string length
RangeError: Invalid string length
    at IncomingMessage.onData (C:\Users\rajdeep.dodiya\AppData\Roaming\npm\node_modules\appium\node_modules\raw-body\index.js:259:25)
    at IncomingMessage.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at IncomingMessage.Readable.push (node:internal/streams/readable:228:10)
    at HTTPParser.parserOnBody (node:_http_common:141:24)
[HTTP] <-- POST /session/12fb49f1-fe10-4ba8-b828-cefc939c5e8c/appium/device/push_file - - ms - -
[HTTP] 
BadRequestError: request aborted
    at IncomingMessage.onAborted (C:\Users\rajdeep.dodiya\AppData\Roaming\npm\node_modules\appium\node_modules\raw-body\index.js:238:10)
    at IncomingMessage.emit (node:events:527:28)
    at IncomingMessage._destroy (node:_http_incoming:179:10)
    at _destroy (node:internal/streams/destroy:102:25)
    at IncomingMessage.destroy (node:internal/streams/destroy:64:5)
    at abortIncoming (node:_http_server:602:9)
    at socketOnClose (node:_http_server:596:3)
    at Socket.emit (node:events:539:35)
    at TCP.<anonymous> (node:net:709:12)
ERROR: Error communicating with the remote browser. It may have died.
Build info: version: '4.7.0', revision: '0a5b49d16f'
System info: os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '18'
Driver info: io.appium.java_client.android.AndroidDriver

Environment

* Java client build version: 8.3.0
* Appium server version:: 2.0.0-beta.52
* Node.js version: v16.15.1
* Mobile platform/version under test: API 33
* Real device or emulator/simulator: Real device

Any help? Is it because my file size is too big? I tried driver.pushFile() for a smaller zip file and it worked.

主要语言
Java
星标
1.3k
派生
755
平均合并
5 天 14 小时
30 天内合并 PR
8

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

appium/java-client 的其他 Issue

查看 appium/java-client 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。