解决MainActivity.onCreate(Unknown Source)的混淆错误

将D:\Work\FWatch\forwatch\build\outputs\mapping\release\mapping.txt复制到D:\Android\SDK\tools\proguard\bin,
然后将崩溃的crash.log也复制到这个目录下,用如下命令,可以查看具体的崩溃点:
retrace.bat mapping.txt crash.log

也可以执行如下脚本(auto.bat):for %%s in (*.log) do retrace mapping.txt %%s > %%s.txt


我写了个DOS批处理的脚本:retrace.bat,把它丢到crash.log文件夹下,双击即可。

@echo off&setlocal enabledelayedexpansion
set RETRACE_PATH=D:\Android\SDK\tools\proguard\bin
set MAPPING_PATH=D:\Work\FWatch\forwatch\build\outputs\mapping\release
set CURRENT_PATH=%cd%
echo RETRACE_PATH: %RETRACE_PATH%
echo MAPPING_PATH: %MAPPING_PATH%
echo CURRENT_PATH: %CURRENT_PATH%

set retrace=retrace.bat
set mapping=%MAPPING_PATH%\mapping.txt
echo retrace: %retrace%
echo mapping: %mapping%

@echo 转换开始
@for %%s in (*.log) do (
@cd /d %RETRACE_PATH%
retrace %mapping% "%cd%\%%s" > "%cd%\%%s.txt"
@cd /d %cd%
)

pause


你可能感兴趣的:(Android错误处理)