I have research a lot on here and google but could not find the solution. I have uploaded an app on play store and it was working fine then i developed an other application by making changes in previous app project and changed project id in build.gradle script and version code. Now if any of two application is installed in phone 2nd one always gives error code -505. Please help me, my both apps are live on playstore.
I have found my mistake and i am sharing it here as a answer if anyone else face this problem. I am using google maps in both applications and I use static package name in manifest for MAPS.RECIEVE permission and I complete forgot to change that package name. I was using following code
<permission
android:name="com.myapp.packagename.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
Correct one is
<permission
android:name="${applicationId}.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
Related
In my Flutter project, I have 2 flavors: free and full, and I use Codemagic for my CI/CD.
Only the free version comes with a Google ad banner. So I added the com.google.android.gms.permission.AD_ID permission in the manifest, then run my build on Codemagic, for the full version only.
Then I went to my Google Play console, and I got the error : This version includes the com.google.android.gms.permission.AD_ID permission, but your statement in the Play Console indicates that your app does not use the advertising ID., which is true (again, for the full version only).
So I add 2 new AndroidManifest.xml files in my project, one in free, one in full, and removed the permission from the main AndroidManifest.xml file.
Here is the content of the manifest in the android/app/src/free directory:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mistikee.mistikee.mistikee">
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
</manifest>
And here is the content of the manifest in the android/app/src/full directory:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mistikee.mistikee.mistikee">
</manifest>
Then I launched a new build on Codemagic, everything went fine, until I went to the Google Play console, and I still got the same error. I really don't understand why. It looks like there is a cache issue somewhere.
How can I fix that, without going to the console telling that I use the advertising ID (because, again, I don't use it in the full version)?
Thanks.
I am working on a android VOIP Dialer. I unable to install my current app along with old app in a device.
01-07 12:05:05.115: E/Finsky(28214): [1] PackageInstallerImpl$2.onReceive: Error -505 while installing com.current.app: INSTALL_FAILED_DUPLICATE_PERMISSION: Package com.current.app attempting to redeclare permission android.permission.CONFIGURE_SIP already owned by com.old.app
the permission in manifest.
<permission
android:name="android.permission.CONFIGURE_SIP"
android:permissionGroup="android.permission-group.COST_MONEY"
android:protectionLevel="signature" />
I have tried protectionLevel both signature and dangerous.
How can I solve this issue.
It seems you are trying to declare same permission in two applications.
In order to keep both application installed, common solution for this problem is to use a dynamic prefix for your permission, preventing conflicts with other apps (as it happens for GCM configuration too):
<permission
android:name="${applicationId}.permission.CONFIGURE_SIP"
android:permissionGroup="${applicationId}.permission-group.COST_MONEY"
android:protectionLevel="signature" />
Be careful to have applicationId value assigned in your Gradle configuration under android > defaultConfig.
When uploading an APK to the Android Developer Console, everything goes normal, but there are a certain subset of users on android 5.0 and up that are unable to install or upgrade the APK. These users see a Google Play Store error 505.
There are several different resources that tell you that the 505 error is a conflict of permission. Starting in Android Lollipop, you are no longer able to have duplicate custom permissions with the same name https://developer.android.com/about/versions/android-5.0-changes.html#custom_permissions. If you check stackoverflow for this error you'll find multiple reports of people offering this as a solution. While this can sometimes be the cause of this error there are several other reasons that this, and other conflicts can happen.
1. More than one app defines the same permission
If two completely different apps define the same permission e.g if you have a user and a manager app, and both of them have something along the lines of:
<permission
android:name="same.package.name.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
2. Same app signed by different keys
You have the same app, but signed by different keys. For example if you had a release version and a debug version, you'll hit a conflict because the system sees this as two different apps requesting the same permission.
3. Conflicting authorities
But there is an entirely different situation that can occur, which is less obvious. The 505 error can also occur with conflicting authorities. If two different apps declare the same provider, such as
<provider
android:name=".provider.YourProvider"
android:authorities="com.roqbot.client.YourProvider"
android:exported="false" />
This can also provide a conflict.
The last, and hardest conflict to spot, is one that can happen with Google Play Services 8.1 and up. If you do not define an application id in your build.gradle file like this:
defaultConfig {
applicationId "com.example.my.app"
}
it is possible that it will auto-generate a provider that can conflict with other apps. To check this, go into your your build>intermediates>manifests>full>release>AndroidManifest.xml and look for
<provider
android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"
android:authorities="com.google.android.gms.google_measurement_service"
android:exported="false" />
Here the authority name will conflict with other apps. If you add the applicationId to the default config, it will change this authority to
<provider
android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"
android:authorities="com.example.my.app.google_measurement_service"
android:exported="false" />
This is very subtle and appears to be a bug starting in google play services 8.1. The issue can be seen discussed here. https://code.google.com/p/android/issues/detail?id=189079&can=1&q=error%20505&sort=-opened&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened
The point to remember is that it may be several things, and the only thing you can verify for sure with a 505 error is that there is a conflict of some sort, and that it may or may not necessarily be a custom permission conflict.
If you are using the Facebook SDK and following the official sample code, you might also encounter the issue. In my case, I was using a same content provider name on 2 different app's manifest.
<provider
android:authorities="com.facebook.app.FacebookContentProvider123"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
I forgot to change the default name com.facebook.app.FacebookContentProvider123. Finally fixed it by adding a dynamic applicationId as provider name.
<provider
android:authorities="com.facebook.app.FacebookContentProvider.${applicationId}"
android:name="com.facebook.FacebookContentProvider"
android:exported="true" />
Name Of The Error: Error 505
Problem: This is an unusual error code which is encountered during the updation or installation of the application from Google Play store. It shows up an error message stating “Unknown error code during Application installs 505”.
Following reasons are responsible for this error.
• It is mostly seen when you try to install an outdated version of the app.
• Error 505 can be caused due to the incompatibility of the app with your Android OS version.
• It can also arise due to cache conflict or data crash of the app.
• Error 505 may also arise due to Google Account Sync Problem.
Solution:
• At first restart your Android device, because this step usually works in getting rid off of any type of error. If it didn’t work and then try these simple steps.
• Clear Cache and Data of Google Play Store, Google Service Framework and Download Manager. To do this First of all go to Settings >> then Apps >> select All >> then Google Play Store and Clear cache and Clear data. Also Clear cache and Clear data for Google Services.
I created a small Android Map project and everything went fine until I move with my workspace to another computer.
The google map is not visible and the logcat output has the following line:
07-24 16:15:24.261: E/Google Maps Android API(21868): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors)
My first thought was the missing/wrong keystore because I forgot to copy it from one computer to the other, so I took the SHA1 fingerprint from my new debug.keystore (C:\Users\Enrico.android) and created a new Api key with this fingerprint and put it to Manifest.xml.
No result.
My second action was to renew the google-play-services_lib but it changed nothing.
Here some interesting parts of my code and from the Api console:
SHA1:
C1:07:A9:8B:E0:B1:FF:49:B4:C3:C6:E8:3B:98:93:FF:8F:D6:36:2F
Api console:
API key:
AIzaSyDaDJBQyg7I8_Bd3IrKChEdcNo2E7cxU6g
Android apps:
C1:07:A9:8B:E0:B1:FF:49:B4:C3:C6:E8:3B:98:93:FF:8F:D6:36:2F;com.name.appname
Manifest.xml:
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDaDJBQyg7I8_Bd3IrKChEdcNo2E7cxU6g"/>
<uses-library android:name="com.google.android.maps" />
Please help me!!!
EDIT:
Another hint. When I first started my App on the new computer, I needed to remove my "old" version from my testphone with the hint, that the signature has changed. So in fact it can only be the wrong SHA1 fingerprint in the debug.keystore file...or?
After you have updated SHA-1 on the API Console, you may need to uninstall and install again the app.
Seems like Google Play Services is keeping "unauthorized" answer from the server in cache.
Edit:
You can try creating another API key without specifying SHA and package name. This will create a key that says "Android apps: Any app allowed". I'm a bit concerned about such possibility, because that key could be used by anyone in their apps, but for development it is not an issue.
You might have forgotten to add add the permission "MAPS_RECEIVE"
Define this permission:
<permission
android:name="com.jonasdevlieghere.alma.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
and add it to the list of necessary permissions:
<uses-permission android:name="com.jonasdevlieghere.alma.permission.MAPS_RECEIVE" />
Feel free to change the permission name to match your own application.
I've been working on an Android App that uses Google Drive API. It was originally build from the quickstart example here. The simplified sequence of API calls (with proper error handling not shown here) is:
GoogleAccountCredential cred = GoogleAccountCredential.usingOAuth2(this, DriveScopes.DRIVE_FILE);
cred.setSelectedAccountName("...");
Drive drvSvc = new Drive.Builder (AndroidHttp.newCompatibleTransport(), new GsonFactory(), cred).build();
FileList gooLst = drvSvc.files().list().setMaxResults(MAX_DOWN).setQ(_rqst).execute();
It has been working fine and I am just about to release my App. But suddenly, after Drive API update, I'm getting a warning
The method usingOAuth2(Context, String, String...) from the type
GoogleAccountCredential is deprecated
What's happening? Is there another way to obtain credentials? Is there an edited version of quickstart example available anywhere?
Thanks in advance for any clarification. sean
So, the simple answer to my own question is
replace:
GoogleAccountCredential crd =
GoogleAccountCredential.usingOAuth2(this, DriveScopes.DRIVE_FILE);
with
GoogleAccountCredential crd =
GoogleAccountCredential.usingOAuth2(this,
Arrays.asList(DriveScopes.DRIVE_FILE));
For completeness
I'm guessing you got to this exception by following the code example from Google Drive QuickStart. If so you'll might find the following things I had to modify interesting.
Google Play Services Lib (NB. See comment below!)
The documentation uses the old way of adding libraries to an Android project. This will fail when executed with the latest ADT. You will be able to compile and upload to the device/emulator but on execution you'll get a NoClassDefFoundError.
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/AccountPicker;
To fix this you should copy paste the google-play-services.jar file to the libs folder instead.
Missing meta-tag
Up to the next error. I then received an IllegalStateException with the instructions to add a meta-tag in the manifest holding the google-play-services version.
So within the application tag of the manifest add:
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version"/>
And in one of the resource files (res/values/a-file-here.xml) add the following:
<integer name="google_play_services_version">4030500</integer>
In my case the lib matched this version. If you enter the wrong version here you'll get an error showing the proper version to specify. So make sure to check output.
Permission Denied
Finally I got a prompt for oauth in the app just to find out the example app is still missing a permission. The error for reference:
java.io.FileNotFoundException: /storage/emulated/0/Pictures/IMG_20131211_110629.jpg: open failed: EACCES (Permission denied)
Next to the permissions listed within the example:
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
Also add the WRITE_EXTERNAL_STORAGE permission in your manifest:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
More resources
If you get an com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAuthIOException exception with in the root cause somewhere a description Unknown you should check the settings in the Google API console. I received this error on a package mismatch.
Another links of interest are the oauth2 documentation and the google api playground.