Novice development flutter problem record

1. Run flutter build apk and report an error:

D:\flutter_sdk\flutter>flutter build apk
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Do not run this command from the root of your git clone of Flutter.

Solution: Check if D:\flutter_sdk\flutter> is pointing to your own project path, and point to your own project path instead.

2. The flutter apk crashes and fails, reporting the problem of couldn't find "":

Error content:

    --------- beginning of crash
2019-07-02 17:40:36.626 7059-7059/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: comde.example.flutter_app, PID: 7059
    java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/comde.example.flutter_app-1/base.apk"],nativeLibraryDirectories=[/data/app/comde.example.flutter_app-1/lib/arm64, /data/app/comde.example.flutter_app-1/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find ""
        at java.lang.Runtime.loadLibrary0(
        at java.lang.System.loadLibrary(
        at io.flutter.view.FlutterMain.startInitialization(
        at io.flutter.view.FlutterMain.startInitialization(
        at android.os.Handler.dispatchMessage(
        at android.os.Looper.loop(
        at java.lang.reflect.Method.invoke(Native Method)


  1. Packaged separately for arm32 and arm64 (flutter provides commands to package arm32 and arm64 separately)

    • flutter build apk --target-platform=android-arm32

    • flutter build apk --target-platform=android-arm64

we useflutter build apk --target-platform=android-arm64Package the apk and install and run it on the mobile phone of the arm64cpu architecture. It works perfectly. But when we installed the apk to 32-bit, the problem reappeared, and the reason was no longer repeated. Obviously, this method cannot solve this problem. In order to adapt to arm32 and arm64, we need to package them separately, and most domestic application markets cannot upload different apks for different cpu architectures.

The solution comes from:


Question 2.

After updating flutter sdk2.0.0, use Pub get after adding dependencies in pubspec.yaml , a warning will appear:

Your Flutter application is created using an older version of the Android
embedding. It's being deprecated in favor of Android embedding v2. Follow the
steps at

Solution: Add in AndroidManifest.xml

  1. <meta-data
  2. android:name="flutterEmbedding"
  3. android:value="2" />


Question 3. 

1: [!] Your app isn't using AndroidX.

Solution: Add the following code to



Question 4. After upgrading flutter sdk to 2.0.0, running the old project reported an error

Launching lib\main.dart on Redmi Note 5A in debug mode...
/D:/flutter_sdk/flutter/.pub-cache/hosted/ Error: No named parameter with the name 'resizeToAvoidBottomPadding'.
      resizeToAvoidBottomPadding: false,
/D:/flutter_sdk/flutter/packages/flutter/lib/src/material/scaffold.dart:1451:9: Context: Found this candidate, but the arguments don't match.
  const Scaffold({undefined
/D:/flutter_sdk/flutter/.pub-cache/hosted/ Error: The method 'inheritFromWidgetOfExactType' isn't defined for the class 'BuildContext'.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('/D:/flutter_sdk/flutter/packages/flutter/lib/src/widgets/framework.dart').
Try correcting the name to the name of an existing method, or defining a method named 'inheritFromWidgetOfExactType'.

FAILURE: Build failed with an exception.

* Where:
Script 'D:\flutter_sdk\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 991

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'D:\flutter_sdk\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at

Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done                        19.7s
Exception: Gradle task assembleDebug failed with exit code 1


To troubleshoot this error by commenting out the third-party dependent library, it is found that chewie: ^0.9.7 is caused by the video playback plug-in, 

Note: When directly relying on chewie: ^0.9.7 library in pubspec.yaml, no error will be reported, only after adding import 'package:chewie/chewie.dart'; will an error be reported.

Tags: Novice development flutter problem record

flutter flutter error

Related: Novice development flutter problem record