简体   繁体   English

重新安装失败(是)软件包已存在

[英]Re-installation failed (YES) Package already exists

So, I have an app which I am running on real device. 因此,我有一个在真实设备上运行的应用程序。 When running the app the following dialog is shown. 运行该应用程序时,将显示以下对话框。 在此处输入图片说明

Clicking Yes is followed by error in Console 单击是,然后在Console error

- google-play-services_lib] Installation error! -google-play-services_lib]安装错误! The package already exists. 该软件包已存在。
- Launch failed on device: -在设备上启动失败:

I have tried uninstalling app from my phone but didn't work. 我曾尝试从手机上卸载应用程序,但无法正常工作。

Any idea how to fix it? 知道如何解决吗?

That's caused by attempting to install an apk maybe from the ide with debug keystore on a device that has the production apk with the production keystore. 这是由于尝试从具有调试密钥库的ide上在具有生产密钥库的生产apk的设备上安装apk引起的。 Just go into the phones app settings and uninstall the app . 只需进入手机应用程序设置并卸载该应用程序即可 I get a few of these after I test the upgrade path from the beta store and then go back to developing with the ide. 在测试了Beta存储的升级路径之后,我又得到了其中的一些建议,然后又回到使用ide进行开发。

You dont need to reinstall google-play-services. 您不需要重新安装google-play-services。 It's updating automatically by Play Market. Play Market会自动更新。 I had problems like yours and let me guess: when you debuging app from eclipse - google play services doesnt sign in, but when u release it and download from play market - it works fine. 我遇到了像您这样的问题,让我猜:当您从eclipse调试应用程序时-Google Play服务无法登录,但是当您释放它并从Play市场下载时-它工作正常。 If its true, so mark your google-services as a library and delete from "java build path" in your app. 如果属实,请将您的google-services标记为一个库,然后从您应用中的“ java构建路径”中删除。

right click on project-> Properties -> Java Build Path -> Projects

Delete google-play-services from there 从那里删除google-play-services

Now, you have to obtain debug certificate SHA1 现在,您必须获取调试证书SHA1

  1. in Eclipse go to Window->Preferences 在Eclipse中,转到“ 窗口”->“首选项”
  2. Andoid->Build (there you can find debug certificate SHA1 for debuging) Andoid-> Build(您可以找到调试证书SHA1进行调试)

    1. Go to Android Developper Console https://play.google.com/apps/publish 转到Android开发者控制台https://play.google.com/apps/publish
    2. Select your game in Play service 在Play服务中选择您的游戏
    3. Go to "linked applications" 转到“链接的应用程序”
    4. Create a NEW linked application android and put it your debug certificate SHA1 创建一个新的链接应用程序android并将其放入调试证书SHA1
    5. Wait a few to changes be deployed 等待一些变更部署

You will get two similar links, but with different SHA1 ( one for debugging, second for releasing) 您将获得两个相似的链接,但具有不同的SHA1(一个用于调试,第二个用于发布)

Now, you need to clear the Android Application cache before trying to connect 现在,您需要先清除Android应用程序缓存,然后再尝试连接

  1. Clear cache of your application 清除应用程序的缓存
  2. Launch your app 启动您的应用

I solved my problem like this 我这样解决了我的问题

try doing it through command prompt use: 尝试通过命令提示符使用:

adb uninstall PACKAGE_NAME 亚行卸载PACKAGE_NAME

and see if it works 看看是否可行

also try renaming the package name just to be sure. 还要确保重命名程序包名称。

I feel you are trying to install google-play-services.You don't need to update google play services.From the docs: 我觉得您正在尝试安装google-play-services。您不需要更新google-play服务。从文档中:

The Google Play services APK Google Play服务APK

The Google Play services APK contains the individual Google services and runs as a background service in the Android OS. Google Play服务APK包含各个Google服务,并在Android OS中作为后台服务运行。 You interact with the background service through the client library and the service carries out the actions on your behalf. 您通过客户端库与后台服务进行交互,并且该服务代表您执行操作。 An easy-to-use authorization flow is also provided to gain access to the each Google service, which provides consistency for both you and your users. 还提供了易于使用的授权流程,以访问每个Google服务,从而为您和您的用户提供了一致性。

The Google Play services APK is delivered through the Google Play Store, so updates to the services are not dependent on carrier or OEM system image updates. Google Play服务APK是通过Google Play商店提供的,因此服务更新不取决于运营商或OEM系统映像更新。 In general, devices running Android 2.3 (Gingerbread) or later and have the Google Play Store app installed receive updates within a few days. 通常,运行Android 2.3(Gingerbread)或更高版本并安装了Google Play商店应用的设备会在几天内收到更新。 This allows you to use the newest APIs in Google Play services and reach most of the devices in the Android ecosystem (devices older than Android 2.3 or devices without the Google Play Store app are not supporte 这样,您可以使用Google Play服务中的最新API并访问Android生态系统中的大多数设备(不支持Android 2.3之前的设备或不支持Google Play Store应用的设备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM