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
21f1827b
Commit
21f1827b
authored
May 02, 2016
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a sensible error message when jarsigner is missing (#3665)
Fixes #3624
parent
a807b009
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
build_apk.dart
packages/flutter_tools/lib/src/commands/build_apk.dart
+22
-0
No files found.
packages/flutter_tools/lib/src/commands/build_apk.dart
View file @
21f1827b
...
...
@@ -74,6 +74,22 @@ class _ApkBuilder {
_jarsigner
=
os
.
which
(
'jarsigner'
);
}
String
checkDependencies
()
{
if
(!
_androidJar
.
existsSync
())
return
'Cannot find android.jar at
${_androidJar.path}
'
;
if
(!
_aapt
.
existsSync
())
return
'Cannot find aapt at
${_aapt.path}
'
;
if
(!
_dx
.
existsSync
())
return
'Cannot find dx at
${_dx.path}
'
;
if
(!
_zipalign
.
existsSync
())
return
'Cannot find zipalign at
${_zipalign.path}
'
;
if
(
_jarsigner
==
null
)
return
'Cannot find jarsigner in PATH.'
;
if
(!
_jarsigner
.
existsSync
())
return
'Cannot find jarsigner at
${_jarsigner.path}
'
;
return
null
;
}
void
compileClassesDex
(
File
classesDex
,
List
<
File
>
jars
)
{
List
<
String
>
packageArgs
=
<
String
>[
_dx
.
path
,
'--dex'
,
...
...
@@ -101,6 +117,7 @@ class _ApkBuilder {
}
void
sign
(
File
keystore
,
String
keystorePassword
,
String
keyAlias
,
String
keyPassword
,
File
outputApk
)
{
assert
(
_jarsigner
!=
null
);
runCheckedSync
(<
String
>[
_jarsigner
.
path
,
'-keystore'
,
keystore
.
path
,
'-storepass'
,
keystorePassword
,
...
...
@@ -301,6 +318,11 @@ int _buildApk(
try
{
_ApkBuilder
builder
=
new
_ApkBuilder
(
androidSdk
.
latestVersion
);
String
error
=
builder
.
checkDependencies
();
if
(
error
!=
null
)
{
printError
(
error
);
return
1
;
}
File
classesDex
=
new
File
(
'
${tempDir.path}
/classes.dex'
);
builder
.
compileClassesDex
(
classesDex
,
components
.
jars
);
...
...
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