File tree Expand file tree Collapse file tree
packages/agent_dart/cargokit/gradle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ class CargoKitPlugin implements Plugin<Project> {
9696 private Plugin _findFlutterPlugin (Map projects ) {
9797 for (project in projects) {
9898 for (plugin in project. value. getPlugins()) {
99- if (plugin. class. name == " FlutterPlugin" ) {
99+ if (plugin. class. name == " FlutterPlugin" || plugin . class . name == " com.flutter.gradle.FlutterPlugin " ) {
100100 return plugin;
101101 }
102102 }
@@ -133,7 +133,12 @@ class CargoKitPlugin implements Plugin<Project> {
133133 def jniLibs = project. android. sourceSets. maybeCreate(buildType). jniLibs;
134134 jniLibs. srcDir(new File (cargoOutputDir))
135135
136- def platforms = plugin. getTargetPlatforms(). collect()
136+ def List<String > platforms
137+ try {
138+ platforms = com.flutter.gradle.FlutterPluginUtils . getTargetPlatforms(project). collect()
139+ } catch (Exception ignored) {
140+ platforms = plugin. getTargetPlatforms(). collect()
141+ }
137142
138143 // Same thing addFlutterDependencies does in flutter.gradle
139144 if (buildType == " debug" ) {
You can’t perform that action at this time.
0 commit comments