How to build a Flutter project with an Android Android file?

I want to use Flutter to create an Android application that depends on a third-party SDK that is completed in aar file . So far I have found the article Access to the platform and third-party services in Flutter . It seems I need to build a Flutter project with additional Java files using Android Studio . This is complicated, not what I want. Is there a way to directly load aar or * .so files into Dart code ? Something like the way JNI works .

+4
source share
1 answer

Having studied the Flutter hello service example , I successfully created a Flutter project with the aar file .

The main steps:

  • Download the Flutter source code.
  • Open flutter / examples / hello_services / android in Android Studio .
  • Click File> New> New Module and select Import .JAR / .AAR Package .
  • Press F4 to open the Project Structure , and then add the dependent module.
  • Write Java code to call the APIs defined in the aar file.
  • Import flutter / examples / hello_services into Intellij IDEA .
  • Build and run the Flutter app.

GitHub.

+3

Source: https://habr.com/ru/post/1666867/


All Articles