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

路径中有中文字符导致freeline报错 #46

Closed
reaper12 opened this issue Aug 30, 2016 · 12 comments
Closed

路径中有中文字符导致freeline报错 #46

reaper12 opened this issue Aug 30, 2016 · 12 comments

Comments

@reaper12
Copy link

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 1: ordinal not in range(128)
报这个错是什么原因

@lomanyong
Copy link
Member

@reaper12 有更完整的日志吗?可以都贴出来看下?

@reaper12
Copy link
Author

ce45dbfe-ce60-46ea-8b9d-08aaaf5bed06

@lomanyong
Copy link
Member

@reaper12 编码的问题,想问下你们的工程路径是否有特殊字符呢?

@jinzw1993
Copy link

如果我想用python3 运行怎么办。

@lomanyong
Copy link
Member

@jinzw1993 暂时不支持python 3,暂时只能使用python 2,不过python 3在我们的后续支持计划中

@reaper12
Copy link
Author

路径包含中文,会有问题吗?

@lomanyong
Copy link
Member

@reaper12 可能是路径包含中文的原因导致的这个编码错误,可以尝试改一下路径再试试看嘛?

@lomanyong lomanyong changed the title 执行python freeline.py 保错 路径中有中文字符导致freeline报错 Sep 1, 2016
@lomanyong
Copy link
Member

@reaper12 0.5.6版本将会解决中文路径的问题。

@qsyj
Copy link

qsyj commented Sep 7, 2016

@laijiandong 0.6版本还在报这个错 我apk路径中含有中文 就不行

@lomanyong
Copy link
Member

@qsyj 可以贴下报错的具体日志吗?

@qsyj
Copy link

qsyj commented Sep 7, 2016

@laijiandong
D:\android\project_studio\chcts\Src-Android-User\mobilebank>freeline.py
[DEBUG] [dispatcher] command line args: Namespace(all=False, clean=False, cleanBuild=False, debug=False, init=False, version=False)
[DEBUG] [scan_changed_files_command] find D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build.gradle has modification.
[DEBUG] find wheel has 0 java files modified.
[DEBUG] find httplibrary has 0 java files modified.
[DEBUG] find wwcore has 0 java files modified.
[DEBUG] find ShareLibrary has 0 java files modified.
[DEBUG] find app has 0 java files modified.
[DEBUG] find app has build.gradle or manifest file modified.
[DEBUG] find wwrefreshlibray has 0 java files modified.
[DEBUG] find wwalertdialog has 0 java files modified.
[DEBUG] project need a clean build.
[DEBUG] collecting project info, please wait a while...
[DEBUG] update apk time path: D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\freeline-assets\apktime
[DEBUG] new clean build flag value: 222000
[DEBUG] [task_engine] depth: 1, task: [read_project_info_task]
[DEBUG] [task_engine] depth: 1, task: [generate_file_stat_task]
[DEBUG] [task_engine] depth: 2, task: [gradle_clean_build_task]
[DEBUG] [task_engine] depth: 3, task: [clean_all_cache_task]
[DEBUG] [task_engine] depth: 3, task: [install_apk_task]
[DEBUG] [task_engine] depth: 4, task: [build_base_resource_task]
[DEBUG] [task_engine] depth: 4, task: [generate_project_info_task]
[DEBUG] [read_project_info_task] read_project_info_task start to run after waiting 0.0s
[DEBUG] [generate_file_stat_task] generate_file_stat_task start to run after waiting 0.0s
[DEBUG] [generate_file_stat_task] generate_file_stat_task finish in 0.1s
[DEBUG] [read_project_info_task] read_project_info_task finish in 4.0s
[DEBUG] [gradle_clean_build_task] gradle_clean_build_task start to run after waiting 4.0s
[DEBUG] [gradle_clean_build_task] gradlew.bat assembleFlavors_userDebug --stacktrace -P freelineBuild=true
[DEBUG] [gradle_clean_build_task] Gradle build task is running, please wait a minute...
[DEBUG] [gradle_clean_build_task] gradle_clean_build_task finish in 81.4s
[DEBUG] [clean_all_cache_task] clean_all_cache_task start to run after waiting 85.4s
[DEBUG] [install_apk_task] install_apk_task start to run after waiting 85.4s
[DEBUG] [install_apk_task] check device' connection...
[DEBUG] [clean_all_cache_task] ignore remove: D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\jar_dependencies.json
[DEBUG] [clean_all_cache_task] ignore remove: D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\public_keeper.xml
[DEBUG] [clean_all_cache_task] ignore remove: D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\stat_cache.json
[DEBUG] [clean_all_cache_task] ignore remove: D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\app\resources_dependencies.json
[DEBUG] [clean_all_cache_task] ignore remove: D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\freeline-assets\apktime
[DEBUG] [clean_all_cache_task] ignore remove: D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\ShareLibrary\resources_dependencies.json
[DEBUG] [clean_all_cache_task] ignore remove: D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\wheel\resources_dependencies.json
[DEBUG] [clean_all_cache_task] ignore remove: D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\wwalertdialog\resources_dependencies.json
[DEBUG] [clean_all_cache_task] ignore remove: D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\wwcore\resources_dependencies.json
[DEBUG] [clean_all_cache_task] ignore remove: D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\wwrefreshlibray\resources_dependencies.json
[DEBUG] [clean_all_cache_task] clean_all_cache_task finish in 0.0s
[DEBUG] [generate_project_info_task] generate_project_info_task start to run after waiting 85.3s
[DEBUG] [build_base_resource_task] build_base_resource_task start to run after waiting 85.4s
[DEBUG] collecting project info, please wait a while...
[DEBUG] collecting project info, please wait a while...
[DEBUG] [build_base_resource_task] D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\public_keeper.xml exists, move to dst: D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\app\backup\res\values\freeline_id_keeper_public.xml
[DEBUG] [generate_project_info_task] generate_project_info_task finish in 0.0s
[DEBUG] [build_base_resource_task] generating ids.xml from public.xml...
[DEBUG] [build_base_resource_task] aapt exec: freeline\release-tools\FreelineAapt.exe package -f -I D:\android\sdk456\platforms\android-23\android.jar -M D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\intermediates\manifests\full\flavors_user\debug\AndroidManifest.xml -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\src\main\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\ShareLibrary\src\main\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\httplibrary\src\main\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\wheel\src\main\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\wwrefreshlibray\src\main\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\wwcore\src\main\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\wwalertdialog\src\main\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\intermediates\exploded-aar\com.antfortune.freeline\runtime\0.6.0\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\intermediates\exploded-aar\com.android.support\support-v4\23.1.1\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-basement\8.1.0\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-appindexing\8.1.0\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\intermediates\exploded-aar\com.tencent.bugly\crashreport\2.2.2\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.1\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\intermediates\exploded-aar\com.pnikosis\materialish-progress\1.7\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\intermediates\exploded-aar\com.android.support\multidex\1.0.1\res -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\generated\res\rs\flavors_user\debug -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\generated\res\resValues\flavors_user\debug -S D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\app\backup\res -A D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\freeline-assets -A D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\src\main\assets -m -J D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\app\backup --auto-add-overlay -F D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\base-res.so --debug-mode --resoucres-md5-cache-path D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\arsc_cache.dat --ignore-assets public_id.xml:public.xml:.bak:.
[DEBUG] [install_apk_task] start to install apk to device...
[DEBUG] [install_apk_task] install_apk_task finish in 0.2s
[DEBUG] [build_base_resource_task] generate base resource success: D:\android\project_studio\chcts\Src-Android-User\mobilebank\app\build\freeline\base-res.so
[DEBUG] [tracing] build_base_resource_aapt_task: 22879.0001869ms
[DEBUG] [build_base_resource_task] build_base_resource_task finish in 23.0s
[DEBUG] [task_engine] task engine occurs exception, engine will exit.
[DEBUG] [task_engine] it takes task engine 108.39s to execute tasks.
[ERROR] --------------------------------------------------------
[ERROR] Freeline ERROR
[ERROR] --------------------------------------------------------
Traceback (most recent call last):
File "D:\android\project_studio\chcts\Src-Android-User\mobilebank\freeline_core\task.py", line 123, in execute
self.task.execute()
File "D:\android\project_studio\chcts\Src-Android-User\mobilebank\freeline_core\android_tools.py", line 43, in execute
self._install_apk()
File "D:\android\project_studio\chcts\Src-Android-User\mobilebank\freeline_core\android_tools.py", line 69, in _install_apk
output, err, code = cexec(install_args, callback=None)
File "D:\android\project_studio\chcts\Src-Android-User\mobilebank\freeline_core\utils.py", line 28, in cexec
p = Popen(args, stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env, cwd=cwd)
File "C:\Python27\lib\subprocess.py", line 711, in init
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 959, in _execute_child
startupinfo)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 134-137: ordinal not in range(128)

[ERROR] --------------------------------------------------------
[ERROR] unexpected exception within task
[ERROR] --------------------------------------------------------
[DEBUG] Prepare tasks time: 0.4s
[DEBUG] Task engine running time: 108.4s
[DEBUG] Total time: 108.8s
[DEBUG] --------------------------------------------------------

我apk文件名含有中文 但我改成 英文就可以了

@lomanyong
Copy link
Member

@qsyj get,这里说的解决中文路径的问题的,跟安装apk的中文命令无关。暂时尽量使用英文吧~Python对于中文编码的支持还是有各种坑在...现在无法保证把每个中文的编码坑都填上...

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