Skip to content

Commit b61383f

Browse files
author
Michael Klimushyn
authored
Add a gradle warning to the AndroidX plugins (flutter#1138)
This warning is only printed once per plugin on build failure. flutter/flutter#27106
1 parent b16a522 commit b61383f

3 files changed

Lines changed: 19 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.3.0+3
2+
3+
* Log a more detailed warning at build time about the previous AndroidX
4+
migration.
5+
16
## 0.3.0+2
27

38
* Fix issue with calculating iOS image orientation in certain edge cases.

android/build.gradle

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
def PLUGIN = "camera";
2+
def ANDROIDX_WARNING = "flutterPluginsAndroidXWarning";
3+
gradle.buildFinished { buildResult ->
4+
if (buildResult.failure && !rootProject.ext.has(ANDROIDX_WARNING)) {
5+
println ' *********************************************************'
6+
println 'WARNING: This version of ' + PLUGIN + ' will break your Android build if it or its dependencies aren\'t compatible with AndroidX.'
7+
println ' See https://goo.gl/CP92wY for more information on the problem and how to fix it.'
8+
println ' This warning prints for all Android build failures. The real root cause of the error may be unrelated.'
9+
println ' *********************************************************'
10+
rootProject.ext.set(ANDROIDX_WARNING, true);
11+
}
12+
}
13+
114
group 'io.flutter.plugins.camera'
215
version '1.0-SNAPSHOT'
316

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: camera
22
description: A Flutter plugin for getting information about and controlling the
33
camera on Android and iOS. Supports previewing the camera feed and capturing images.
4-
version: 0.3.0+2
4+
version: 0.3.0+3
55
authors:
66
- Flutter Team <[email protected]>
77
- Luigi Agosti <[email protected]>

0 commit comments

Comments
 (0)