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
df90bb5f
Unverified
Commit
df90bb5f
authored
Mar 31, 2020
by
Mubarak Imam
Committed by
GitHub
Mar 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issue with multiple java runtimes on macOS (#52474)
parent
c6665e43
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
+5
-6
android_sdk.dart
packages/flutter_tools/lib/src/android/android_sdk.dart
+3
-4
android_sdk_test.dart
...er_tools/test/general.shard/android/android_sdk_test.dart
+2
-2
No files found.
packages/flutter_tools/lib/src/android/android_sdk.dart
View file @
df90bb5f
...
@@ -583,14 +583,13 @@ class AndroidSdk {
...
@@ -583,14 +583,13 @@ class AndroidSdk {
if
(
platform
.
isMacOS
)
{
if
(
platform
.
isMacOS
)
{
try
{
try
{
final
String
javaHomeOutput
=
processUtils
.
runSync
(
final
String
javaHomeOutput
=
processUtils
.
runSync
(
<
String
>[
'/usr/libexec/java_home'
],
<
String
>[
'/usr/libexec/java_home'
,
'-v'
,
'1.8'
],
throwOnError:
true
,
throwOnError:
true
,
hideStdout:
true
,
hideStdout:
true
,
).
stdout
.
trim
();
).
stdout
.
trim
();
if
(
javaHomeOutput
!=
null
)
{
if
(
javaHomeOutput
!=
null
)
{
final
List
<
String
>
javaHomeOutputSplit
=
javaHomeOutput
.
split
(
'
\n
'
);
if
((
javaHomeOutput
!=
null
)
&&
(
javaHomeOutput
.
isNotEmpty
))
{
if
((
javaHomeOutputSplit
!=
null
)
&&
(
javaHomeOutputSplit
.
isNotEmpty
))
{
final
String
javaHome
=
javaHomeOutput
.
split
(
'
\n
'
).
last
.
trim
();
final
String
javaHome
=
javaHomeOutputSplit
[
0
].
trim
();
return
fileSystem
.
path
.
join
(
javaHome
,
'bin'
,
'java'
);
return
fileSystem
.
path
.
join
(
javaHome
,
'bin'
,
'java'
);
}
}
}
}
...
...
packages/flutter_tools/test/general.shard/android/android_sdk_test.dart
View file @
df90bb5f
...
@@ -98,7 +98,7 @@ void main() {
...
@@ -98,7 +98,7 @@ void main() {
.
thenReturn
(
ProcessResult
(
1
,
0
,
'26.1.1
\n
'
,
''
));
.
thenReturn
(
ProcessResult
(
1
,
0
,
'26.1.1
\n
'
,
''
));
if
(
globals
.
platform
.
isMacOS
)
{
if
(
globals
.
platform
.
isMacOS
)
{
when
(
globals
.
processManager
.
runSync
(
when
(
globals
.
processManager
.
runSync
(
<
String
>[
'/usr/libexec/java_home'
],
<
String
>[
'/usr/libexec/java_home'
,
'-v'
,
'1.8'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
)).
thenReturn
(
ProcessResult
(
0
,
0
,
''
,
''
));
)).
thenReturn
(
ProcessResult
(
0
,
0
,
''
,
''
));
...
@@ -137,7 +137,7 @@ void main() {
...
@@ -137,7 +137,7 @@ void main() {
.
thenReturn
(
ProcessResult
(
1
,
1
,
'26.1.1
\n
'
,
'Mystery error'
));
.
thenReturn
(
ProcessResult
(
1
,
1
,
'26.1.1
\n
'
,
'Mystery error'
));
if
(
globals
.
platform
.
isMacOS
)
{
if
(
globals
.
platform
.
isMacOS
)
{
when
(
globals
.
processManager
.
runSync
(
when
(
globals
.
processManager
.
runSync
(
<
String
>[
'/usr/libexec/java_home'
],
<
String
>[
'/usr/libexec/java_home'
,
'-v'
,
'1.8'
],
workingDirectory:
anyNamed
(
'workingDirectory'
),
workingDirectory:
anyNamed
(
'workingDirectory'
),
environment:
anyNamed
(
'environment'
),
environment:
anyNamed
(
'environment'
),
)).
thenReturn
(
ProcessResult
(
0
,
0
,
''
,
''
));
)).
thenReturn
(
ProcessResult
(
0
,
0
,
''
,
''
));
...
...
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