Let’s first thank our predecessors for planting trees:
https://juejin.im/post/5d312549f265da1b6f43aebf
https://www.jianshu.com/p/5ef065abfe07
http://www.bubuko.com/infodetail-3079263.html
Use image today_The build of the picker plug-in reported an error. In fact, I didn’t encounter many problems when writing the flutter application before. This time, there are still many problems when writing the integration of the flutter module into the native project. We should consider solving integration problems, hybrid routing stack management, cooperative development and other problems. Of course, there are still some problems on the way, such as the compatibility of android.support.xxx package and Android X in Android history, which involves the migration of the shuttle project to Android X
The error is reported as follows. The reason is that when using the Android x library, other old libraries are inadvertently used indirectly
Add gradle.properties in the. Android directory of the fluent module project, and try build
android.useAndroidX=true android.enableJetifier=true
An error is reported. The compiled and running versions are different
Modify the flutter module directory. Android/APP/build.gradle and add it in the dependencies attribute. I’m not only different from Android x.versionedsearchable, but also add it
project.configurations.all { resolutionStrategy.eachDependency { details -> if (details.requested.group == 'com.android.support' && !details.requested.name.contains('multidex') ) { details.useVersion "27.1.1" }else if(details.requested.group == "androidx.versionedparcelable") { details.useVersion "1.0.0-rc01" }else if(details.requested.group == "androidx.lifecycle") { details.useVersion "2.0.0-rc01" }else if(details.requested.group == "androidx.core") { details.useVersion "1.0.0-rc01" } } }
Error reporting
Because the things in the old package can’t be found with Android x, there is a mapping table here https://blog.csdn.net/Comestudy123/article/details/84785440
.android\Flutter\src\main\java\io\flutter\facade\FlutterFragment.java
//import android.support.annotation.NonNull; //import android.support.v4.app.Fragment; import androidx.annotation.NonNull; import androidx.fragment.app.*;
.android\Flutter\src\main\java\io\flutter\facade\Flutter.java
//import android.arch.lifecycle.Lifecycle; //import android.arch.lifecycle.LifecycleObserver; //import android.arch.lifecycle.OnLifecycleEvent; //import android.support.annotation.NonNull; import androidx.lifecycle.*; import androidx.annotation.NonNull;
Build starts, but there are still old problems. The Android directory will be deleted at any time, and you need to put the modified configuration file and code into the root directory copy and build. This will be solved later. You should be able to integrate with the fluent application project. Try it later
Similar Posts:
- Flutter: Android dependency ‘com.android.support:support-v4’ has different version …
- To solve the version compatibility problem of support library: the support package has a red underline when it is introduced
- Android WebView monitors and rewrites window.history.go (- 1) method call
- [Solved] Android Studio Conflict with dependency ‘com.android.support:support-annotations’
- [Solved] Version 28 (intended for Android Pie and below) is the last version of the legacy support library
- Flutter run Error: The getter ‘body1’ isn’t defined for the class ‘TextTheme’. – ‘TextTheme’ is from ‘package:flutter/src/material/text_theme.dart’
- Install and run Android in Androidx86 emulator – This adb server’s $ADB_VENDOR_KEYS is not set
- [Solved] Flutter – AAPT: error: resource android:attr/dialogCornerRadius not found.
- [Solved] Flutter – AAPT: error: resource android:attr/dialogCornerRadiu…
- Android Studio compilation: Program type already present: XXX solution