Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.79 KB

README.md

File metadata and controls

51 lines (36 loc) · 1.79 KB

Flutter with Android AAR File

This project demonstrates how to use Flutter to build Android project within an AAR file.

References

Configure Android AAR File

Auto configuration with Android Studio

  1. Import android folder to Android Studio.
  2. Click File > New > New Module and choose Import .JAR/.AAR Package.
  3. Press F4 to open Project Structure, and then add the dependent module.

Manual configuration

  1. 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:

    flutter aar

  2. Edit android/settings.gradle:

    include ':app', ':DynamsoftBarcodeReader'
    
  3. 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')
    }
    

Build the project

Import the project to Intellij IDEA and then select an Android device to run. flutter app with Android AAR

Blog

Flutter Programming with Android AAR File