Android: Unable to launch the contact application in Android Lollipop version - contacts

Recently updated my Device to latest Android Lollipop version. When I try to launch the contact app from my other application, it fails to do so and crashes.
Here is the code that worked for me pre Android L version:
Intent intent = getIntent().setComponent( null ).setPackage("com.android.contacts" );
startActivity( intent );
All the required permissions are assigned to app in the manifest and I am able to launch the contact app in KitKat and below.
Later I checked with the below code and it launched the contact app:
Intent intent = getIntent().setComponent( null ).setPackage("com.google.android.contacts" );
startActivity( intent );
Any idea if the package name is changed to something else in Android L?

Related

MissingPluginException(No implementation found in flutter using geolocator

i am using geolocator in flutter project to get current location but this error come on it.
i added all dependencies in both ios and android files still get this error i dont know why
flutter channel stable, 2.12,
here is my code:
Position position = await Geolocato.getCurrentPosition( desiredAccuracy: LocationAccuracy.high);
here is my error coming which i tested android 10, 8 also, but answer same
Unhandled Exception: MissingPluginException(No implementation found for method getCurrentPosition on channel flutter.baseflow.com/geolocator)
i am using geolocator plugin here is plugin link :https://pub.dev/packages/geolocator
Maybe someone will need my solution. This happens because GeolocatorPlatform.instance is not initialized. Call _registerPlatformInstance() where you need.
import 'package:geolocator_android/geolocator_android.dart';
import 'package:geolocator_apple/geolocator_apple.dart';
void _registerPlatformInstance() {
if (Platform.isAndroid) {
GeolocatorAndroid.registerWith();
} else if (Platform.isIOS) {
GeolocatorApple.registerWith();
}
}
Running flutter clean and flutter pub get fixed the issue for me. I uninstalled the application, cleared the cache of my device and rebuilt the app. This time there was a popup asking to give location permission to the app.
I gave the access and got the current position of the device (latitude and longitude).
Also make sure you upgrade flutter to 3.0.0 by running flutter upgrade
If you just installed the package (geolocator), just restart the app or even better the phone.
Stop running the app completely and restart the app.
make sure that the app is killed before restart
click stop button, refer below,
Upgrade your flutter
Run on terminal flutter upgrade
or flutter upgrade —-force
Then =>flutter pub outdated
Then =>flutter pub upgrade
After that =>flutter pub upgrade —-major-versions
Finally go to
yourProjectName/android/app/build.gradle
Change:
android {
compileSdkVersion ##
…
…
}
To:
android {
compileSdkVersion 33
…
…
}

Flutter local_auth issues on android certain devices

I'm currently having issues with local_auth on certain devices: LG-G6 (Android 7.0) and Samsung Galaxy J7 Pro (Both running on android 7), and i believe there's more android devices having this issue.
Authentication always fails on the authenticateWithBiometrics function:
//Always failes here:
var localAuth = LocalAuthentication(); bool didAuthenticate =
await localAuth.authenticateWithBiometrics(
localizedReason: 'Please authenticate.');
But again, it's only failing on the above mentioned devices.
I checked on 3 project that are currently using local auth and they also failing, even the developers of those projects where not aware.
Is this a known issue?
Inside the Android project, on styles.xml
i replaced:
<style name="LaunchTheme" parent="#android:style/Theme.Black.NoTitleBar">
With:
<style name="LaunchTheme" parent="Theme.AppCompat.Light.NoActionBar">
After debugging the app with the devices that had issues i realised that it was throwing a platform exception and complaining about the Theme.AppCompat that is missing.
Hope this helps anyone who faces the same issue

How to resolve the error code "2010010 " while running HMS Audio Kit Application?

When I am running HMS Audio Kit application getting an error code 2010010. How to solve the issue?
Is it by any chance this code:
ERROR_MODULE_NOT_PRESET_HSF : 2010010 : HMS Core (APK) is not supported by the operating system of the device.
as found here ?
Then, as per documentation, the solution is: Use a Huawei device that meets the requirements and try again.
If you check the requirements on this page:
Device brand: Huawei,
Device type: Android phone and tablet running Android 6.0 (EMUI 4.0) or later
HMS Core (APK) Version: 5.0.0.300 or later

How I can check android version of device? (ionic 2,3)

for android 4.2.2, ionic app shows white screen.
I want to know if the device had this version of android, app would show a message and would notify that this version of android is not supported.
is it possible?
I founded this solution:
let platformVersion = platform.versions();
if (platformVersion.android) {
let androidV = platformVersion.android.num;
console.log(androidV);
if (androidV < 4.4) {
let alert = this.alertCtrl.create({
message: 'Please update android ...'
});
alert.present();
// or push a single page for this error:
//this.nav.setRoot(ErrorPage);
}
}
for show this message in android device with version older than 4.4 we must be install this:
cordova plugin add cordova-plugin-crosswalk-webview
for more information visit this link:
https://crosswalk-project.org/documentation/cordova.html

Admob 3.1.0 showing errors in Unity 5.4.1f1

I have Unity 5.4.1f1
I have the admob Unity sdk version 3.1.0
I setup an admob account, and then followed these steps
When I do a build for Android I get the following errors
When I play I get the following messages
Heres the full version of one of those errors
WARNING: No compatible versions of com.android.support:support-v4 required by (com.android.support:appcompat-v7:23.1.0+, com.google.android.gms:play-services-basement:9.6.1), will try using the latest version 24.0.0
UnityEngine.Debug:Log(Object)
Google.JarResolver.PlayServicesSupport:Log(String, Boolean)
Google.JarResolver.PlayServicesSupport:ResolveDependencies(Boolean)
GooglePlayServices.ResolverVer1_1:DoResolutionNoAndroidPackageChecks(PlayServicesSupport, String, OverwriteConfirmation)
GooglePlayServices.<DoResolution>c__AnonStorey1:<>m__0()
GooglePlayServices.ResolverVer1_1:DoResolution(PlayServicesSupport, String, OverwriteConfirmation, Action)
GooglePlayServices.PlayServicesResolver:Resolve(Action)
GooglePlayServices.PlayServicesResolver:AutoResolve()
UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
Note that I already have Chartboost working.
I have so far been unable to display an admob ad in the editor or in a build with the following code.
private void RequestAdmobInterstitial()
{
#if UNITY_ANDROID
string adUnitId = "my ad unit id";
#elif UNITY_IPHONE
string adUnitId = "INSERT_IOS_INTERSTITIAL_AD_UNIT_ID_HERE";
#else
string adUnitId = "unexpected_platform";
#endif
// Initialize an InterstitialAd.
InterstitialAd interstitial = new InterstitialAd(adUnitId);
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the interstitial with the request.
interstitial.LoadAd(request);
}
In a build nothing happens, in the editor I get these messages
Are these errors why it is it working?
If so how do I fix them?
This error:
WARNING: No compatible versions of com.android.support:support-v4
The script complaining about it is the google play jar resolver. It grabs all the necessary android libraries from your Android SDK location, and it can't find the libraries it wants.
This most likely means you are missing the android support libraries in your Android SDK folder.
To fix this, open up the Android SDK manager (most likely via Android Studio) and make sure you have the support libraries up to date.
While you're at it, update google play services too, cant hurt and might save you errors down the road.