[flutter_tool] Log an Android X related failure to analytics (#33782)

This commit is contained in:
Zachary Anderson 2019-06-03 13:16:44 -07:00 committed by GitHub
parent 6619ab8fea
commit 590dbbd924
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,6 +20,8 @@ import '../cache.dart';
import '../flutter_manifest.dart';
import '../globals.dart';
import '../project.dart';
import '../runner/flutter_command.dart';
import '../usage.dart';
import 'android_sdk.dart';
import 'android_studio.dart';
@ -468,6 +470,11 @@ Future<void> _buildGradleProjectV2(
printError('The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.');
printError('See https://goo.gl/CP92wY for more information on the problem and how to fix it.');
printError('*******************************************************************************************');
String commandName = '';
if (FlutterCommand.current != null) {
commandName = '-${FlutterCommand.current.name}';
}
flutterUsage.sendEvent('build$commandName', 'android-x-failure');
}
throwToolExit('Gradle task $assembleTask failed with exit code $exitCode', exitCode: exitCode);
}