Flutter FAQ - splimter/Flutter GitHub Wiki
Flutter Error: MediaQuery.of() called with a context that does not contain a MediaQuery
You need a MaterialApp
or a WidgetsApp
arround your widget. They provide the MediaQuery.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: <...>
The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
Add multidex library to android app depedency (/android/app/build.gradle):
android {
...
defaultConfig {
...
multiDexEnabled true
}
...
}
...
dependencies {
implementation 'com.android.support:multidex:1.0.3' // use latest version
...
}
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://goo.gl/CP92wY for more information on the problem and how to fix it.
*******************************************************************************************
-
android\gradle.properties
:
android.useAndroidX=true
android.enableJetifier=true
-
android\build.gradle
:
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "26.1.0"
}
}
}
}
[SEVERE] Failed to snapshot build script .dart_tool/build/entrypoint/build.dart.
This is likely caused by a misconfigured builder definition.
Use a correct build_runner version:
dev_dependencies:
build_runner: ^1.0.0
json_serializable: ^2.0.0
When Keyboard go up it show Overflow error
Under Scaffold
Add resizeToAvoidBottomPadding: false,
.
Unhandled Exception: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized.
void main() {
WidgetsFlutterBinding.ensureInitialized();
runApp(Delta(
model: ProductDataModel(),
));
}