Android 6.0 permissions error Toast - android

I am updating the app I am working on to work on Android 6.0.
In the beginning the app would crash, but updating the gradle file to use the newest versions of external libs (intercom and GCM services) did the trick and the app runs smoothly.
The only problem is that on startup a Toast message is displayed with the text: "Please specify next permissions in your manifest file: android.permission.WRITE_EXTERNAL_STORAGE".
The permission is of course written in the manifest file.
I am assuming this has something to do with the runtime permissions mechanism that Android 6.0 introduces (the message doesn't appear when running with older version of Android).
Another annoying little issue is that the toast message doesn't appear when running with a debugger (using Android Studio 1.4).
How can I know what is causing this Toast to appear? Has anyone else encountered this problem?
Thank you!

I have experienced this issue in my project as well, and it turns out that the toast is from ubertesters SDK, I decompiled the jar file and this is what I found.
package com.ubertesters.sdk.utility;
public class StringProvider {
public StringProvider() {
}
public static String addPermission() {
return "Please specify next permissions in your manifest file: ";
}
public static String installLatestVersion() {
return "Please, install the latest Ubertesters Hub version.";
}
public static String install() {
return "Install";
}
}
I will suggest you to exclude ubertesters SDK in your release product flavour and you won't see this toast in the release build.
Ubertesters has not updated its Android SDK for more than a year ... http://ubertesters.com/knowledge-base/android-sdk/

Ubertesters is constantly updating SDK for Android. The issue with handling permissions on Android 6.0 is successfully fixed in the next SDK version.
Please feel free to check and user our latest SDK available on the website http://ubertesters.com/knowledge-base/android-sdk/

Related

How to configure a Android Multi Module APP to work with IBM Mobile Foudation Platfom 8.0's AppAuthenticity

We had a Android app that had work fine with IBM Mobile Foudation Platform 8.0' AppAuthenticity. So we had to split the app into multiple android modules, and AppAuthenticity has not work since.
When trying to login with AppAuthenticity enabled there is no response, ie the success or error callbacks are never fired.
https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/authentication-and-security/application-authenticity/
IBM MFP Server Version: 8.0.2019022810.
IBM MFP Android SDK Version: 8.0.+
Gradle build tool : 3.1.1
Gradle 4.4
The problem happens with debug and release apks.
Log.d("TAG", "loginMobileFirst init"); // This appears in logcat
String securityCheckName = CaixaSecurityCheckChallengeHandler.SECURITY_CHECK_NAME;
WLAuthorizationManager.getInstance()
.login(securityCheckName, this.getCredencial(),
new WLLoginResponseListener() {
#Override
public void onSuccess() {
Log.d(TAG, "loginMobileFirst Success"); // This never appears in logcat
setLogged(true);
callBack.onSuccess(null);
}
#Override
public void onFailure(WLFailResponse wlFailResponse) {
Log.d(TAG, "loginMobileFirst Failure"); // This never appears in logcat
Log.d(TAG, "Erro no login: " + wlFailResponse.getErrorMsg());
callBack.onError(context.getString(R.string.api_error_sistema_indisponivel));
}
});
}
MobileFirst does not yet support app modules of Android. Please create a single apk for your app until this is supported.
Please open a request for enhancement at https://www.ibm.com/developerworks/rfe/execute?use_case=changeRequestLanding&BRAND_ID=0&PROD_ID=702&x=17&y=6
The problem was solved deleting the directory app/src/main/jniLibs. I believe that directory was included in a old version of IBM MFP (7.1)
Thank you, Folks!

App crashes on Launch when made as system application

I developed an application that uses DJI SDK. When installed as an system application it crashes on Launch because its not able to load the libraries. It works fine when installed as normal application.
Steps followed to make system application
1)Rooted the device
2)Copied the .apk file to system/app directory
3)Rebooted the device
4)App was installed as default application but crashed on Launch
After commenting out the following line related to DJI SDK and followed the same steps as above. It worked fine as system app.
Helper.install(context);
The implementation of Helper class which is in DJI SDK is as below:
public static void install(Application app) {
Object var1 = null;
try {
System.loadLibrary("DexHelper_sdk");
if (PPATH != null) {
System.load(PPATH);
}
} catch (Error var3) {
;
}
String app_dataDir = app.getApplicationInfo().dataDir;
DexInstall.install(app, new File(app_dataDir + "/.cache_sdk/sdkclasses.jar"));
}
As far as my understanding the crash is because the system is failing to load the libraries.
My gradle looks similar as in the following link:
https://github.com/dji-sdk/Mobile-SDK-Android/blob/master/Sample%20Code/app/build.gradle
this issue has been fixed since 4.6 version of Android MSDK, pls try to update to the later version, right now the 4.7.1 has been released.

Why Android SDK string No and Cancel same in resource?

Interesting bug I found while regression test of android app.
android.R.string.no is the same as android.R.string.cancel, but, exact No is android.R.string.gpsVerifNo. Why so?
UPD: android.R.string.gpsVerifNo not public or not exist in all sdk versions

Acr.Biometrics Xamarin plugin

I create Xamarin.Forms app and use Acr.Biometrics plugin. In PCL I check available finger print for device.
private async void AvailableBiometric()
{
bool available = await Biometrics.Instance.IsAvailable();
lblStatus.Text = available ? "Yes" : "No";
}
When I launch my app on Windows 10 emulator (UWP project), I get result false ("NO") and it's correct. But when I launch app on Android 6.0 (Emulator or real device with finger authorization), I get Exception "".
I find source code this plugis on GitHub. My Exception generate this plugin's code:
I don't understand what do I wrong and why for Windows app this Exception did not generate. If who know, please, help me.
I don't understand what do I wrong and why for Windows app this Exception did not generate.
I tried to only install Acr.Biometrics Package to PCL, and debugged UWP project. It also threw the exception.
If you want to use lib of Acr.Biometrics in Android and UWP platform,
please make sure you have installed Acr.Biometrics nuget package to Android and UWP project.
You can right click your solution--> Manage NuGet Package for solution-->select the Installedbutton-->left click Acr.Biometrics NuGet Package.
Check the xxx.Droid project option.And then press the install button. The installation is done later.
For Android support, you need to add the following to your AndroidManifest.xml:
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
Usage
In your shared/PCL library, simply check if the sensor is available:
protected async override void OnAppearing()
{
base.OnAppearing();
if (await Biometrics.Instance.IsAvailable())
{
var success = await Biometrics.Instance.Evaluate("Your custom message");
if (success)
{
//do some stuff
}
}
}

Getting the Android SDK directory within a gradle task

Recently the gradle plugin for android got updated (with android studio), after which the previous way of getting to the SDK directory ceased to work. The expression
${android.plugin.sdkDirectory}
which worked in an older version now returns the error
Error:(42, 0) No such property: sdkDirectory for class: com.android.build.gradle.LibraryPlugin
What would be the proper way of getting the android SDK directory being used, preferably independent of the user's configuration such as plugin and gradle version? The script needs to be shareable with several users.
Since all the previous answers depend on the environment or specific user intervention on top of normal configuration, I'll just post my technically messy fix.
if (android.hasProperty('plugin')) {
if (android.plugin.hasProperty('sdkHandler')) {
androidPath = android.plugin.sdkHandler.sdkFolder
} else {
androidPath = android.plugin.sdkDirectory
}
} else {
androidPath = android.sdkDirectory
}
Unlike all previous methods, this actually works, but it still looks hacky.
In gradle.properties set location sdkdir=/home/user/android-sdk and then in gradle you can use $sdkdir
I'm using Android gradle plugin v1.2.3 and this works fine:
${android.sdkDirectory}
You can use
$System.env.ANDROID_HOME
export ANDROID_HOME=/xxx/xxx/ in shell, then use it by System.env.ANDROID_HOME in gradle file.

Categories

Resources