Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/firebase_auth/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.13.1

* Add dependency on `androidx.annotation:annotation:1.0.0`.

## 0.13.0

* **Breaking change**: Replace `FirebaseUserMetadata.creationTimestamp` and
Expand Down
3 changes: 2 additions & 1 deletion packages/firebase_auth/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ android {
disable 'InvalidPackage'
}
dependencies {
api 'com.google.firebase:firebase-auth:17.0.0'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'com.google.firebase:firebase-common:16.1.0'
api 'com.google.firebase:firebase-auth:17.0.0'
api 'com.google.code.gson:gson:2.8.5'
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/firebase_auth/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Flutter plugin for Firebase Auth, enabling Android and iOS
like Google, Facebook and Twitter.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_auth
version: 0.13.0
version: 0.13.1

flutter:
plugin:
Expand Down
4 changes: 4 additions & 0 deletions packages/firebase_in_app_messaging/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.0.1+2

* Remove dependency `androidx.annotation:annotation:1.0.0`.

## 0.0.1+1

* Update google-services Android gradle plugin to 4.3.0 in documentation and examples.
Expand Down
1 change: 0 additions & 1 deletion packages/firebase_in_app_messaging/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,5 @@ android {
}
dependencies {
api 'com.google.firebase:firebase-inappmessaging-display:18.0.1'
implementation 'androidx.annotation:annotation:1.0.0'
}
}
2 changes: 1 addition & 1 deletion packages/firebase_in_app_messaging/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: firebase_in_app_messaging
description: Flutter plugin for Firebase In-App Messaging.
version: 0.0.1+1
version: 0.0.1+2
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_in_app_messaging

Expand Down
4 changes: 4 additions & 0 deletions packages/image_picker/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.0+19

* Add dependency on `androidx.annotation:annotation:1.0.0`.

## 0.6.0+18

* Fix video play in example and update video_player plugin dependency.
Expand Down
8 changes: 4 additions & 4 deletions packages/image_picker/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ android {
lintOptions {
disable 'InvalidPackage'
}
}

dependencies {
api 'androidx.legacy:legacy-support-v4:1.0.0'
dependencies {
api 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.annotation:annotation:1.0.0'
}
}
2 changes: 1 addition & 1 deletion packages/image_picker/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors:
- Rhodes Davis Jr. <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/image_picker

version: 0.6.0+18
version: 0.6.0+19

flutter:
plugin:
Expand Down
4 changes: 4 additions & 0 deletions packages/in_app_purchase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.0+8

* Add dependency on `androidx.annotation:annotation:1.0.0`.

## 0.2.0+7

* Make Gradle version compatible with the Android Gradle plugin version.
Expand Down
1 change: 1 addition & 0 deletions packages/in_app_purchase/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ android {
}

dependencies {
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'com.android.billingclient:billing:1.2'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.17.0'
Expand Down
2 changes: 1 addition & 1 deletion packages/in_app_purchase/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: in_app_purchase
description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play.
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase
version: 0.2.0+7
version: 0.2.0+8

dependencies:
async: ^2.0.8
Expand Down
4 changes: 4 additions & 0 deletions packages/webview_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.10+5

* Add dependency on `androidx.annotation:annotation:1.0.0`.

## 0.3.10+4

* Add keyboard text to README.
Expand Down
1 change: 1 addition & 0 deletions packages/webview_flutter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ android {
}

dependencies {
implementation 'androidx.annotation:annotation:1.0.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether it's better to just remove the 2 usages of the annotations, at least until we fix Jettifier, to prevent apps that didn't migrate to androidx from blowing up when using this plugin. However I'm not sure I understand the condition for when gradle blows up? I just tried to depend on this plugin from an app that wasn't migrated to androidx and it seems to work.

@blasten do you happen to know when Gradle blows up? would it reduce build failure for some apps if we don't include this dependency?

Copy link
Author

@blasten blasten Jul 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether it's better to just remove the 2 usages of the annotation.

For all 1P plugins?

do you happen to know when Gradle blows up?

Yeah. The issue occurs when a plugin relies on any api transitive dependency listed here and then one of these cases happen:

Case 1

\--- App
    \--- Plugin A
         \--- Maven Dependency B
              +--- com.android.support:support-annotations:1.0.0

Plugin A imports android.support.annotation.NonNull, expecting that Maven Dependency B will always contain that api dependency.

A developer decides to migrate App to AndroidX, which means Android's auto migration tool "Jetifier" will translate android.support.annotation.NonNull into androidx.annotation.NonNull. The built is broken. Building the plugins as AAR fixes this problem.

Case 2

Similar to case 1, but in this case we update a plugin to use an AndroidX dependency e.g. androidx.annotation.NonNull, but it still relies on "Dependency B", which provides android.support.annotation.NonNull instead. This works today because the example app that each plugin has also uses AndroidX, which then enables Jetifier auto translation. However, if the App developer isn't using AndroidX, then the build fails indicating that androidx.annotation.NonNull is undefined.

Case 3

Similar to case 1, but in this case "Dependency B" upgrades to "AndroidX" and doesn't bump the major version. Now, the plugin is broken.

Solution

Relying on api/compile transitive dependencies is "dangerous" IMO. This seems to be a common pattern in Android development though. In the meanwhile, building the plugins as AAR fixes these issues because Jetifier can operate at the plugin level and translate all references.

implementation 'androidx.webkit:webkit:1.0.0'
}
}
2 changes: 1 addition & 1 deletion packages/webview_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: webview_flutter
description: A Flutter plugin that provides a WebView widget on Android and iOS.
version: 0.3.10+4
version: 0.3.10+5
author: Flutter Team <[email protected]>
homepage: https://github.com/flutter/plugins/tree/master/packages/webview_flutter

Expand Down