Revert "Reland "Exit on deprecated v1 embedding when trying to run or build (#92901)" (#93386)" (#93518)

This reverts commit eabb7cbc34.

It broke multiple tests.
This commit is contained in:
Yegor
2021-11-11 16:45:40 -08:00
committed by GitHub
parent d77bc51856
commit 24b9346c9b
31 changed files with 64 additions and 278 deletions

View File

@@ -8,7 +8,7 @@ found in the LICENSE file. -->
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:name="${applicationName}"
android:name="io.flutter.app.FlutterApplication"
android:label="flavors">
<activity
android:name=".MainActivity"
@@ -21,10 +21,5 @@ found in the LICENSE file. -->
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>

View File

@@ -6,19 +6,21 @@ package com.yourcompany.flavors;
import android.os.Bundle;
import io.flutter.embedding.android.FlutterActivity;
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 {
@Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), "flavor")
.setMethodCallHandler(
(call, result) -> {
result.success(BuildConfig.FLAVOR);
}
);
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);
}
});
}
}