Revert "Migrate template to Gradle 6.7 and AGP 4.1.0 (#70808)" (#71096)

This reverts commit 8e73bab94c.
This commit is contained in:
Amir Hardon
2020-11-23 12:27:36 -08:00
committed by GitHub
parent 8737472af1
commit 7df04fdbd3
170 changed files with 742 additions and 352 deletions

View File

@@ -19,9 +19,12 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
// This test cannot use 30 due to https://github.com/flutter/flutter/issues/70897
compileSdkVersion 29
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
applicationId "com.yourcompany.flavors"
minSdkVersion 21

View File

@@ -7,6 +7,8 @@ package com.yourcompany.flavors;
import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity {
@@ -14,5 +16,11 @@ public class MainActivity extends FlutterActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
new MethodChannel(getFlutterView(), "flavor").setMethodCallHandler(new MethodChannel.MethodCallHandler() {
@Override
public void onMethodCall(MethodCall methodCall, MethodChannel.Result result) {
result.success(BuildConfig.FLAVOR);
}
});
}
}