[英]Adb install failure: INSTALL_CANCELED_BY_USER
我嘗試通過 adb 安裝應用程序並收到錯誤消息:
$ ./adb -d install /Users/dimon/Projects/one-place/myprogram/platforms/android/build/outputs/apk/android-debug.apk -r -g
3704 KB/s (4595985 bytes in 1.211s)
pkg: /data/local/tmp/android-debug.apk
Failure [INSTALL_CANCELED_BY_USER]
在設備中,我現在什么都不做。 設備是小米5,MIUI 7.2.13,Android 6.0。 開發者模式已啟用。 如何解決這個問題?
嘗試運行“ionic run android”命令時出現同樣的錯誤。
更新程序
這是在安裝程序的時刻從“adb logcat”命令獲取的日志:
06-06 10:04:20.051 788 903 I DisplayFeatureService: void android::update_watchlist(const prop_info*, void*): sys.boot_completed: 1
06-06 10:04:20.063 788 903 I DisplayFeatureService: void android::update_watchlist(const prop_info*, void*): sys.boot_completed: 1
06-06 10:04:20.078 13397 13397 E ANDR-PERF-MPCTL: Unable to create control service (stage=2, rc=-1)
06-06 10:04:20.082 788 903 I DisplayFeatureService: void android::update_watchlist(const prop_info*, void*): sys.boot_completed: 1
06-06 10:04:20.079 13396 13396 W iop : type=1400 audit(0.0:527): avc: denied { write } for name="socket" dev="tmpfs" ino=14686 scontext=u:r:dumpstate:s0 tcontext=u:object_r:socket_device:s0 tclass=dir permissive=0
06-06 10:04:20.088 788 903 I DisplayFeatureService: void android::update_watchlist(const prop_info*, void*): sys.boot_completed: 1
06-06 10:04:20.926 13400 13400 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
06-06 10:04:20.930 13400 13400 D AndroidRuntime: CheckJNI is OFF
06-06 10:04:20.966 13400 13400 D ICU : No timezone override file found: /data/misc/zoneinfo/current/icu/icu_tzdata.dat
06-06 10:04:20.995 13400 13400 I Radio-JNI: register_android_hardware_Radio DONE
06-06 10:04:21.004 13400 13400 E : WFDWhiteListing : library initialized successfully
06-06 10:04:21.020 13400 13400 D AndroidRuntime: Calling main entry com.android.commands.pm.Pm
06-06 10:04:21.027 13400 13400 I Timeline: Timeline: Activity_launch_request time:973226
06-06 10:04:21.028 1497 2996 I ActivityManager: START u0 {act=android.intent.action.VIEW dat=file:///data/local/tmp/android-debug.apk typ=application/vnd.android.package-archive flg=0x18000000 cmp=com.miui.securitycenter/com.miui.permcenter.install.AdbInstallActivity (has extras)} from uid 2000 on display 0
06-06 10:04:21.033 1497 2996 E : WFDMMServiceClient ctor Context = 0x0, Cb = 0x0
06-06 10:04:21.033 1497 2996 E : getWFDMMServiceInstance get new Instance
06-06 10:04:21.033 1497 2996 E : Service not available yet
06-06 10:04:21.034 1497 2996 E : WFDMMServiceClient::~WFDMMServiceClient
06-06 10:04:21.037 1497 2996 E : WFDMMServiceClient ctor Context = 0x0, Cb = 0x0
06-06 10:04:21.037 1497 2996 E : getWFDMMServiceInstance get new Instance
06-06 10:04:21.037 1497 2996 E : Service not available yet
06-06 10:04:21.037 1497 2996 E : WFDMMServiceClient::~WFDMMServiceClient
06-06 10:04:21.050 2875 3077 D PowerKeeperEventLogManager: notifyForegroundCompomentChanged ComponentInfo{com.miui.securitycenter/com.miui.permcenter.install.AdbInstallActivity}
06-06 10:04:21.051 2875 3036 D PowerKeeperExecutor: notify state normal_state enter...
06-06 10:04:21.051 2875 3036 D PowerKeeperExecutor: foreground_change:
06-06 10:04:21.051 2875 3036 D PowerKeeperExecutor: set_cpu_powermode(middle)
06-06 10:04:21.051 2875 3036 I PowerKeeperExecutor: no local quick execution method for set_cpu_powermode
06-06 10:04:21.051 2875 3036 D PowerKeeperExecutor: set_lcd_mode(ui)
06-06 10:04:21.051 2875 3036 I PowerKeeperExecutor: no local quick execution method for set_lcd_mode
06-06 10:04:21.049 2887 2887 W EventReader: type=1400 audit(0.0:528): avc: denied { search } for name="756" dev="proc" ino=16099 scontext=u:r:system_app:s0 tcontext=u:r:zygote:s0 tclass=dir permissive=0
06-06 10:04:21.049 2887 2887 W EventReader: type=1400 audit(0.0:529): avc: denied { search } for name="756" dev="proc" ino=16099 scontext=u:r:system_app:s0 tcontext=u:r:zygote:s0 tclass=dir permissive=0
06-06 10:04:21.051 3247 4440 I octvm_power: power mode [normal] start 1465200261
06-06 10:04:21.051 3247 4440 I octvm_power: Action: set_cpu_powermode(middle) for [foreground_change]
06-06 10:04:21.051 3247 4440 I octvm_drv: common drv: platform_set_power_profile -> platform not support
06-06 10:04:21.051 2533 2887 I octvm : task pid 2113 have been add to group sys_standby.
06-06 10:04:21.051 3247 4440 I octvm_power: Action: set_lcd_mode(ui) for [foreground_change]
06-06 10:04:21.051 3247 4440 I octvm_drv: common drv: platform_set_lcd_mode -> platform not support
06-06 10:04:21.051 2533 2887 I octvm : task pid 2900 have been add to group sys_standby.
06-06 10:04:21.049 2887 2887 W EventReader: type=1400 audit(0.0:530): avc: denied { search } for name="756" dev="proc" ino=16099 scontext=u:r:system_app:s0 tcontext=u:r:zygote:s0 tclass=dir permissive=0
06-06 10:04:21.051 2533 2887 I octvm : task pid 4553 have been add to group sys_standby.
06-06 10:04:21.051 2533 2887 I octvm : [sys_standby]cgroup_add_tasks max single write time: 0ms
06-06 10:04:21.051 2533 2887 I octvm : [sys_standby]cgroup_add_tasks total time consume: 0ms
06-06 10:04:21.051 3247 4440 I octvm_power: onPowerModeChanged[normal] called
06-06 10:04:21.052 2875 3093 I FirstNotificationController: handleUnlockState: stoped
06-06 10:04:21.055 1497 2996 I Timeline: Timeline: App_transition_ready time:973254
06-06 10:04:21.055 1976 1976 V PhoneStatusBarPolicy: updateManagedProfile: mManagedProfileFocused: false mKeyguardVisible: true
06-06 10:04:21.055 1497 2996 I Timeline: Timeline: App_transition_stopped time:973255
06-06 10:04:21.059 1497 2996 E ActivityManager: Invalid thumbnail dimensions: 0x0
06-06 10:04:21.059 4553 4553 W .securitycenter: type=1400 audit(0.0:531): avc: denied { search } for name="tmp" dev="dm-0" ino=28 scontext=u:r:system_app:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0
06-06 10:04:21.066 4553 4553 W asset : Asset path /data/local/tmp/android-debug.apk is neither a directory nor file (type=0).
06-06 10:04:21.066 4553 4553 D AdbInstallActivity: parsePackage is null , path :/data/local/tmp/android-debug.apk
06-06 10:04:21.059 4553 4553 W .securitycenter: type=1400 audit(0.0:532): avc: denied { search } for name="tmp" dev="dm-0" ino=28 scontext=u:r:system_app:s0 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0
06-06 10:04:21.072 1497 2230 E : WFDMMServiceClient ctor Context = 0x0, Cb = 0x0
06-06 10:04:21.072 1497 2230 E : getWFDMMServiceInstance get new Instance
06-06 10:04:21.072 1497 2230 E : Service not available yet
06-06 10:04:21.072 1497 2230 E : WFDMMServiceClient::~WFDMMServiceClient
06-06 10:04:21.073 1497 2230 E : WFDMMServiceClient ctor Context = 0x0, Cb = 0x0
06-06 10:04:21.073 1497 2230 E : getWFDMMServiceInstance get new Instance
06-06 10:04:21.073 1497 2230 E : Service not available yet
06-06 10:04:21.073 1497 2230 E : WFDMMServiceClient::~WFDMMServiceClient
06-06 10:04:21.075 1497 2230 E ActivityManager: Invalid thumbnail dimensions: 0x0
06-06 10:04:21.076 2875 3077 D PowerKeeperEventLogManager: notifyForegroundCompomentChanged ComponentInfo{com.android.settings/com.android.settings.Settings$WifiSettingsActivity}
06-06 10:04:21.069 2887 2887 W EventReader: type=1400 audit(0.0:533): avc: denied { search } for name="756" dev="proc" ino=16099 scontext=u:r:system_app:s0 tcontext=u:r:zygote:s0 tclass=dir permissive=0
06-06 10:04:21.076 1497 2230 I Timeline: Timeline: App_transition_ready time:973275
06-06 10:04:21.076 1497 2230 I Timeline: Timeline: App_transition_stopped time:973275
06-06 10:04:21.076 2533 2887 I octvm : task pid 2060 have been add to group sys_standby.
06-06 10:04:21.076 2533 2887 I octvm : [sys_standby]cgroup_add_tasks max single write time: 0ms
06-06 10:04:21.076 2533 2887 I octvm : [sys_standby]cgroup_add_tasks total time consume: 0ms
06-06 10:04:21.077 1976 1976 V PhoneStatusBarPolicy: updateManagedProfile: mManagedProfileFocused: false mKeyguardVisible: true
06-06 10:04:21.090 13400 13400 I art : System.exit called, status: 1
06-06 10:04:21.090 13400 13400 I AndroidRuntime: VM exiting with result code 1.
06-06 10:04:21.100 2060 2130 V MI_STAT : disabled local event upload
我看到 android-debug.apk 何時創建,但我不明白為什么它沒有安裝。 也許關鍵字符串是:
06-06 10:04:21.066 4553 4553 W asset : Asset path /data/local/tmp/android-debug.apk is neither a directory nor file (type=0).
06-06 10:04:21.066 4553 4553 D AdbInstallActivity: parsePackage is null , path :/data/local/tmp/android-debug.apk
但這不是錯誤字符串,只是警告和調試。 還有奇怪的線:
06-06 10:04:21.059 1497 2996 E ActivityManager: Invalid thumbnail dimensions: 0x0
但我不知道這是否是一個問題。
我還嘗試通過 adb 安裝其他一些應用程序,而不僅僅是自己編寫的。 但沒有結果。
同樣的問題也出現在這里。
所以,這是小米的問題,這里是這個問題的解決方案:
轉到“安全”應用程序並點擊右上角的“選項”
向下滾動到“功能設置”組,然后查找“權限”
在那里關閉“通過 USB 安裝”選項,該選項通過 USB 管理應用程序的安裝,但不允許這樣做。
在最新的 Redmi 設備上
設置 > 其他設置 > 開發人員選項 > 開發人員選項:選中通過 USB 安裝選項。
祝你好運!
在 MIUI 8 中,轉到開發人員設置並切換“通過 USB 安裝”以啟用它。
紅米和小米設備關閉MIUI優化
設置 > 附加設置 > 開發者選項 > MIUI 優化
對於 Mi 或小米設備
1)設置
2)附加設置
3)開發者選項
4)通過 USB 安裝:打開
它對我來說很好。
注意:不工作然后嘗試以下選項
1) 登錄小米賬號(不適用於所有設備)
2)同時禁用開啟MIUI優化:設置->附加設置->開發者選項,靠近底部我們會得到這個選項。
3) 必須啟用開發者選項和啟用開發者選項的鏈接: 此處說明
還是行不通?
-> 退出小米帳號,然后創建新帳號並啟用 USB 調試。
謝謝
問題似乎出在 Instant Run 功能上。轉到“文件 -> 設置 -> 構建、執行、部署 -> 即時運行”並禁用它。
如果以上答案不起作用,希望這有效..
在開發者設置中關閉Miui 優化,然后重啟手機。 它對我有用。 設置> 其他設置 > 開發者選項 > MIUI優化
我以前也遇到過同樣的問題。 這是我的解決方案:
我嘗試了上述所有步驟,但失敗了。
例如, connect to the internet with Data connection
, Turning off the MIUI optimization and reboot
,從安全設置中打開Install via USB
等。
然后我找到了解決方案。
腳步:
China-Shanghai
服務器Install via USB
。就這樣。
對於 MIUI OS 設備
1) 進入設置
2)向下滾動到附加設置
3)您會在底部找到開發人員選項
4)打開它 -通過 USB 安裝:打開
通過打開它,它在我的 MIUI8 設備中很有用。
在帶有 MIUI8.3 (Android 6) Xiaomi.EU Rom 的小米 Mi5s 上:
設置/其他設置/開發人員選項/打開:允許 USB 調試、允許 USB 安裝和允許 USB 調試(安全選項)
{抱歉翻譯,我的設備有西班牙文}
此外,任何應用鎖密碼都應通過設置>應用鎖來刪除,輸入設置的密碼並刪除鎖。 這在 REDMI 4A 上對我有用
還有一件事:在 MIUI 開發者模式的一些更新之后,它被禁用了。 我確定,那是打開的,但我無法啟動應用程序。 所以我重新啟用了開發者模式,一切都開始工作了。 我已經多次遇到這個問題。 希望能幫助到你。
有時應用程序生成錯誤:簽名錯誤或對齊錯誤並報告錯誤。
檢查您的 jarsigner 和 zipaligned 命令。
我使用的是小米紅米 Prime 3S,上述方法對我不起作用。 這讓我很沮喪
我嘗試的是,我從 Mi 帳戶注銷,然后創建了新帳戶。 tada...之后我可以啟用USB調試。 希望這可以幫助。
如果您的開關通過 USB 安裝並且您收到“設備暫時受限”錯誤,請應用任何默認移動主題。 如果應用了任何其他開發人員主題,則它不會允許您打開通過 USB 安裝。 這對我有用。
對於 MIUI 13 及更高版本的任何人 - MIUI 優化選項是隱藏的,因此你必須 go 到開發人員選項 -> 重置為默認值並多次按下它以便出現 MIUI 優化 - 只有這樣你才能禁用它。
這是我的情況(使用react-native )我在安裝時按 Ctr+C 中斷,然后發生此錯誤。 - 解決方案:
cd android
./gradlew clean
當我轉到settings > Additional Settings > Developer Options > activated USB debugging
並激活通過 USB 安裝並激活 USB 調試(安全設置)並激活通過 USB 驗證應用程序時,我有一個Xiaomi 8
。 並且您可以驗證您是否已激活 打開MIUI optimisation
,如果不激活那么激活。 然后你重啟你的設備,你就可以為我運行你的應用程序了。
這是小米的問題如果可能,將 MIUI 更新到最新版本,然后轉到設置 > 其他設置 > 開發人員選項 > 開發人員選項:選中通過 USB 安裝選項。
這解決了我的問題希望它也能解決你的好運!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.