With the help offat-aar
- Add.android\build.gradle under flutter Module:
repositories {
mavenCentral()
}
Copy the code
The classpath 'com. Making. Kezong: fat - the aar: 1.3.5'Copy the code
- Android \ flutter \build.gradle under the Flutter Module adds:
apply plugin: 'com.kezong.fat-aar' dependencies { embed "IO. Flutter: flutter_embedding_release: 1.0.0-2 f0af3715217a0c2ada72c717d4ed9178d68f6ed" embed "IO. Flutter: arm64_v8a_release: 1.0.0-2 f0af3715217a0c2ada72c717d4ed9178d68f6ed" embed "IO. Flutter: armeabi_v7a_release: 1.0.0-2 f0af3715217a0c2ada72c717d4ed9178d68f6ed"}Copy the code
Note: The latest version of flutter_embedding_release, after 1.0.0-, is in the user root directory, For example, C:\Users\ user \.gradle\caches\modules-2\files-2.1\ IO.
- perform
flutter build aar
Copy the code
flutter build aar --release --target-platform android-arm,android-arm64
Copy the code
4. Rely on the aar copy generated in build/host/outputs/repo to the native project, Success!!