[RK3288][Android6.0] 调试笔记 --- 通过adb安装APK时间很长问题

时间:2022-12-28 23:26:02
Platform: Rockchip
OS: Android 6.0
Kernel: 3.10.92

使用adb安装apk
[kris@:~/Downloads]$ adb install souhushipin_6500.apk
要耗时40s,log如下:
01-21 17:39:26.210  2011  2011 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 0 <<<<<<
01-21 17:39:26.214  2011  2011 D AndroidRuntime: CheckJNI is OFF
01-21 17:39:26.287  2011  2011 E memtrack: Couldn't load memtrack module (No such file or directory)
01-21 17:39:26.287  2011  2011 E android.os.Debug: failed to load memtrack module: -2
01-21 17:39:26.290  2011  2011 I Radio-JNI: register_android_hardware_Radio DONE
01-21 17:39:26.314  2011  2011 D AndroidRuntime: Calling main entry com.android.commands.pm.Pm
01-21 17:39:26.330  1126  1138 D DefContainer: Copying /data/local/tmp/souhushipin_6500.apk to base.apk
01-21 17:39:28.553   527   555 I PackageManager.DexOptimizer: Running dexopt (dex2oat) on: /data/app/vmdl1809725406.tmp/base.apk pkg=com.sohu.sohuvideo isa=arm vmSafeMode=false debuggable=false oatDir = /data/app/vmdl1809725406.tmp/oat bootComplete=true
01-21 17:39:28.554   213   213 E installd: oat_dir:/data/app/vmdl1809725406.tmp/oat dexopt_needed:1
01-21 17:39:28.554   213   213 V installd: DexInv: --- BEGIN '/data/app/vmdl1809725406.tmp/base.apk' ---
01-21 17:39:28.554  2025  2025 V installd: dalvik.vm.dex2oat-flags=
01-21 17:39:28.554  2025  2025 V installd: Running /system/bin/dex2oat in=base.apk out=/data/app/vmdl1809725406.tmp/oat/arm/base.odex
01-21 17:39:28.584  2025  2025 I dex2oat : Starting dex2oat.
01-21 17:39:30.435  2025  2025 I dex2oat : Large app, accepted running with swap.
01-21 17:39:30.440  2025  2028 W dex2oat : Before Android 4.1, method void android.a.a.performSaveInstanceState(android.os.Bundle) would have incorrectly overridden the package-private method in android.app.Fragment
01-21 17:39:30.485  2025  2029 W dex2oat : Before Android 4.1, method int android.support.v7.widget.ListViewCompat.lookForSelectablePosition(int, boolean) would have incorrectly overridden the package-private method in android.widget.ListView

01-21 17:39:48.213  2025  2029 W dex2oat : No verified method for method calling String.<init>: java.lang.String java.io.ByteArrayOutputStream.toString()
01-21 17:39:49.335  2025  2028 W dex2oat : Compilation of boolean com.sohu.sohuvideo.control.download.i$b.a(com.sohu.sohuvideo.control.download.aidl.VideoDownloadInfo, com.sohu.sohuvideo.control.download.model.c, boolean, int, int, int, boolean) took 294.646ms
01-21 17:39:51.513  2025  2028 W dex2oat : No verified method for method calling String.<init>: java.lang.String android.text.SpannableStringBuilder.toString()
01-21 17:39:51.513  2025  2028 W dex2oat : No verified method for method calling String.<init>: java.lang.String android.text.SpannableStringBuilder.toString()
01-21 17:39:52.595  2025  2027 I dex2oat : Skipping compilation of boolean com.tencent.stat.common.j.a(byte[], int, int, boolean): it contains a non natural loop
01-21 17:39:54.270  2025  2027 I dex2oat : Skipping compilation of boolean ji.b$c.a(byte[], int, int, boolean): it contains a non natural loop
01-21 17:39:54.852  2025  2029 W dex2oat : Compilation of void o.a.b(com.alibaba.fastjson.asm.b, o.a$a) took 157.323ms
01-21 17:39:56.543  2025  2028 W dex2oat : Compilation of void org.json.Test.main(java.lang.String[]) took 118.445ms
01-21 17:40:00.831  2025  2025 I dex2oat : dex2oat took 32.211s (threads: 4) arena alloc=5MB java alloc=24MB native alloc=48MB free=668KB swap=48MB
01-21 17:40:00.912   213   213 V installd: DexInv: --- END '/data/app/vmdl1809725406.tmp/base.apk' (success) ---
01-21 17:40:01.142   527   555 W Settings: Setting install_non_market_apps has moved from android.provider.Settings.Global to android.provider.Settings.Secure, returning read-only value.
01-21 17:40:01.142   527   555 I art     : Starting a blocking GC Explicit
01-21 17:40:01.212   527   555 I art     : Explicit concurrent mark sweep GC freed 148960(8MB) AllocSpace objects, 7(1172KB) LOS objects, 33% free, 5MB/8MB, paused 965us total 69.470ms
01-21 17:40:01.215   610   610 D CarrierServiceBindHelper: Receive action: android.intent.action.PACKAGE_ADDED
01-21 17:40:01.215  2011  2011 I art     : System.exit called, status: 0
01-21 17:40:01.215  2011  2011 I AndroidRuntime: VM exiting with result code 0.

log
"Before Android 4.1, method......"
对应的文件在
art/runtime/class_linker.cc

解决方法:
替换Android Studio buildToolsVersion版本为23.0.1

[RK3288][Android6.0] 调试笔记 --- 通过adb安装APK时间很长问题


参考:

http://*.com/questions/33805360/cant-install-android-studio-apk-on-my-phone
http://*.com/questions/23005656/android-method-with-default-package-visibility-overriding-shouldnt-work-but