I had exactly the same issue like in that question: java.lang.SecurityException: Permission Denial: opening provider when implement content provider
I have solved it using: the answer of #CommonsWare
Where He says:
App B has identical <permission> elements as App A and both App A and App B are signed by the same signing key
But When generating the app bundles of my applications, I have forgotten to sign them with the same signing key
According to the research I have done:
It is not possible to change the singing key of an application once it is on play store.
My actual problem:
I have recently put two apps on play store which have the same <permission> element. When I install first the app A from play store, I will not be able to install the app B. When I first install the app B from play store, I will not be able to install the app A. One of my apps is not able to install when I install the other app first.
According to #commonware answer:
you would need to remove one of the two apps from the Play Store and
submit a replacement, with a new application ID, that is signed by the
same signing key as the other shipping app.
But I don't want to change the application ID of any of these two applications
Any idea about how to solve that issue?
Is there any other efficient alternative to ContentProvider to share data between two applications of the same author?
I have momentarily accepted the #Warlock answer but I am looking for a better answer.
It's possible to change singing key for app already in Play Store. But it has now major disadvantage which will be gone in few years. It will be working only on devices running Android 9 and above. So your mindSkdVersion has to be 28+. It's called key rotation and it's part of APK Signature Scheme v3. See this link.
Also I don't know other way how to 100% securely change data between two apps than trust same signing keys. Less secure way is only to depend on known applicationId (just sent Intent with "com.myapp.someaction") which attacker can of course use and sideload app or use other distribution. Bit harder way to break can be usage of Android IPC / AIDL directly.
So when I published my app on the Google Play Store, I had to change the SHA1 key on Firebase and Google Play API Console to the new one that the Google Play Console generated.
The problem now is if I want to test my app from Android Studio, I need to change the SHA1 key back to the original one. If I do that, then the current users who have already logged in my app will no longer be able to log back in.
How do I test my app when it's dependent on the Google sign in and not affect current users?
Multiple SHA1 fingerprints can be added to a single firebase project. Add your debug key (Android studio SHA1 fingerprint) to your firebase project along with your app's production key. Then download the latest Json file and add it to your project in Android studio.
Sarweshkumar C R's answer is perfect, just adding visualization for total newbies. Both keys can coexist with no problems, in the image I added 3 SHA certificate fingerprints to demonstrate and you can add by clicking 'Add fingerprint'
I wanted to update an app I already published in the playstore to add achievements and leaderboard.
I have created the game in the Developer Console and everything was fine, everything worked with the debug SHA1 I have entered in the Google API for my app.
But now I have generated a signed APK with a different SHA1 (of course), and I have changed the debug SHA1 in Google API with the SHA1 for my signed APK.
I have pushed the APK to the playstore and published the game from the Developer Console. But now that my game is available in the store, when people try to connect to the Google Play Games they get "Failed to Sign in. Please check you network connection and try again".
I already looked at this link
but I am doing everything correctly.
Is it possible that I need to wait several hours before Google API handle the new SHA1 I have entered ? I have no idea of what is going on
You may refer with this thread. Try to move the app ID and leaderboard ID from strings.xml to ids.xml in values folder. You may also try to delete all client ids then add them again for debug keystore and release keystore.
Here's an additional reference which might also help: LIBGDX game configuration with google Play game services Errors
Here are a few points that might help you.
It takes several hours before your changes on Developer Console are actually published. Test the game after a few hours.
You don't need to publish in order to test it. You can do that by adding tester accounts in your developer console.
You can't "test" Google Play Services with developer account. You will need another account for that.
Edit:
Very Important:
Make sure you added required permissions to AndroidManifest.xml in
your Android project.
Ok so for everyone having the same problem as me.
Don't forget that now Google can sign your app.
The SHA1 fingerprint i needed was in the developer console, no need to get the SHA1 fingerprint of my APK.
When releasing my first android app using the facebook sdk, what are all the steps involved to get it working? The process is confusing me, the Key Hashes in particular.
1. Take the App ID from my facebook App and put it into my AndroidManifest.xml
2. Add the platform: Android in the developers.facebook.com App-Settings
3. Copy my Package Name to the Android-form at developers.facebook.com
4. ?
EDIT:
By releasing an app to Google Play without facebook in it and then reading this:
Key hash for Android-Facebook app
I learned everything I needed to know. I will answer my own post eventually with all the steps needed, if someone else don't beat me to it.
When I switched from my debug map key to my signed map key my maps stop working. I get the following errors in logcat:
09-03 18:18:04.112: WARN/System.err(4073): IOException processing: 26
09-03 18:18:04.112: WARN/System.err(4073): java.io.IOException: Server returned: 3
09-03 18:18:04.112: WARN/System.err(4073): at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
09-03 18:18:04.112: WARN/System.err(4073): at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
09-03 18:18:04.112: WARN/System.err(4073): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
09-03 18:18:04.112: WARN/System.err(4073): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
09-03 18:18:04.112: WARN/System.err(4073): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
09-03 18:18:04.112: WARN/System.err(4073): at java.lang.Thread.run(Thread.java:1019)
I've double checked everything, permissions and library are in place. I've recreated the singed key and no luck.
Any ideas?
I had the same problem and I figured there wasn't any helpful answer around on the internet so hoping this should help everyone in the future.
When using GoogleMaps for Android, you need two keys - debug and release.
The "debug" key is kind of a misleading term. This key is also to be used when you develop the app in Eclipse. So essentially, use the debug key for development, testing, debugging.
When you're ready to launch the app to Market, set the android:debuggable="false" in the AndroidManifest.xml and use the Signed API key.
When using the signed API key, the MapView will show up ONLY when the app is installed from the Android Market. So, installing the app from Eclipse (Run As, Debug As, etc) or command line (adb install) won't show the MapView. Rest assured, once the app is in the Market - you download it and the MapView will show up.
With the signed API key, if you deploy the app from Eclise, you will get a "Server returned 3, IOProcessing Exception 26" as a warning - just ignore it.
Note: Also ensure there are no duplicate instances of the same MapView. If your app needs "x" no. of MapViews, generate "x" no. of new signed keys (one for each MapView) since GoogleMaps has a query limit for a single MapView instance.
For getting both the keys, follow the steps for Obtaining API keys for GoogleMaps on Android.
Happy Coding!
UPDATE:
The link above for obtaining api keys is now a deprecated procedure. Refer Obtaining API keys for GoogleMaps Android API v2 going forward.
Finally Its fixed.
I am using Windows machine, so I simply went to C:\Users\rohit\.android and deleted debug.keystore and default.keyset1 once this is done, I went to Eclipse and applied a clean build to my project and its done!
Signed map key is used for release app. So you will get such info. if you debug the app via USB-tethered with signed map key. Switch back to debug map key if you want to debug the app, and replace it with signed map key before you release an update or new version.
I had the same problem. In my case, what I was doing wrong was this. I was writing the keytool command like this:
keytool -list -keystore debug.keystore ...
instead of:
keytool -list -keystore ~\.android\debug.keystore ...
So I wasn't updating the Eclipse's keystore with my fingerprint.
I hope this helps someone :)
If you are using a debug key that somebody else has generated and provided to you, that is the reason for the blank map with the following exception.
java.io.IOException: Server returned: 3
You can use this link to get an API key : https://console.developers.google.com/apis/credentials
This link will take you to google credentials page, the new place to get API keys.
I just encountered exactly the same problem.
There is no user-written code that throws the Exception: it is generated in the Eclipse logcat and the result is that you do not see any of the Google map tiles. Like Jen, I regenerated the key, to no avail.
The platform is Android 3.2, the device is the Asus Transformer, the connection is WiFi.
FYI my Android 2.2 application works fine, retrieving the map on a Droid over 3G.
Here is the solution to my problem, hope it helps Jen:
In my case, if I install the release version onto the Transformer using the "Debug as" Eclipse icon, with the Transformer USB-tethered, the map is failing as described above (FYI this is a procedure I have used successfully many times with Android 2.2 and other devices).
So I tried this instead: I use the Eclipse File|Export... option to create a release APK, and then install that APK onto the Transformer using its Asus Sync application. Everything is fine. The map tiles appear.
one more thing:
After adding -v you must remember that the google API just need MD5 not SHA1.So please check what code you give to google.
I have same question but I think I found the answer!
Decide follow these step https://developers.google.com/android/maps-api-signup and receive your certificate's MD5 fingerprint
While development, if map's not showed, don't worried about this! Simple extract APK use android tools with key tool which's used in first step and use this APK file to install on your phone, you will see MapView
Anyway, while development time, maybe you don't see MapView, but it's till not problem and don't worried about this! Simple wait when finished app & build with your keystore and you will see map display correctly
For the poor souls that tried to build the map example from sdk extras: as soon as I renamed the package from com.example.mapdemo to com.mynmae.mapdemo, the map magically appeared. Yes, I lost an hour searching and trying and it silently rejected the package name.
I'm from the future! I've experienced the exact same problem. But this might be an issue for novice developers.
When you created a new google maps activity in the android studio, there's a link to get yourself an API key inside the google_maps_api.xml file. So what happens when you follow this link is that Google will create a "debugging" key for your project. Which, as Sagar Hatekar explained, is indeed, only meant for testing and dev.
To be more clear, Google identifies your project by the SHA-1 certificate fingerprint (also stated inside the comments of google_maps_api.xml)
So what I'm trying to say is that you CANNOT use the same key for several projects unlike the open/public APIs out there.
https://developers.google.com/maps/documentation/android-sdk/start
In this link, they have a small section with the topic of A slightly less fast way which might be a try to explain this phenomenon.
Therefore, if you are using the same key for a project which, the key is not meant for, try requesting a new key.