当我尝试使用 adb install 命令更新应用程序时,出现错误
Failure [INSTALL_FAILED_PACKAGE_CHANGED: installPackageLI]
。我尝试在 android 源代码中搜索错误,但该错误没有有意义的记录。以下行来自 android 源:
/**
* Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS}
* if the package changed from what the calling program expected.
*
* @hide
*/
@SystemApi
public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23;
但是解释很模糊,我不知道这个错误的原因是什么。
检查您是否在 Manifest 文件中添加了
android:testOnly="true"
,
并将其更改为
android:testOnly="false"