alibaba / alibaba/freeline

[问题排查] Freeline "try to connect device/ connect_device_task failed."

Open
#152 44 comments 4 reactions 0 assignees View on GitHub
discussion
Dominant language
Java
Stars
5.4k
Forks
620
PR merge metrics
No merged PRs in 30d

Description

排查方法如下(建议配合使用`python freeline.py -d`):
1. 确定`FreelineCore.init(this);`加入到Application类中,且在`onCreate()`下的第一行,不要根据是否在主进程做特殊处理,否则可能导致`FreelineService`无法正常启动;**[Freeline 0.7.0+开始,默认开启了Application替换,这条可以不用检查]**
2. 确定`FreelineService`以及freeline相关组件是否正常merge到最终的minifest中,最终的manifest路径在`${module}/build/intermediates/manifests`中;
3. 确定`python freeline.py -v`与定义在build.gradle中的freeline的版本是否一致;
4. 确定是否刚刚执行了清空app数据的操作,freeline缓存数据在`/data/data`路径,清空app数据也会导致连接不上的问题(执行freeline命令时,通常会有句明显的日志反复出现:`server result is -1`);
5. 确定是否开启了网络代理导致`127.0.0.1`被重定向?
6. 一定要先使用freeline来打全量包,再来进行增量,否则也会出现这个问题。即,freeline的全量编译与android-studio自带的RUN会存在冲突。

当上述问题都无法解决时,有个终极的解决方案就是**重启试试**...不少人通过重启顺利解决连接不上的问题。。。

后续会通过自动化的方式,尽量避免手工排查上述问题。有遇见相关的问题可以具体描述一下,在issue中进行回复,可以帮忙排查。

Contributor guide

No contributing guide indexed for this repository

Research direction

No source file or test is named. Start by reviewing the six documented connection checks and the `python freeline.py -d` and `-v` commands, then determine the scope of the proposed automation. Done would mean the manual causes of `connect_device_task failed` are addressed or clearly documented with reproducible verification steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java, python
Domain
build-system, documentation, mobile
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.