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
9e51e13e
Unverified
Commit
9e51e13e
authored
Apr 25, 2019
by
Jonah Williams
Committed by
GitHub
Apr 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add printError messages and tool exit to android device (#31400)
parent
2dc66f0a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
android_device.dart
packages/flutter_tools/lib/src/android/android_device.dart
+4
-0
application_package.dart
packages/flutter_tools/lib/src/application_package.dart
+12
-3
No files found.
packages/flutter_tools/lib/src/android/android_device.dart
View file @
9e51e13e
...
@@ -383,6 +383,10 @@ class AndroidDevice extends Device {
...
@@ -383,6 +383,10 @@ class AndroidDevice extends Device {
// activity name from the .apk.
// activity name from the .apk.
package
=
await
AndroidApk
.
fromAndroidProject
(
project
.
android
);
package
=
await
AndroidApk
.
fromAndroidProject
(
project
.
android
);
}
}
// There was a failure parsing the android project information.
if
(
package
==
null
)
{
throwToolExit
(
'Problem building Android application: see above error(s).'
);
}
printTrace
(
"Stopping app '
${package.name}
' on
$name
."
);
printTrace
(
"Stopping app '
${package.name}
' on
$name
."
);
await
stopApp
(
package
);
await
stopApp
(
package
);
...
...
packages/flutter_tools/lib/src/application_package.dart
View file @
9e51e13e
...
@@ -166,8 +166,11 @@ class AndroidApk extends ApplicationPackage {
...
@@ -166,8 +166,11 @@ class AndroidApk extends ApplicationPackage {
final
File
manifest
=
androidProject
.
appManifestFile
;
final
File
manifest
=
androidProject
.
appManifestFile
;
if
(!
manifest
.
existsSync
())
if
(!
manifest
.
existsSync
())
{
printError
(
'AndroidManifest.xml could not be found.'
);
printError
(
'Please check
${manifest.path}
for errors.'
);
return
null
;
return
null
;
}
final
String
manifestString
=
manifest
.
readAsStringSync
();
final
String
manifestString
=
manifest
.
readAsStringSync
();
xml
.
XmlDocument
document
;
xml
.
XmlDocument
document
;
...
@@ -186,8 +189,11 @@ class AndroidApk extends ApplicationPackage {
...
@@ -186,8 +189,11 @@ class AndroidApk extends ApplicationPackage {
}
}
final
Iterable
<
xml
.
XmlElement
>
manifests
=
document
.
findElements
(
'manifest'
);
final
Iterable
<
xml
.
XmlElement
>
manifests
=
document
.
findElements
(
'manifest'
);
if
(
manifests
.
isEmpty
)
if
(
manifests
.
isEmpty
)
{
printError
(
'AndroidManifest.xml has no manifest element.'
);
printError
(
'Please check
${manifest.path}
for errors.'
);
return
null
;
return
null
;
}
final
String
packageId
=
manifests
.
first
.
getAttribute
(
'package'
);
final
String
packageId
=
manifests
.
first
.
getAttribute
(
'package'
);
String
launchActivity
;
String
launchActivity
;
...
@@ -220,8 +226,11 @@ class AndroidApk extends ApplicationPackage {
...
@@ -220,8 +226,11 @@ class AndroidApk extends ApplicationPackage {
}
}
}
}
if
(
packageId
==
null
||
launchActivity
==
null
)
if
(
packageId
==
null
||
launchActivity
==
null
)
{
printError
(
'package identifier or launch activity not found.'
);
printError
(
'Please check
${manifest.path}
for errors.'
);
return
null
;
return
null
;
}
return
AndroidApk
(
return
AndroidApk
(
id:
packageId
,
id:
packageId
,
...
...
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