Unable to run integration test on Flutter - android

When I run the integration tests, the 'Instantiating tests...' loops forever. The app loads in the device correctly but nothing happen.
Android Studio Screenshot
I created the following failing test:
app_name/integration_test/app_test.dart
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();
group('end-to-end test', () {
testWidgets('Failing test', (WidgetTester tester) async {
expect(1, 2);
});
});
}
pubspec.yaml
...
dev_dependencies:
integration_test:
sdk: flutter
flutter_test:
sdk: flutter
...
flutter doctor --verbose
[✓] Flutter (Channel stable, 2.5.2, on macOS 11.5.2 20G95 darwin-x64, locale en-ES)
• Flutter version 2.5.2 at /Users/m_16679797/Flutter/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 3595343e20 (5 months ago), 2021-09-30 12:58:18 -0700
• Engine revision 6ac856380f
• Dart version 2.14.3
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/XXXX/Library/Android/sdk
• Platform android-32, build-tools 31.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 13.0, Build version 13A233
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
[✓] VS Code (version 1.64.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available)
• XXX, XXX’s iPhone (mobile) • 04...XXX...cc • ios
• iOS 15.2 19C56
• Chrome (web) • chrome • web-javascript • Google Chrome
• No issues found!

Related

Text isn't rendering on phones when using CanvasKit on Flutter Web

I build the Flutter Web app with canvaskit using flutter build web --web-renderer canvaskit command. However the text isn't rendering properly on some Android phones (e.g. OnePlus 5) using Chrome.
This is the expected result:
This is the actual result:
These are the logs:
[✓] Flutter (Channel stable, 3.3.9, on macOS 12.5 21G72 darwin-arm, locale en-EE)
• Flutter version 3.3.9 on channel stable at /opt/homebrew/Caskroom/flutter/2.10.4/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision b8f7f1f986 (2 weeks ago), 2022-11-23 06:43:51 +0900
• Engine revision 8f2221fbef
• Dart version 2.18.5
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at /Users/karp/Library/Android/sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14A400
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7772763)
[✓] VS Code (version 1.73.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.54.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.5 21G72 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 108.0.5359.94
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!

can't run flutter app on physical device or emulator

I've been trying to run some basic flutter code on a physical device (was working a few days ago) I am kinda new to flutter and I am left with this error message.
Invalid depfile: /mnt/2d3f0752-b6d9-49f5-94cc-f85e942a8495/home/abdullah/UIA/212/MAD/mad_assignment/.dart_tool/flutter_build/10a98dcd0759222e9209b6893a2ed34e/kernel_snapshot.d
: Error: Not found: 'dart:html'
lib/home.dart:1
import 'dart:html';
[flutter] flutter doctor -v
[✓] Flutter (Channel stable, 2.10.3, on Ubuntu 20.04.4 LTS 5.13.0-44-generic, locale en_US.UTF-8)
• Flutter version 2.10.3 at /home/fawrama/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 7e9793dee1 (3 months ago), 2022-03-02 11:23:12 -0600
• Engine revision bd539267b4
• Dart version 2.16.1
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc4)
• Android SDK at /home/fawrama/Android/Sdk
• Platform android-Tiramisu, build-tools 33.0.0-rc4
• Java binary at: /snap/android-studio/121/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Android Studio (version 2021.1)
• Android Studio at /snap/android-studio/119/android-studio
• Flutter plugin version 65.2.2
• Dart plugin version 211.7808
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
[✓] Android Studio (version 2021.2)
• Android Studio at /snap/android-studio/121/android-studio
• Flutter plugin version 67.1.2
• Dart plugin version 212.5744
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] IntelliJ IDEA Community Edition (version 2022.1)
• IntelliJ at /snap/intellij-idea-community/361
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code
• VS Code at /snap/code/current
• Flutter extension version 3.40.0
[✓] Connected device (2 available)
• SM A325F (mobile) • RR8RC0EA1SA • android-arm64 • Android 11 (API 30)
• Chrome (web) • chrome • web-javascript • Google Chrome 102.0.5005.61
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!
exit code 0
Remove dart:html from main.dart. or replace it with dart:io

Flutter builds always crashes in --profile and --release modes on Android 4.4

Under Android 4.4.4 you can only launch apps in debug mode. But not in the profile and release modes. I have logged it once and it seems to me at first glance that
libvmservice_snapshot.so
is responsible. The apps always crashes.
Here the logfile link (SO is limited to 30000 characters):
https://pastebin.com/yRZL1zwx
Interesting is line 370
I/DEBUG ( 125): 616e1000-617e8000 r-x /data/app-lib/com.example.verygoodcore.kitkat.dev-1/libvmservice_snapshot.so
Flutter Doctor (there is also the device listed that unfortunately only works on 4.4.4):
[✓] Flutter (Channel stable, 2.10.4, on macOS 12.3.1 21E258 darwin-x64, locale
en-DE)
• Flutter version 2.10.4 at /Users/user/Development/tools/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision c860cba910 (3 weeks ago), 2022-03-25 00:23:12 -0500
• Engine revision 57d3bac3dd
• Dart version 2.16.2
• DevTools version 2.9.2
[✓] Android toolchain - develop for Android devices (Android SDK version
32.1.0-rc1)
• Android SDK at /Users/user/Library/Android/sdk
• Platform android-32, build-tools 32.1.0-rc1
• Java binary at: /Applications/Android
Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
[✓] IntelliJ IDEA Community Edition (version 2022.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.66.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.38.1
[✓] Connected device (2 available)
• DL Axist (mobile) • Pxxxxxxx • android-arm • Android 4.4.4 (API 19)
• Chrome (web) • chrome • web-javascript • Google Chrome
100.0.4896.127
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!

Facebook Automatically Logged Events of In-App Purchases not working on Android using flutter package facebook_app_events

Show app install and app active events on facebook events manager but nothing show when in-app purchases occur.
Steps To Reproduce
Complete follow https://developers.facebook.com/docs/app-events/getting-started-app-events-android
Go to https://business.facebook.com/events_manager2/list/app/.......... . Then go to Test events tab.
Flutter Doctor command result
[✓] Flutter (Channel unknown, 1.24.0-10.2.pre, on macOS 12.1 21C52 darwin-arm, locale en-PK)
• Flutter version 1.24.0-10.2.pre at /Users/mapple.pk/development/flutter
• Framework revision 022b333a08 (1 year, 1 month ago), 2020-11-18 11:35:09 -0800
• Engine revision 07c1eed46b
• Dart version 2.12.0 (build 2.12.0-29.10.beta)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/mapple.pk/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• ANDROID_HOME = /Users/mapple.pk/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 13.2.1, Build version 13C100
• CocoaPods version 1.11.2
[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
[✓] VS Code (version 1.63.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.29.0
[✓] Connected device (1 available)
• iPhone 13 (mobile) • 5098970B-881C-41AA-A2A9-DAA5EF67DAB7 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-2
(simulator)
• No issues found!

Flutter obfuscate command does not always create mapping.txt

I'm familiar with Flutter but not with Android coding.
When creating an app bundle with flutter this is what I use:
flutter build appbundle --obfuscate --split-debug-info=/Volumes/my_app/android_debug_info --verbose
The app bundle itself is fine and all working and live in Google Play store. However, what confuses me is that the mapping.txt does not always gets created in path/to/app/bundle/app/outputs/mapping directory.
Specifically after I did flutter clean then run the above command.
It will create the app bundle but without the mapping. But sometimes it does. But I don't know when does that happen. The documentation actually does not help.
What am I missing here?
My flutter doctor -v:
[✓] Flutter (Channel stable, 2.0.2, on macOS 11.2.2 20D80 darwin-x64, locale en-US)
• Flutter version 2.0.2 at /Users/ME/development/flutter
• Framework revision 8962f6dc68 (8 days ago), 2021-03-11 13:22:20 -0800
• Engine revision 5d8bf811b3
• Dart version 2.12.1
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Volumes/ZK/Applications/Android/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Volumes/ZK/Applications/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.4, Build version 12D4e
• CocoaPods version 1.10.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.54.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.20.0
[✓] Connected device (1 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 89.0.4389.90
• No issues found!

Categories

Resources