This project demonstrates how to use Flutter to build Android project within an AAR file.
- accessing platform and third-party services in Flutter.
- Example of embedding Flutter using FlutterView
- Import android folder to Android Studio.
- Click File > New > New Module and choose Import .JAR/.AAR Package.
- Press F4 to open Project Structure, and then add the dependent module.
-
Create a new folder android/DynamsoftBarcodeReader. Create android/DynamsoftBarcodeReader/build.gradle:
configurations.maybeCreate("default") artifacts.add("default", file('DynamsoftBarcodeReader.aar'))
Copy DynamsoftBarcodeReader.aar to this folder:
-
Edit android/settings.gradle:
include ':app', ':DynamsoftBarcodeReader'
-
Add the dependency to android\app\build.gradle:
dependencies { androidTestCompile 'com.android.support:support-annotations:22.0.0' androidTestCompile 'com.android.support.test:runner:0.5' androidTestCompile 'com.android.support.test:rules:0.5' compile project(':DynamsoftBarcodeReader') }
Import the project to Intellij IDEA and then select an Android device to run.