Download file problems width Android 11, API 29 - download

since two years I have an application width an option to download files from the webserver (href tag width php downlad and readfile() function).
Everything was working fine until Android 11. Now when you select to download a file, nothing happens.
I already has permission on Manifest fil, requestLegacyExternalStorage to true.... see example:
<uses-permission android:maxSdkVersion="28" android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:ignore="ScopedStorage"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.RECORD_VIDEO"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-feature android:name="android.hardware.location.gps" android:required="true"/>
<application android:hardwareAccelerated="true" android:icon="#mipmap/ic_launcher" android:label="#string/app_name" android:networkSecurityConfig="#xml/network_security_config" android:requestLegacyExternalStorage="true" android:supportsRtl="true" android:usesCleartextTraffic="true">
The funny thing is that if I install the application directly with the debug option (Android Studio) or if I upload it to Google Play in internal test mode (internal trial), it works perfectly, but if I publish it (production) on Google Play it stops working.
Anybody run into this same problem?
I have change the manifest file, the way to upload files, and every time is the same. in debug mode o internal trial you can download the files but when you publish the app you can not.

remove android:maxSdkVersion="28" from this manifest permission.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:ignore="ScopedStorage"/>
this will let you to save the files in your storage.

Related

IncompatibleClassChangeError on Android using Xamarin

I wan't to compile my project on Android and I got this following error :
Java.Lang.IncompatibleClassChangeError: 'No static method getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)Landroid/graphics/Typeface; in class Landroid/support/v4/content/res/ResourcesCompat; or its super classes (declaration of 'android.support.v4.content.res.ResourcesCompat' appears in /data/app/Digibois.LogiStock--0DmxMZxf8_3l0NMh1wijQ==/base.apk)'
There is my manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.3.4.0" package="Digibois.LogiStock" android:installLocation="auto">
<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="27" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<application android:label="LogiStock" android:icon="#drawable/icon"></application>
</manifest>
Im using an emulator with Android 6.0 API 23. I also tried with Android 8.1 API 27.
I tried to search a lot of solution but I found anything about it.
Thank's for your help !
Having a check with whether installing Xamarin.Android.Support.v4 NugetPackage :
In addition , to be sure the environment is no problem with Setting up the Android SDK for Xamarin.Android.

Can not get current location Xamarin.Forms

I am using GeoLocator in my Xamarin forms application also implemented Permissions Plugin. But on android locator.GetPositionAsync(TimeSpan.FromSeconds(10)); It shows exception A geolocation error occurred: Unauthorized
Manifest.xml
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="27" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.SEND_SMS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
AssemblyInfo.cs
[assembly: UsesPermission(Android.Manifest.Permission.AccessCoarseLocation)]
[assembly: UsesPermission(Android.Manifest.Permission.AccessFineLocation)]
[assembly: UsesFeature("android.hardware.location", Required = false)]
[assembly: UsesFeature("android.hardware.location.gps", Required = false)]
[assembly: UsesFeature("android.hardware.location.network", Required = false)]
Info.plist
<key>NSLocationWhenInUseUsageDescription</key>
<string>Location access is required to serve you better</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Location access is required to serve you better</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Location access is required to serve you better</string>
I was actually trying to solve the same problem today and may have found a solution.
First of all, make sure you install both Permissions and Location plugin into all your projects (including the .NET Standard shared project and platform projects).
Also, I was using the latest beta version, but that seemed to be causing issues and threw the Unauthorized exception even though a direct check resulted in Granted. After installing the stable version (4.5.0.6), it started working as expected.

phonegap build for kitkat

I have made a phonegap app which works on all other devices except my tablet which runs KitKat(the app installs but displays a blank white screen instead of the content). I checked to see if this was an issue with it being a tablet but it seems to be the android version as the exact same app build works on another tablet running android lollipop...
This is the code in my config file, is there something else I need to add or something I should remove so that it will run correctly on the KitKat tablet?
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.phonegap.helloworld"
version="1.0.0"
xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
xmlns:android = "http://schemas.android.com/apk/res/android">
<config-file platform="android" parent="/manifest" mode="merge">
<supports-screens
android:xlargeScreens="true"
android:largeScreens="true"
android:smallScreens="true"
android:requiresSmallestWidthDp="600"
/>
<uses-sdk android:minSdkVersion="19"
android:targetSdkVersion="19"/>
</config-file>
<name>My App</name>
<description>
Tablet App.
</description>
<content src="index.html"/>
<preference name="target-device" value="universal" />
<preference name="android-minSdkVersion" value="19" />
<preference name="android-targetSdkVersion" value="19"/>
<preference name="orientation" value="landscape" />
<access origin="*"/>
</widget>
I am not using an plugins, and am using build.phonegap to build my app.
Thanks in advance
I managed to get the google chrome remote device debugger working and it was an error in my code: I had used let instead of var and KitKat does not recognize let.
I changed all my let declarations to var and now it works perfectly.

Xamarin Android installs 3 times the same app on VS Emulator

Every time I debug, it installs 3 apps. I don't have idea why.
Image of emulator
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto">
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application android:theme="#style/Theme.Trunk"></application>
</manifest>
As pointed out in the comments. You have probably copied the [Activity] attribute from somewhere and included MainLauncher = true in two other Activities.
Remove MainLauncher = true from those Activities and it should only show one launcher.

AdMob - You must have AdActivity declared in AndroidManifest.xml with configChanges

I am trying to get admob to work in my Xamarin Android application but I get the following message when trying to display an add:
"You must have AdActivity declared in AndroidManifest.xml with configChanges"
I ave added the Xamarin google play service to my application.
I am set the java heap size to 1G and build with API level 14
I have googled the error message and most answerspoint to the manifest file that needs to include two entries. I have added the entries but still have the problem.
Any idea what I am doing wrong? Here is my Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:installLocation="auto" android:versionName="1.0">
<uses-sdk />
<application android:label="Aftermath">
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
Thanks

Resources