I am developing an Android Application using Xamarin.Android in Xamarin Studio. It uses Google Play Game Services.
The project has run and tested find up until this point. Yesterday I upgraded my development PC from Windows 7 to Windows 8.1. In the process I also had to reinstall Xamarin Studio.
Now when my app attempts to connect to Google Play, it fails with error "RESULT_APP_MISCONFIGURED" which as far as I can tell means that my app is not properly authorized to access the Google Play API. However, nothing has actually changed.
I tested an older version of the app, and it is still able to connect to the Google Play API. Nothing in the code itself has changed, so I think it must be something to do with my recently upgrade of Windows, or the recent re-install of Xamarin Studio.
Any thoughts on what would help narrow down the problem? Is it possible the debug keystore has changed somehow?
An additional clue: when I attempt to build an deploy to a device that has the older, working version of the app on it, I get the following error:
Deployment failed because of an internal error: Failure
[INSTALL_FAILED_UPDATE_INCOMPATIBLE]
I then have to manually uninstall the old version before the new one can be deployed.
As has already been pointed out, the debug keystore won't be the same on all installations of Xamarin.Android. Which is expected behavior.
When using Play Services you want to create a keystore, preferably one for debug and one for release, or as different aliases in the same keystore (you figure that out).
Then you can make the build process automagically sign your app by adding some stuff to your .csproj file. You can read more about this in the docs.
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>public.keystore</AndroidSigningKeyStore>
<AndroidSigningStorePass>MyKeystorePassword</AndroidSigningStorePass>
<AndroidSigningKeyAlias>MyKey</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>MyKeyPassword</AndroidSigningKeyPass>
</PropertyGroup>
You can make a similar block for Debug as well choosing either another alias or another keystore.
Yes, debug keystore is part of the Xamarin installation and it changes if you reinstall Xamarin. You need to update the key signature on Google console, this time create a keystore and keep it hidden, keep it safe (so to speak).
Related
I have an old app that I've written for personal use only, and never made as release to the Play Store. I installed it to my phone via Android Studio using run app command.
Many years later I want to modify the app, I try to pick up the app and run it again, this time using a different computer. I get the error saying:
"Installation failed since the device already has an application with the same package but a different signature. In order to proceed, you have to uninstall the existing application."
I definitely don't want to uninstall my app, this would cause me lost all the data I've entered to it. So I want to ask that isn't the debug keystore used by Android Studio to install app on device would create app of the same signature? Why it would be different? Is a different machine caused this issue? Thank you very much!
It sounds like you were using your debug certificate when you originally installed the app. This is unique to each machine when you install Android Studio.
You can copy the debug certificate from your old machine to your new one.
The file is located in your [userhome]\.android\debug.keystore
I am developing an Android game and currently trying to integrate with Google Play Game Services. I got stuck at the sign-on feature.
I use GoogleSignIn, getIntent, startActivityForResult etc. - all as described in Google manual. I think all's setup correctly, because when I build the app, deploy to Google Store (Internal Tests), and then I install it from there, all looks good: onActivityResult is called with result.isSuccess()==true and GoogleSignIn.getLastSignedInAccount returns != null.
The problem is when I try to run the app from Android Studio (or install APK manually). In this case, onActivityResult is called with SIGN_IN_REQUIRED and getLastSignedInAccount is always null. I am pretty sure all's setup fine (APK is signed, Android Studio is configured to sign the APKs etc.).
To ensure it's not about my Android Studio setup, I have installed manually exactly the same APK which I uploaded to Google Store but again - result is the same. When installed from Google Store, it's OK, when installed manually it's not (again: exactly the same APK binary).
Can you please help me? Theoretically I could continue development, but each I'd like to test something I'd need to upload new version to Google Store...
Thank you
Hmmm...its usual DEVELOPER ERROR, what you can do it..add your SHA1 code on firebase console, and it will work, it is showing this behaviour caus your signed key SHA1 is already added, that why it is working on release build and not on debug build, add your systems SHA1
How to get SHA1?
usually right side of android studio have a bar which says gradle click on it, expand it got to app>Tasks>android>signing report double click it...it will give you your SHA1, paste it on firebase console, wait for 1-2 minutes and check. It will work.
I've found the following error when running my android application in android studio. app couldn't get installed on my device because of this error. Didn't find the solution :(
please help
Auth: [GoogleAccountDataServiceImpl] getToken() failed.
Status BAD_AUTHENTICATION,
Account: ,
App:com.android.vending,
Service: androidmarket com.google.android.gms.auth.be.account.b.d: Long live credential not
available.
I had the same issue what helped me was that I had wrong credentials in my google-services.json file and after getting a new file my problem was fixed.
in the process of resolving this issue I also updated my google play services but I do not think this is necessary .
I got this error when tried to install app directly from Android Studio.
It was due to certificate mismatch, since I used release certificate for setting up the app in Play Console, while Android Studio signs the app with debug certificate by default.
Installing app via adb resolved the error.
https://developers.google.com/games/services/android/quickstart#step_4_test_your_game
Make sure to run an APK that you exported and signed with a
certificate that matches one of the certificates you used during the
application setup in Google Play Console.
I have the same problem some days ago. I just compile my whole code in a new project and Problem Solved!!.
Don't know what was the real problem. There is an issue filed here, with no solution.
There are several reasons you can get that message:
The account you are trying to log on with needs to be re-authenticated on the phone (try a different account)
The gms:play-services version is out of date (needs to be 15+ as of Jan 2021)
Your app fingerprint is not the right one. You need one for dev builds, different one for prod -- which is different based on how you sign (do you have the final publish key, or does Play store re-sign with the final publish key?)
Follow the Google tutorial and get their stand-alone project, it should take 20 min, and check your setup there. If you are running it with all the right accounts it should work. Then go back to your app.
https://developers.google.com/identity/sign-in/android/start
I updated Google Play Services on my phone and stopped receiving the same error. I am importing com.google.android.gms:play-services-cast:9.6.1 and analytics:9.6.1. Not sure if the version running on the device was too low but problem is now resolved but not sure how to prevent this error for users running older versions of Google Play Services.
Tested the other solutions but nothing worked. Rebooted the device and error was gone.
If you using firebase server, As per the firebase updation if you give phone number authentication put your country code before contact number it is mendetory.
example - +91 9999998888
This happened to me, auth errors in ADB, among them:
android Warn Auth [GoogleAuthUtil] GoogleAuthUtil
Because, like mentioned above, I had a debug build running on phone previously. So I fully uninstalled the app on my phone, and the next [Build and Run] ran successfully.
Please try the App with new google credentials or even try creating the whole peoject on console og google play services if you have used it .
In my case it was a dependency version problem. I had to update the auth dependency for firebase to the latest one:
implementation 'com.google.firebase:firebase-auth:17.0.0'
Here is my take towards this problem:
You may be using a single email to try and log in to google. It may be possible you might have changed the password of the particular email in the recent past. Make sure u remove your google-email from your phone/emulator. When u re-run your application, you will be asked to enter both email and password credentials.
Check if your credentials.json is still valid. Sometimes its possible that your client ID might be removed/corrupted if you have not used your android application for a long time. Make a new one and dont forget to copy-paste it in app folder of Android Project view.
PS: I am new to Android Studio and writing answers on stackoverflow in general. If you are reading this comment please let me know what improvements i can make while answering questions in the future.
I copied and ran the code in a different project that had priorly worked on simple DB operations of Firebase. Probably it already had the authentication files in place so launching the app was solved there
Mostly your token has gone bad. And needs a new one.
Go to project database > settings > General > download Json file and replace it with the one in the local project directory.
I fixed this problem with updating fingerprints (sha1 or sha256)
My problem was with Microsoft App Center.
We recently set our pipelines to send aab files to App Center, instead of apk files.
It seems that our bundle was resigned by App Center with some generated keystore. That's how App Center distributed apk files, even though our pipeline uploaded aab files.
In other words: even though our pipeline is using our own keystore to sign the aab bundle, in order to distribute through the App Center, after sending the aab to App Center, the App Center is creating universal apks with another generated keystore.
After rolling back our pipeline to send apk instead of aab, Google SignIn on our react-native app with firebase was working again.
"When you distribute Android Application Bundle (AAB), App Center generates a universal APK, signs it with a generated signing key, and distributes it to a device."
Source: https://learn.microsoft.com/en-us/appcenter/distribution/uploading
I updated my app and tested it on my device. Everything works fine if I test the app via the run button in eclipse but if I export it into an apk and try to install the apk it fails.
There is no error code or anything else, it just says the app has not been installed.
Any idea why this happens? I only changed a few things in my app: I removed the basegameutils lib from my app and migrated to the new api without basegameutils. Thats it (except for some bugfixes but that can not be the cause).
I did already restart eclipse and cleaned all projects mutiple times.
The target sdk is 22 and I am using newest system images and so on for that api level (my divce is a stock nexus 6 with 5.1.1 running). I also updated my build tools to 23.0.1 from 22.0.1 and removed the 22 version. Is this the cause?
I also tried to upload the apk in the dev console and there were no erros.
Thank you for your help.
EDIT:
The logcat output says the signature does not match the previously installed version.
If i try to install the current live version via the play store there is also an error message saying i can not install this app because another user already installed an incompatible version on this device (but i dont have it installed and i dont have multiple users on the device).
If i got to the app menu in the settings my app is shown at the bottom of the list but there is a note saying the app is not installed for the users. If i click on it all buttons are unclickable (so i can not uninstall it).
What is happening?
For me, selecting Signature Version v1 and v2 both solved the problem
Your signature changed, so as you mentioned you must uninstall the previous version. You tried to uninstall from the device UI and that fails - so try it from the command-line:
adb uninstall your_package_name
Seen on Nexus devices, occasionally only command-line uninstalls work.
I found a solution but I still have no idea what caused the problem.
somewhere on my device my app was still installed even though it didnt show up in the app drawer and the play store told me the same. In the settings/apps menu my app was still present (as i mentioned in the edit of my original post) so i clicked on it. If you click on the menu button you can chose unisntall for all users which did the trick. now I can install my apk again.
I have no idea how this happened but there you go, i hope this helps.
EDIT:
I had the same problem as this guy had. the accepted answer over there is much nicer than my poorly foramtted text ;)
"You cannot install this app because another user has already installed an incompatible version on this device"
I was facing same problem And I solved it this way, For Current Updated Android Studio 2.3
Build > Generate Signed apk.
Create Keystore path.
Put Password, alias, key password.
Build type select accordingly(eg to release in playstore use release).
Signature Version select both V1 and V2 checkboxes.
Finsih.
Go to the apk from explorer and use it for your playstore or in devices as Signed and Certified apk file.
For me the solution was to disable Play Protect on device.
You can not run signed apk directly in your android device .
I you want to run your apk then follow below steps :
1) Go to your device settings
2) In setting you find applications
3) In application checked unknown sources
This will allow you to run your signed apk without downloading from play store.
or
try this link :
"You cannot install this app because another user has already installed an incompatible version on this device"
The problem is because you have a version of your testing app. So, you're not really upgrading the app! Those are two different apps. You must first uninstall previous version (testing) so you can install the release (signed) version of your app.
I encountered this problem today and tried a few suggestions here, and this is how I solved the issue: I cleared my phone's caches / junk files and also uninstalled the test versions of the app and their APKs, and then reinstalled the new APK. Try this first before getting worried. 🙂
I got the save Error just incase someone faces this. For me it was because i have multiple projects for the same app on the phone. you need to delete older versions of the app from your phone.
If you have two options (V1 (jar signature) and V2 (Full APK Signature)) before generation signed apk. you should use V1 jar signature now, because there is no backward compatibility and all android phones with version < 7 won't accept this signature. Backward compatibility will be added in some next N Developer Preview.
There are also explanations on this developer.android in this link :
https://developer.android.com/about/versions/nougat/android-7.0#apk_signature_v2
In my case it was the proguardFiles path in build.gradle that caused this problem
Currently PlayStore performs regular checks for apps and device for harmful behavior. Installing signed APK manually is treated like unusually behavior so is preventend.
So turn off play protect feature temporary and your install will work as charm!
step one - open play store and select play protect
step two - click play protection setting button
step three - disable
step four - close and install your APK manually
I am getting the above error message when I try to debug an application that is already installed. Most others who run into this seem to be developing on different machines with different key files, but I am doing everything on the same box.
My issue is that I am testing my database upgrade process (i.e. what the onUpgrade() method of my SQLiteOpenHelper extension does). For this, I would like to try the upgrade on top of a variety of older builds. These builds are available as signed application packages. When I deploy such a package to a fresh emulator and then try to debug the current version on top, I get the error in the subject line. I think that this is because the debug deployment packages are unsigned, and the currently installed package is signed. Again, I know that the error goes away if I unstall the currently installed app, but then I cannot test the upgrade.
I do not want to go through the effort of switching back my dev environment to older build versions, so that I can build unsigned packages for these versions. I may not even be able to do this, because I switched source code repositories recently and lost some of the history.
I believe that if I were able to get Eclipse to generate a signed package for debugging, it should work. Alternatively, I could manually deploy a signed package and launch a debug session without a build/deployment step, but I have not been to figure out if this is possible, either. What can I do?
Edit: The Android documentation was helpful in figuring out how to sign a package with the debug key, but this does not help me, because I need to debug with a private key. I suppose that this is not possible.
You can sign current package with release key, install on device, run the application and connect debugger in Eclipse. How to connect debugger: in the DDMS perspective on the Devices view select your application and press button with "green bug":
I'll post it as an answer:
You should generate them all with one signature - otherwise it wont work. only uninstall and fresh install will work with different signatures. http://developer.android.com/guide/publishing/app-signing.html also taken from there:
Eclipse Users
If you are developing in Eclipse/ADT (and have set up Keytool and Jarsigner as described above in Basic Setup for Signing), signing in debug mode is enabled by default. When you run or debug your application, ADT signs the .apk with the debug certificate, runs zipalign on the package, then installs it on the selected emulator or connected device. No specific action on your part is needed, provided ADT has access to Keytool.