Flutter local_auth issues on android certain devices - flutter

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

Related

W/Gralloc3(12347): mapper 3.x is not supported ----how can i solve this?

my flutter app currently running on my phone over usb .. but when I run my app it shows W/Gralloc3(12347): mapper 3.x is not supported how can I solve this problem ?
This is not the issue, you must have something wrong with your code, this is supposedly a warning and not an indication of a serious thing.
if you're on an emulator enable useHostGpu & add
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
In your Manifest File
0x00020000 = OpenGles 2.0 (API >=8)
0x00020000 = OpenGles 3.0 (API >=18)
This will force android studio to use a specific OpenGles Library.

Where is the version specified in Ionic app?

I'm using AppVersion.getVersionNumber() to get the version number of my Ionic app. But where does this number come from?
The problem is that when I run the app on a smartphone through devapp, I get a different version number depending on what OS I have…
iOS (on an iPhone 6): 1.0.2
Android (on a Samsung S10): 1.0.4
Searching around for "version" in my source code, I find this in config.xml (in the root):
<widget version="1.0.3" … >
I don't know if this is relevant, but it is the currently delivered version of the app.
I'm using Ionic 4.10.0
AppVersion cordova plugin reads the app details from the native code of the application.
So the version values that you see, are configured in the native IDE's.
Check these files in your respective platform folders..
ios/App/App.xcodeproj/project.pbxproj the key to look for in this MARKETING_VERSION
android/app/build.gradle the key to look for in this versionName

Why won't my Flutter web app debug open in the browser?

In VScode, I used to be able to go 'Run' -> 'Run without debugging' and if the 'Web server (web-javascript)' was chosen then the Flutter app would open in debug mode in Chrome. This used to open a new Chrome window for the app to be displayed in. I'm not sure what I've done but this no longer works. I now get the message below showing in the debug console. I have tried to go to the localhost link in Chrome but I just get a blank screen and no errors in the Chrome console. I've tried downloading the Dart extension in Chrome but this doesn't help.
Launching lib\main.dart on Web Server in debug mode...
Waiting for connection from Dart debug extension at http://localhost:51367
So far I have tried reinstalling VScode and Flutter, reinstalling the Dart and Flutter extensions. I've even tried to uninstall VScode and remove all the extension and settings files that get left behind (like mentioned here). I've set Flutter up as the Flutter website says every time but none of this has helped and I have no idea what has gone wrong. Could anyone help?
In case it helps, here is the Flutter doctor output:
Downloading android-arm-profile/windows-x64 tools... 1.7s
Downloading android-arm-release/windows-x64 tools... 0.8s
Downloading android-arm64-profile/windows-x64 tools... 1.2s
Downloading android-arm64-release/windows-x64 tools... 1.3s
Downloading android-x64-profile/windows-x64 tools... 2.2s
Downloading android-x64-release/windows-x64 tools... 1.0s
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 1.20.0-7.3.pre, on Microsoft Windows [Version 10.0.18362.959], locale en-GB)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 4.0)
[√] VS Code (version 1.47.3)
[√] Connected device (2 available)
• No issues found!
The problem for me was in the index.html file located in the "web" folder.
The cause for the error was my <script src="main.dart.js" type="application/javascript"></script> line. It was not at the very bottom of the body tag. Moving it to the bottom fixed the issue.
You might also need to re-check the index.html file in general. The general order inside the body tag should be as follows:
1-
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('flutter-first-frame', function () {
navigator.serviceWorker.register('flutter_service_worker.js');
});
}
</script>
2- (applies to firebase users) Firebase CDN scripts. ex:
<script src="https://www.gstatic.com/firebasejs/7.20.0/firebase-app.js"></script>
3- (Firebase users)
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "<your api key>",
authDomain: "<your auth domain>",
projectId: "<Your project id>",
messagingSenderId: "<your messaging sender id>",
appId: "<your app id>"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
</script>
4- (most importantly) Make sure this line is at the bottom of the body tag
<script src="main.dart.js" type="application/javascript"></script>
I had to rerun flutter config --enable-web after an upgrade to get it working again. Then restart vscode and run.
For me. All I had to do was to make sure that Chrome was the default browser.
if you want to run your flutter web code in a specific port or..., you will see this error.
The web-server device requires the Dart Debug Chrome extension for debugging. Consider using the Chrome or Edge devices for an improved development workflow.
Please click the Dart Debug extension button in the spawned browser window
you can easily install dart extension from dart-extention and click on it every time you run your code.
Last resort (maybe someone has a better solution). Make a new project and copy the lib across. Add anything needed in the pubspec.yaml
Simply open a new tab with the flutter app URL.
For me, I used an old project that has Android build files. I did the following
flutter config --enable-web
flutter clean
restarting vscode
It solved the problem.
I solved it after upgrading flutter to 3.0v.
flutter upgrade
Just in case anyone has facing this issue in vscode devcontainer, I had a hard time trying to figure out what was happening, I tried everything, flutter clean, forwarding port in devcontainer. It just happened that the version of flutter that i was using had the issue. I was using 3.6 and change to 3.9, everything is working right now.
I was getting a white blank screen and debug console said this
Running "flutter pub get" in flutter_application_1...
Launching lib/main.dart on Web Server in debug mode...
lib/main.dart:1
Waiting for connection from Dart debug extension at http://localhost:42207
The web-server device requires the Dart Debug Chrome extension for debugging. Consider using the Chrome or Edge devices for an improved development workflow.
Please click the Dart Debug extension button in the spawned browser window
flutter run -d web-server in cmd line worked for me though I have to press 'r' manually to reload
If running on the web check the web console. I had a js function that double declared "index".

Ionic how to set Sass variables of a platform like another

I want to set some Sass variables of a platform (for example, those related to the toolbar) and make them have the same values as another platform.
I can do that by changing the value of each variable, but is there a quicker way to do that ?
With the addition of platform specific css this can be accomplished, for example to target the bar-header class on the android platform
.platform-android .bar-header {
text-transform: uppercase;
}
Example of other options, to target specific operating systems
iOS 8 .platform-ios8 The OS on the device is running iOS 8
iOS 8.4 platform-ios8_4 The OS on the device is running iOS 8.4. This
class is applied in addition to platform-ios8
Android 4 .platform-android4 The OS on the device is running Android 4
Android 4.4 .platform-android4_4 The OS on the device is running
Android 4.4. This class is applied, in addition to platform-android4

window.open() not working in phonegap build using new cordova and crosswalk plugin?

I´m experimenting with the new support for crosswalk webview using Phonegap Build
but run into some problem using window.open()
Info about the new cordova and crosswalk support
http://phonegap.com/blog/2015/06/16/phonegap-updated-on-build/
My config.xml
<preference name='phonegap-version' value='cli-5.1.1' />
<gap:plugin name='org.crosswalk.engine' version='1.3.0' source='pgb' />
<access origin="*" />
I am trying these javascript calls:
var ref = window.open('http://apache.org'); //Loads in the webview
var ref = window.open('http://apache.org', '_blank'); //Loads in the InAppBrowser
Javascript "syntax" from here:
https://wiki.apache.org/cordova/InAppBrowser
Result:
Nothing happens at all..
(It works great when I´m building my project without the new cordova and crosswalk).
When building in Phonegap build with the new cordova/crosswalk:
PhoneGap (iOS / Android / Windows)
cli-5.1.1 (3.8.0 / 4.0.2 / 3.8.1)
When building without:
PhoneGap (iOS / Android / Windows)
3.7.0 / 3.7.0 / 3.7.0
(My test device is an Samsung Galaxy Tab 3 running 4.4.4)
#Mikael,
it appears to be true that people only read what they want to read.
I asked, do you have:
a white-list
the white-list plugin
You said, "yes, I have a white-list". Where is your plugin? Did you read that part?
This is an "official" forum post, not blog, but forum post. Please read.
Notes for upgrading to cli-5.1.1 on PGB
http://community.phonegap.com/nitobi/topics/notes-for-upgrading-to-cli-5-1-1-on-pgb
Best of Luck,
Jesse