I have added the shortcuts.xml in res/xml and also added the
<meta-data
android:name="android.app.shortcuts"
android:resource="#xml/shortcuts" />
in the AndroidManifest.xml and also uploaded the signed bundle file in the play console internal testing.
But I'm getting the below error while creating the preview using the google assistant app actions test tool in android studio
Google Assistant plugin v2.3.0
Preview Creation Error
Status Code: 400
Message: Precondition check failed.
- Please sign in to Play Console (https://play.google.com/apps/publish) and check if you have accepted the latest Terms of Service (ToS), and the Gmail/G-Suite account has the authorization to modify the app with package name 'uninitialized.application.id'.
The part of the error message that reads
modify the app with package name 'uninitialized.application.id'
seems particularly strange. There are a few things I would make sure about:
Make sure your app/build.gradle has the correct applicationId in the defaultConfig section and that you use this Id elsewhere.
Make sure that was the version that you uploaded.
Ensure that the account that you used for the play store is the same account that you're using to for the test tool.
This issue suggests that a default applicationId may have been assigned and set in the merged manifest, and that you can just rebuild the entire project once you have it correctly set in app/build.gradle
In my project PlacePicker was working fine but today suddenly its closing immediately after launch with resultCode 2.
here is the logcat output
07-06 16:06:36.596 1023-20519/? W/Places﹕ e.a:638: gLocReplyElement
unsuccessful status: 1
07-06 16:06:36.596 1023-20519/? W/Places﹕ e.a:665: gPlaceQueryResult
unsuccessful responseCode: 26
07-06 16:06:36.596 21086-21708/? E/PlacePicker﹕
PLACES_API_QUOTA_FAILED
Any idea? what is the meaning of PLACES_API_QUOTA_FAILED error code?
Assuming you have the Place API for Android enabled and your API key is correctly configured in your manifest, this could also happen if you are missing your SHA-1 certificate fingerprint(s) in your developer console. So, make sure you have the following covered:
In the developers console make sure you have the API key generated for your android app and make sure the API key is entered in your manifest file. It should be a meta tag nested inside the application tag.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.my.awesome.app">
<application>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIza..."/>
... other stuff
</application>
</manifest>
On the same page as your API key, at the bottom, you need to enter the package name from your manifest and the certificates. While in development/debug mode you can use the certificate from the debug keystore supplied by the studio, however, for the release version you'd have to generate your own keystore.
To generate the keyhash for the debug mode:
keytool -exportcert -alias androiddebugkey -keystore C:\Users\{username}\.android\debug.keystore -list -v
Same command is used for the release version, but this time you'd need to point to your own keystore.
More info here
See here for info on the error code... It might throw a better error by now, but that used to mean something is wrong with your certificate fingerprints in the API Console.
We were having a similar problem (PlacePicker closing immediately with result code 2, except we did not have any relevant console output). We ended up fixing our issue by removing all fingerprints to get it working and then slowly adding security back:
Remove all entries under "Restrict usage to your Android apps" on the page for your api key in the credentials section of the Google API console
On the same key page, click "regenerate key" at the top (yes -- this was actually required for us #_#... you could try the old key again before doing this)
Test your app with the new key
If PlacePicker is now working, try adding security back in:
https://developers.google.com/maps/documentation/android-api/signup
Other info
Our devices were running Android API level 23 (Android 6.0)
Our app / module level build.gradle is using:
compile 'com.google.android.gms:play-services-maps:9.0.0'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
Our project level build.gradle is using:
classpath 'com.google.gms:google-services:3.0.0'
```
The Google Places API for Android enforces a default limit of 1 000 requests per 24 hour period. If your app exceeds the limit, the app will start failing.
You can find complete explanation here
https://developers.google.com/places/android/usage
I have an android app with a Google map, everything works good.
In order to publish it in Google play, I changed the package name (old package com.exmaple..) from project----- Android tools---Rename Application Package
So, I going to generate a new API key with my new package name.
I changed manifest with the new key.
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="xxxxxxxxxxxxnew keyxxxxxxxxxxxxx" />
But, it did not work. It said authentication failed.
Is there any idea? Did I miss some steps?
Thanks in advance!
If you are saying that you have generated the new key using the API Console and changed the API key in your application as well as changed the package name in those two permissions:
<permission android:name="your.application.package.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="your.application.package.permission.MAPS_RECEIVE"/>
Then try to remove your application complete from the phone, as application is usually saves the old key in the cache, and then try to re-install it.
As you have renamed your package name and Google API key is generated based on the Package name and SHA1 key to uniquely identify each application. You need to regenerate your API key and then try to apply it in your manifest file.
Please check out the documentation
To access the Google Maps servers with the Maps API, you have to add a
Maps API key to your application. The key is free, you can use it with
any of your applications that call the Maps API, and it supports an
unlimited number of users. You obtain a Maps API key from the Google
APIs Console by providing your application's signing certificate and
its package name. Add the key to your application by adding an element
to your application's AndroidManifest.xml file.
You changed your package name so google map authentication is failed. Please regenerate new key with your new package name.
Addition to the answer before.
Make sure signing API key by the release keystore instead of debug.keystore
If you checked and found that the package name is configured correctly in Google API, go over the below steps
Make sure that there is no reference in your project to the old
package name. I changed it in the manifest file but forgot to change
it in the build.gradle file
Delete the .gradle folder in your project cause gradle might have cashed the old package name
Ctrl+Shift+F to look for the old package name in the entire project.Make sure there is no trace of it
Uninstall the app on your testing device to clear any cached data
Clean project and then run it
Those steps did it for me.
I am trying to integrate a Google plus Login in my application as per the instruction provided by following link :
https://developers.google.com/+/quickstart/android#install-sdk
I am following all the instructions perfectly. And when I run the sample application on a real device provided in the android-sdk and click the signin button, it display a Toast message that An internal error occurred
What am I doing wrong?
I have this problem and even after creating 10 different client IDs with different SHA and package name, it doesn't work... until I found out that you have to fill the Consent screen.
According to GoogleDevelopers Console -
The consent screen will be shown to users whenever you request access
to their private data using your client ID.
This can happen when you haven't set the signature for the client ID in your API console project, or if you copied the wrong key value from keytool. Doing so is documented in the steps of the quick start guide on steps 7, 8, 9, and 10.
I've solved problem by removing .setScopes("PLUS_LOGIN") in the PlusClient.Builder.
I got this toast message error in my android application:
An internal error occurred
Summary:
Assuming you made a mistake configuring the negotiation between your android app and the Android API server granting you access. Most likely caused by you not adding the correct package name or correct SHA1 fingerprint. I followed these steps to blow out the wrong configuration and do it right.
Steps to fix:
Go to your google api console and login: https://code.google.com/apis/console
Click "API Access" tab.
Click the button: "Create another client ID".
Choose: "Installed Application" radio button.
Choose: "Android" radio button.
Enter the package name of the android app that is displaying the above error. You can find it defined at the top of the PlusSampleActivity.java code file. For me it is com.google.android.gms.samples.plus
Acquire your SHA1 fingerprint value:
a. Use the command keytool -list -v -keystore /home/el/.android/debug.keystore. Enter password, If you never set it, the default password is 'android'.
b. The SHA1 fingerprint is shown on screen, copy that.
Paste the above value into the "Signing certificate fingerprint (SHA1):" box.
Click the button: "Create client ID".
Run your android application again, click "Sign in".
Now you are presented with an Activity to "Sign in to Google+ SDK with Google".
In my case, the solution was to actually set an email address in the Consent Screen.
First, I was a bit reluctant to select my personal address and for an strange reason you can save the form without this piece of data with no error. After checking what others have suggested, as soon as I set my email address in that form, it started working.
I have been searching how to fix this for a day with full of research without luck finally i managed
to resolve this issue with the following approach.
Before i begin resolving this (at least how ti worked for me) i have to say that everything on the
documentation is correct and you don't have to change any lines of code or so.
It looks like more of a bug in the https://cloud.google.com/console cloud console
First ensure you got the correct SHA1 and your project's package name as described in the docs
https://developers.google.com/+/quickstart/android
Now this bug as i noticed (at least for me) was that in my cloud console, the project i have created
was long ago with the old interface and few months ago i migrated to the new GUI.Once you get the new look on cloud console you will notice that new projects have an auto generated project id
like this atlantean-ares-331 while old projects got a long integer value as project id which is not visible. So if your project was created with the old GUI and you have just created new client id for OAuth for that project you will get the Toast "An internal error occurred” while trying to sign in with google.
How to Fix
Go to your cloud console
Make a new project i would suggest a name like
oldprojectname-gplus
In APIs section enable Google+ API
Ensure that none of your projects has the same package name on
OAuth Client ID with the one you will use now otherwise you will get Error This client ID is globally unique and is already in use.(you will have to delete the old OAuth client id with the same package name you will use now).
Go to Credentials Create New Client ID for OAuth.
Installed application
Android
Enter your project's package name and your SHA1
Done
My solution to the problem was following.
I did everything others recommended and there was no typo regarding the package name and SHA1 key. I also tried removing the key and then adding it again but it didn't help.
What did help is removing the key and creating a new project (at https://code.google.com/apis/console) and then creating the Client ID (with package+sha1) again there. After that (5 secs) everything worked on my Android device.
This problem is related to the permissions from the api console.
if you are using a permission related with SCOPE_PLUS_LOGIN, in the api console you must create two keys, one for OAuth client id, and other for public api key.
In my case the problem was that I changed the package name of the app and didn't update in dev console.
For me it was that i was attempting to use my production key when installing it using my debug key. Make sure your using the right SHA1 from the right keystore.
I turned around to the Google IO 2013, and changed the initialization of PlusClient, then it works.
public static final String AUTH_SCOPES[] = {
Scopes.PLUS_LOGIN,
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/developerssite" };
mPlusClient = new PlusClient.Builder(this, this, this)
.setScopes(AUTH_SCOPES)
.build();
Thanks Thano for the solution
"Now this bug as i noticed (at least for me) was that in my cloud console, the project i have created was long ago with the old interface and few months ago i migrated to the new GUI.Once you get the new look on cloud console you will notice that new projects have an auto generated project id like this atlantean-ares-331 while old projects got a long integer value as project id which is not visible. So if your project was created with the old GUI and you have just created new client id for OAuth for that project you will get the Toast "An internal error occurred” while trying to sign in with google."
Recreating the project in the Google Console worked for me after several other attempts:
For any reason my project did not have a project ID (old console/new console?).
As Thano (above) suggested, I created a brand new project, created Client IDs, ... and then in worked. Thanks for the advice!!
Remember to use the built-in debug keystore for testing. I had everything else working correctly, but I had set my production keystore SHA1 fingerprint in the Credentials in the Developers Console, which caused it not to work.
If your facing this error when you try to run the sample application "or" copy the project which you have created in other machine which was running successfully in that and giving such pop-up error in the other machine where you are trying to run ,you can follow the below method and it will help.
If your are building the app for testing/debug purpose then,
1.Generate the new SHA1 if you copy your project and run it on other machine for the package name and path provided for keystore.
2.Change the ClientId in developers console for new generated SHA1 and run it in the new machine where you have copied the project and trying to run it.
Something often overlooked is the package name. I'd like to clarify the step 6 by Eric Leschinski above (can't comment there): the required package is not the package of an activity, rather the package of your app's manifest.
You may retrieve the correct value from the root element of AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ntk.darkmoor"
android:versionCode="1"
android:versionName="1.0" >
In this example define "com.ntk.darkmoor" while creating the Client ID
I had the same issue when I used SHA1 for debug.keystore for debuging then exported my application forgetting to generate SHA1 for keystore that I used to export my application.
Its working for me when i connect the device and install the apk from Android Studio.
But its now working for me when i generate the .apk and install it from dropbox.
I went through all the answers provided here and others as well. In my case the issue was the SHA-1 as well. The reason I was getting the incorrect SHA-1 was my keytool export cert command.
Previously I was using
C:\Users\mysuername\.android SHA 1 signature keytool -exportcert -alias androiddebugkey -keystore "keystorepath" -list -v
The problem was in the androiddebugkey variable. Here you have to give the name of the key you use for signing the application.
C:\Users\mysuername\.android SHA 1 signature keytool -exportcert -alias mykeyname -keystore "keystorepath" -list -v
Hope this helps someone!
To add to this long list of reasons my problem was that i got the debugkey from the jks file rather than the app.
Its always something small.
I'm trying to implement the MapView example which is defined in Android Hello Views example but now I'm facing this error:
Failed to find provider info for com.google.settings
Any idea why this is happening?
The MapView example doesn't set API key by default. So you must set it. Here is step by step:
Get MD5 from your system
%JAVA_HOME%\bin\keytool.exe -list -alias androiddebugkey -keystore "%userprofile%\.android\debug.keystore" -storepass android -keypass android
Get API key by pasting the generated MD5 to this page:
http://code.google.com/android/maps-api-signup.html
Paste the generated API key to {your_project_root}/res/layout/map.xml
<com.google.android.maps.MapView
android:id="#+id/myMapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="paste_generated_api_key_here"
/>
In AndroidManifest.xml, make sure that you have the folowing tag into your application tag:
<uses-library android:name="com.google.android.maps" />
and also the folowing tag into your manifest tag:
<uses-permission android:name="android.permission.INTERNET" />
Refresh your project and run
Note:
The path of keytool.exe, debug.keystore and map.xml may differ on your system.
If you publish your app, be sure to register another API key.
If you don't set API key properly, your app will fail on phone and the error message probably is "... has stopped unexpectedly. Please try again. - Force close"
More detail at http://d.android.com/guide/tutorials/views/hello-mapview.html
If you've made sure you have INTERNET permission, and have correctly generated API key, and have put it in android:apiKey, and the same error still happens, here's one more thing to check: is your application signed with the same certificate that you used for Maps API key?
Android build tools use different certificates for debug builds and for release builds. If you've generated MD5 checksum and API key for release certificate (the one that you use in "Export Android Application" wizard to generate .apk), it won't work in debug builds--and vice versa.
You can find out where your debug keystore is located in Eclipse's Preferences > Android > Build page. You can generate MD5 checksum and API key for it the same way as for your release certificate. Default password for debug keystore is "android".
Here's official docs about debug keystore
One more thing to check:
I just had this problem (or rather, my problem was that the map was not showing up). I had skimmed through the map view tutorial and pasted the "uses-permission" tag inside the application tag by mistake. It needs to be directly under the manifest tag, like this:
<?xml version="1.0" encoding="utf-8"?>
<manifest [...]>
<uses-sdk [...] />
<uses-permission android:name="android.permission.INTERNET" />
<application android:icon="#drawable/icon" android:label="#string/app_name">
<uses-library android:name="com.google.android.maps" />
[...]
</application>
</manifest>
A very simple mistake, but it took me a while to find. Hopefully this helps someone else!
Just review Hello, MapView :
Make sure you have included into AndroidManifest.xml line for permissions:
<uses-permission android:name="android.permission.INTERNET" />
Also, have you got Google Map API Key?
Put it into MapView layout definition:
<com.google.android.maps.MapView
android:id="#+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="Your Maps API Key"
/>
Other mention of error:
GGroups - MapView showing as black screen after upgrade to 1.5
I have only encountered this issue on the emulator and I have found that the only way around this error is to restart the emulator.