forked from firka/flutter
Native assets support for Android Add2app (#140802)
Support for FFI calls with @Native external functions through Native assets on Android add to app. This enables bundling native code without any build-system boilerplate code. For more info see: * https://github.com/flutter/flutter/issues/129757 ## Implementation details for Android add2app The `.so` files are bundled with the same mechanism that bundles `libapp.so`.
This commit is contained in:
@@ -78,7 +78,6 @@ Future<(Uri? nativeAssetsYaml, List<Uri> dependencies)>
|
||||
Uri? yamlParentDirectory,
|
||||
required FileSystem fileSystem,
|
||||
required int targetAndroidNdkApi,
|
||||
bool isAndroidLibrary = false,
|
||||
}) async {
|
||||
const OS targetOS = OS.android;
|
||||
final Uri buildUri_ = nativeAssetsBuildUri(projectUri, targetOS);
|
||||
@@ -115,9 +114,6 @@ Future<(Uri? nativeAssetsYaml, List<Uri> dependencies)>
|
||||
}
|
||||
ensureNoLinkModeStatic(nativeAssets);
|
||||
globals.logger.printTrace('Building native assets for $targets done.');
|
||||
if (isAndroidLibrary && nativeAssets.isNotEmpty) {
|
||||
throwToolExit('Native assets are not yet supported in Android add2app.');
|
||||
}
|
||||
final Map<Asset, Asset> assetTargetLocations =
|
||||
_assetTargetLocations(nativeAssets);
|
||||
await _copyNativeAssetsAndroid(buildUri_, assetTargetLocations, fileSystem);
|
||||
|
||||
Reference in New Issue
Block a user