问题描述
我已经开发了Android Studio的应用程序,并将其构建为使用V1和V2签名的APK.
它可以成功安装在我的手机中.
但是,当我卸载该应用程序并再次安装应用程序时,它将显示未安装的应用程序.
但是APK文件是同一APK文件.为什么第一次可以安装,但第二次无法成功?
现在,当我看到此错误时,我将更改版本代码,然后该应用程序可以安装.
但是除了该解决方案外,还对此问题有任何解决方案吗?
非常感谢!
推荐答案
我搜索了整个搜索,因此解决了这个问题的解决方案.即使禁用Google Play Protect也无效.用debuggable=false创建APK不起作用.我偶然发现了一些答案,这些答案将我指向博客(底部的链接)
与我有用的是
goto Android Studio - > Build - > Build Bundle(s) / APK(s) - > Build APK(s)
但是,我似乎仍然不明白为什么签名的调试APK不会在我的设备上安装.
还有更多要记住的事情.
- 即使您在设备上安装了旧的APK,并且正在使用Build APK(s) apk进行安装来更新它,
- 即使您已安装了旧的APK. Android的软件包安装程序不再显示用户友好的消息.
- 如果此方法不起作用,请从设备卸载此APK的所有变体,然后重试.
其他推荐答案
这可能是因为没有免费存储空间可以安装应用程序.因此,检查您的内部存储.
其他推荐答案
只需尝试在清单文件中添加操作视图即可.在此之后,应用程序和问题解决
<activity android:name=".MyActivity" android:screenOrientation="portrait" android:label="@string/app_name"> <intent-filter> // add this line of code in application tag only single line of code will also work <action android:name="android.intent.action.VIEW" /> </intent-filter> </activity>
问题描述
I have developed the app by Android Studio, and build it to signed apk with V1 and V2.
It could install in my phone successfully.
But, when I uninstall the app, and install the app again, it would show App not installed.
But the apk file is the same apk file. Why first time can install, but not successful in second time?
Now, when I see this error, I would change the versionCode, then the app could install.
But beside this solution, have any solution on this problem?
Thank you so much!
推荐答案
I searched entire SO for the solution to this issue. Even disabling Google Play Protect didnt work. Creating APK with debuggable=false didnt work. I stumbled upon some answers which pointed me to a blog(link at the bottom)
What worked with me was
Goto Android Studio -> Build -> Build Bundle(s) / APK(s) -> Build APK(s)
However, I still dont seem to understand why a signed debug APK wont install on my device.
Couple more things to remember.
- You will see App Not Installed error even if you have old APK installed on the device and you are using Build APK(s) APK to install to update it. The package installer of Android is no more showing user friendly messages.
- If this method does not work, uninstall all variants of this APK from device and then try again.
More Info: https://commonsware.com/blog/2017/10/31/android-studio-3p0-flag-test-only.html
其他推荐答案
This can be because no free storage space is available to install the app. So, check your internal storage.
其他推荐答案
Just try adding Action VIEW in manifest file . After this reinsatll the app and problem solve
<activity android:name=".MyActivity" android:screenOrientation="portrait" android:label="@string/app_name"> <intent-filter> // add this line of code in application tag only single line of code will also work <action android:name="android.intent.action.VIEW" /> </intent-filter> </activity>