Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
9e0df259
Unverified
Commit
9e0df259
authored
Nov 11, 2019
by
xster
Committed by
GitHub
Nov 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show a warning when a module uses a v1 only plugin (#44499)
parent
159a47da
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
194 additions
and
133 deletions
+194
-133
plugins.dart
packages/flutter_tools/lib/src/plugins.dart
+10
-0
project.dart
packages/flutter_tools/lib/src/project.dart
+5
-0
plugins_test.dart
packages/flutter_tools/test/general.shard/plugins_test.dart
+179
-133
No files found.
packages/flutter_tools/lib/src/plugins.dart
View file @
9e0df259
...
...
@@ -402,6 +402,16 @@ Future<void> _writeAndroidPluginRegistrant(FlutterProject project, List<Plugin>
for
(
Map
<
String
,
dynamic
>
plugin
in
androidPlugins
)
{
if
(
plugin
[
'supportsEmbeddingV1'
]
&&
!
plugin
[
'supportsEmbeddingV2'
])
{
templateContext
[
'needsShim'
]
=
true
;
if
(
project
.
isModule
)
{
printStatus
(
'The plugin `
${plugin['name']}
` is built using an older version '
"of the Android plugin API which assumes that it's running in a "
'full-Flutter environment. It may have undefined behaviors when '
'Flutter is integrated into an existing app as a module.
\n
'
'The plugin can be updated to the v2 Android Plugin APIs by '
'following https://flutter.dev/go/android-plugin-migration.'
);
}
break
;
}
}
...
...
packages/flutter_tools/lib/src/project.dart
View file @
9e0df259
...
...
@@ -645,6 +645,11 @@ class AndroidProject {
}
AndroidEmbeddingVersion
getEmbeddingVersion
()
{
if
(
isModule
)
{
// A module type's Android project is used in add-to-app scenarios and
// only supports the V2 embedding.
return
AndroidEmbeddingVersion
.
v2
;
}
if
(
appManifestFile
==
null
||
!
appManifestFile
.
existsSync
())
{
return
AndroidEmbeddingVersion
.
v1
;
}
...
...
packages/flutter_tools/test/general.shard/plugins_test.dart
View file @
9e0df259
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment