I have added Google Maps to my Android Application. When using the API key of my Old package name the map is loading properly.
I renamed the package through Refactor->Rename after this process all the package name in the files has changed, then I created a API key with the new package name.
com.shangeeth.mapstest
changed to
com.shangeeth.simlpemapapp
But the Map is not loading with new API key but properly loading with the Old API Key(Old package name API).
Din't I properly Rename the Package name or is there any particular location where I should rename to Load the Map with the new API key.
Follow these steps
-Go to Google API console
-And login with your credentials
-Click the menu expansion button go to credentials menu
-in here you got API key list that you have
-Then you can edit your package name with edit button
Thank you
If you're using Android Studio, go to build.gradle and rename your applicationId in
defaultConfig {
applicationId "com.shangeeth.simlpemapapp"
...
Also, remember to update package name in AndroidManifest.xml. Hope, this will help. Finally, uninstall your old app from your phone.
Related
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
When I uploaded it to google play, I got a com.example error, and then I typed another name instead of example and fixed all the places. I also corrected the package name in the google service json file. But it does not receive an error but when I run the application I get a "myappname" is stopped error. I have no idea what the problem is. What could it be? Where did the missing or wrong?
places where I make correction;
package names in all activity and fragments
googleservice.json file
package name in manifest
What is the problem?
You need to update in your build.gradle file like this
android {
applicationId "your.new.domain"
}
And then, Sync the project.
I inherited an android app that was initially outsourced to an external developer, fixed stuff and I am now ready to send the new update to the play store.
Then I found out that I need a specific signing key in order to update the app, which we got from the previous developer.
So I generated a signed release apk using the key I got and tried to upload. Upon uploading, I get a pop-up with an error. see screenshot for details
We asked the developer if he was sure that was the key he used, and he swears he looked everywhere and its the only key he used. Although, I do think he might have changed the password for it..., not really sure.
Significant changes I introduced to the app is changing the package in manifest and creating product flavours which each their own package name(one of them got to keep the original package name from the play store).
Some things I noticed: When I got the app, the app manifest had an out-commented package name and a new one with our company's name in it. The original one had the name of the of the outsourcing company in place of the "example" of the "com.example.appname" bit, so they must have changed the package name when they created the release apk.
I have no idea if any of this means anything because the package name is the same when I put it all in an apk... It's just that the store claims that the app was signed with a different certificate and the previous developer swears he used the same he sent to us.
Can anyone tell me if it's possible to do anything to make this work, or are we completely doomed and will have to upload a new app to the store?
Thanks for any help.
Update:
Because people are asking about packagename, let me clarify.
When I got the app, all the packagenames in the manifest was not the same as the one from Playstore... so i refactored the entire package app-wide to reflect the play-store package name... and then I introduced product flavours because we need a new app with different branding that is similar to the original one... so I ended with with a structure like this:
defaultConfig {
applicationId "PlayStorePackagName"
}
productFlavors {
brand1 {
applicationId "PlayStorePackagName" //<- for original app
}
new_brand{
applicationId "NewPlayStorePackagName" //<- for new app.
}
}
In this case, it shouldn't matter what package name is in the manifest, should it?
You cannot change the package name nor the Certificate for the App for the Playstore! If you don't have the correct certificate you cannot submit your App as an update to the existing one.
Certificate checking
However you can check the information stored in your available Keystore and compare it with the current store apk. For Example:
jarsigner -verify -verbose -certs yourapp.apk
You can get more details with the keytool. See this Thread for more information.
Package name
You can check the correct package name for your app when Browsing to your App in the play store.
Example for Google Plus: https://play.google.com/store/apps/details?id=com.google.android.apps.plus
id=com.google.android.apps.plus is the package name in this case. This cannot be changed for your App
However this package name is defined by your applicationId within your App. Your structure of your app can have different package names. See here for more information.
From the docs:
When you're ready to make changes to your APK, make sure to update your app’s Version Code as well so that existing users will receive your update.
Use the following checklist to make sure your new APK is ready to update your existing users:
The Package Name of the updated APK needs to be the same as the current version.
The Version Code needs to be greater than that current version. Learn more about versioning your applications.
The updated APK needs to be signed with the same signature as the current version.
To verify that your APK is using the same certification as the previous version, you can run the following command on both APKs and compare the results:
$ jarsigner -verify -verbose -certs my_application.apk
If the results are identical, you’re using the same key and are ready to continue. If the results are different, you will need to re-sign the APK with the correct key.
You say that:
Significant changes I introduced to the app is changing the package in manifest
So this is the source of issue. You'll need to use the same package name.
I need to deploy two application on the play store :
Eg:
com.android.myapppro and com.android.myappfree both have similar code but small changes like [Show/Hide Ads]
So while changing the package name of the application updating the Gradle file
applicationId "com.android.myapppro"
To
applicationId "com.android.myappfree"
is sufficient, or do i need to update the AndroidManifest.xml also.
Changing the AndroidManifest.xml will force me to update the R imports in all the classes.
Please Help!
Thanks in advance.
From ApplicationId versus PackageName
Therefore, we have decoupled the two usages of package name:
The final package that is used in your built .apk's manifest, and is the package your app is known as on your device and in the Google Play
store, is the "application id".
The package that is used in your source code to refer to your R class, and to resolve any relative activity/service registrations,
continues to be called the "package".
You need to change only applicaitonId and left AndroidManifest.xml as is.
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.