Media Capabilities property not specified - android

I run ./gradlew :app:lint task to generate a report.
One of them is Media Capabilities property not specified:
../../src/main/AndroidManifest.xml:6: The app accesses MediaStore.Video, but is missing a tag with a android.content.MEDIA_CAPABILITIES declaration
3 xmlns:tools="http://schemas.android.com/tools"
4 package="com.example.myapp">
5
6 <application
7 android:name=".App"
8 android:allowBackup="false"
9 android:icon="#mipmap/ic_launcher"
In Android 12 and higher, an app that opens media files should explicitly specify media formats that it doesn't support, so the OS can provide a transcoded file instead.
To suppress this error, use the issue id "MediaCapabilities" as explained in the Suppressing Warnings and Errors section.
How to fix it?

I am not using any media capabilities in my app, and will still get this lint issue.
I simply suppressed the error to "fix" it. Seems like a false positive with Android Lint.
<application
tools:ignore="MediaCapabilities">
</application>

We're getting the same warning and we don't have any video in our app - at least directly. I found this bug report, they state that it might be from a library you're using. Until a better solution has been made by Google I think the best would be to just ignore it (as suggested by Marius Kohmann) if you're certain you're not using video in your app.

Related

Error "com.google.android.gms.permission.AD_ID" in Google Play console, even though I removed that permission

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.

AndroidManifest.xml merger failing, cached intermediate file Visual Studio Xamarin Forms Android

Strange problem with Manifest Merger, Visual Studio Mac, Xamarin Forms (5.0.0.2125), Android project, SDK 29 to 30. Problem initiated from an extra ">" in the Properties/AndroidManifest.xml file. That generated the error below, indicating the xml structure wasn't closed; line 35, column 11 being was the last line and character of the Properties/AndroidManifest.xml.
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error AMM0000: Error: org.xml.sax.SAXParseException; lineNumber: 35; columnNumber: 11; XML document structures must start and end within the same entity. (AMM0000)
So, I edited out the extra character, and the obj/debug/AndroidManifest.xml is created and looks right, however, the build error remains the same!
Subsequent complete rewrites and edits of the Properties/AndroidManifest.xml file have only 2 outcomes
Entering an erroneous xml format will generate the appropriate errors describing the error.
Entering a correct xml format, with any combination of entries, lines and characters will generate a correct obj/debug/AndroidManifest.xml file with the the correct Properties/AndroidManifest.xml content. However, the original build errors stay, with the " line 35, column 11 being was the last line and character of the Properties/AndroidManifest.xml." error.
So, something cached, somewhere, but no clue where. Started during an aborted simulator build and has been here ever since.
Have tried quite few things including:
cleaning, rebuilding and many combinations
remove obj and bin
removing/adding declarations in the AndroidManifest.xml
using different AndroidManifest.xml files
deleting AndroidManifest.xml and running
restoring from cloud a different version of solutions
commenting out Activity declaration on MainActivity
reinstall of VS for Mac
I think it is similar to this bug
Xamarin android Manifest being replaced on build. only solution seems to be to repair visual studio
Has anyone seen this type of bug before?
Help much appreciated as have run out of ideas here.
AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="17" android:versionName="1.17" package="com.mycompany.myapp">
<uses-sdk android:minSdkVersion="29" android:targetSdkVersion="30" />
<application android:label="myapp" android:icon="#mipmap/ic_launcher" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
</manifest>
Solved here, github.com/xamarin/xamarin-android/issues/6385. Was a problem in a Nuget Firebase library AndroidManifest.xml file. Unfortunately the error reporting in VS Mac Manifest merging doesn't report which of the 140+ AndroidManifest.xml files has the problem. However, with a bit of sleuthing, there is a way to eventually work it out.

Strict Secure Cookie policy error in AdMob after updating to Android 11

After updating my app to compile with API level 30 (Android R, 11), I can't see AdMob test ads, and I'm receiving this error in the log:
Strict Secure Cookie policy does not allow setting a secure cookie for
http://googleads.g.doubleclick.net/ for apps targeting >= R. Please
either use the 'https:' scheme for this URL or omit the 'Secure'
directive in the cookie value.
I'm using the last AdMob version, and I don't have "org.apache.http.legacy" references in Gradle or manifest.
This might come from the webview cookie_manager.cc.
Also this: https://www.chromestatus.com/feature/5633521622188032
Same question here: How to resolved http and Site Behavior: Navigation error in android app?
It might be temporarily broken, unless they'd set the cookie as expected.
I'm using flutter and I'm facing the same issue while implementing banner test ads.
Just add the below in android manifest file under application:
android:usesCleartextTraffic="true"
and issue will be resolved.

Android Play Store Error -505

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.

"error 402: Current Android sdk version doesn't support initialWindow as xml tag" despite SDK 23

I have an old Adobe AIR app that is working just fine on Android, except that it comes out in portrait mode. Without changing the source, just the application descriptor, I would like to fix this. Currently I have:
<application xmlns="http://ns.adobe.com/air/application/2.6">
...
<android>
<manifestAdditions>
<![CDATA[
<manifest android:installLocation="preferExternal">
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<supports-screens android:normalScreens="true"/>
<application android:enabled="true">
...
Now, if I add this:
<initialWindow>
<aspectRatio>landscape</aspectRatio>
</initialWindow>
...within the inner <application> tag, ADT says:
application.xml: error 402: Current Android sdk version doesn't support initialWindow as xml tag
I tried changing the AIR version (yes, see AIR vs Android below) up to 3.9 with no difference.
If I put it within only the outer <application> I get this error instead:
application.xml(24): error 103: application.initialWindow is an unexpected element/attribute
So I'm guessing I have it in the right spot, but I need to add a version number.
However, after a bit of searching, I could not find documented anywhere which Android SDK version I would need to specify (using "the -platformsdk flag in the ADT command if the element was introduced after Android 2.2").
AIR vs Android
This <initialWindow> thing isn't actually an Android XML tag, but an Adobe XML tag, contrary to Adobe's documentation which says that child elements of the <manifest> tag are "Defined by the Android SDK." (Search for <initialWindow> and you'll find only Adobe AIR docs, not Android SDK docs. Which is too bad, because the latter are pretty good at telling you exactly which version an element was introduced in.)
Update 1: SDK 23.0.1 isn't new enough?
I added the -platformsdk option pointing to the Android SDK, which then complained about missing aadt.exe. Per https://stackoverflow.com/a/16831707 I copied in that from 23.0.1 under build-tools. I still get the same message. I also tried adding within the <manifest> tag <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="23" />, still the same result.
UPDATE 2: Compiled AndroidManifest.xml has lower Android SDK version!
Using aapt from the Android SDK, I found out that the AIR-made APK, despite the above line in Update 1, contains this:
E: uses-sdk (line=48)
A: android:minSdkVersion(0x0101020c)=(type 0x10)0x9
A: android:targetSdkVersion(0x01010270)=(type 0x10)0x13
Update 3: Also true with AIR SDK 19
Although with this difference:
A: android:minSdkVersion(0x0101020c)=(type 0x10)0x17
A: android:targetSdkVersion(0x01010270)=(type 0x10)0x17
Interestingly with SDK 19, the screen orientation is now also defined:
A: android:screenOrientation(0x0101001e)=(type 0x10)0x2
...but of course I want 0 (landscape), not 0x2 (user).
Maybe this could work
<android:screenOrientation="landscape">
I have not used Adobe air,this is just a suggestion
Actually, the initialWindow tag goes within the outermost application tag, as the docs say. At one point I had tried this and gotten an error, but I guess it was a coincidence with something else I was trying. I can confirm this fixes it on AIR 2.6, 3.9, and 19.

Categories

Resources