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
a8da7ced
Unverified
Commit
a8da7ced
authored
Apr 15, 2022
by
Chris Yang
Committed by
GitHub
Apr 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide default bundle id error when xcresult detects an error (#101993)
parent
1756ccc5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
12 deletions
+45
-12
mac.dart
packages/flutter_tools/lib/src/ios/mac.dart
+16
-10
build_ios_test.dart
...er_tools/test/commands.shard/hermetic/build_ios_test.dart
+29
-2
No files found.
packages/flutter_tools/lib/src/ios/mac.dart
View file @
a8da7ced
...
...
@@ -581,16 +581,6 @@ Future<void> diagnoseXcodeBuildFailure(XcodeBuildResult result, Usage flutterUsa
// Fallback to use stdout to detect and print issues.
_parseIssueInStdout
(
xcodeBuildExecution
,
logger
,
result
);
}
if
(
xcodeBuildExecution
!=
null
&&
xcodeBuildExecution
.
environmentType
==
EnvironmentType
.
physical
&&
(
xcodeBuildExecution
.
buildSettings
[
'PRODUCT_BUNDLE_IDENTIFIER'
]?.
contains
(
'com.example'
)
??
false
))
{
logger
.
printError
(
''
);
logger
.
printError
(
'It appears that your application still contains the default signing identifier.'
);
logger
.
printError
(
"Try replacing 'com.example' with your signing id in Xcode:"
);
logger
.
printError
(
' open ios/Runner.xcworkspace'
);
return
;
}
}
/// xcodebuild <buildaction> parameter (see man xcodebuild for details).
...
...
@@ -757,6 +747,14 @@ bool _handleIssues(XCResult? xcResult, Logger logger, XcodeBuildExecution? xcode
logger
.
printError
(
''
);
logger
.
printError
(
"Also try selecting 'Product > Build' to fix the problem."
);
}
if
(!
issueDetected
&&
_needUpdateSigningIdentifier
(
xcodeBuildExecution
))
{
issueDetected
=
true
;
logger
.
printError
(
''
);
logger
.
printError
(
'It appears that your application still contains the default signing identifier.'
);
logger
.
printError
(
"Try replacing 'com.example' with your signing id in Xcode:"
);
logger
.
printError
(
' open ios/Runner.xcworkspace'
);
}
return
issueDetected
;
}
...
...
@@ -769,6 +767,14 @@ bool _missingDevelopmentTeam(XcodeBuildExecution? xcodeBuildExecution) {
!<
String
>[
'DEVELOPMENT_TEAM'
,
'PROVISIONING_PROFILE'
].
any
(
xcodeBuildExecution
.
buildSettings
.
containsKey
);
}
// Return `true` if the signing identifier needs to be updated.
bool
_needUpdateSigningIdentifier
(
XcodeBuildExecution
?
xcodeBuildExecution
)
{
return
xcodeBuildExecution
!=
null
&&
xcodeBuildExecution
.
environmentType
==
EnvironmentType
.
physical
&&
(
xcodeBuildExecution
.
buildSettings
[
'PRODUCT_BUNDLE_IDENTIFIER'
]?.
contains
(
'com.example'
)
??
false
);
}
// Detects and handles errors from stdout.
//
// As detecting issues in stdout is not usually accurate, this should be used as a fallback when other issue detecting methods failed.
...
...
packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart
View file @
a8da7ced
...
...
@@ -480,7 +480,7 @@ void main() {
XcodeProjectInterpreter:
()
=>
FakeXcodeProjectInterpreterWithBuildSettings
(),
});
testUsingContext
(
'D
isplay xcresult issues with default bundle identifier
.'
,
()
async
{
testUsingContext
(
'D
efault bundle identifier error should be hidden if there is another xcresult issue
.'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
_createMinimalMockProjectFiles
();
...
...
@@ -492,7 +492,7 @@ void main() {
expect
(
testLogger
.
errorText
,
contains
(
"Use of undeclared identifier 'asdas'"
));
expect
(
testLogger
.
errorText
,
contains
(
'/Users/m/Projects/test_create/ios/Runner/AppDelegate.m:7:56'
));
expect
(
testLogger
.
errorText
,
contains
(
'It appears that your application still contains the default signing identifier.'
));
expect
(
testLogger
.
errorText
,
isNot
(
contains
(
'It appears that your application still contains the default signing identifier.'
)
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
list
(<
FakeCommand
>[
...
...
@@ -508,6 +508,33 @@ void main() {
XcodeProjectInterpreter:
()
=>
FakeXcodeProjectInterpreterWithBuildSettings
(
productBundleIdentifier:
'com.example'
),
});
testUsingContext
(
'Show default bundle identifier error if there are no other errors.'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
_createMinimalMockProjectFiles
();
await
expectLater
(
createTestCommandRunner
(
command
).
run
(
const
<
String
>[
'build'
,
'ios'
,
'--no-pub'
]),
throwsToolExit
(),
);
expect
(
testLogger
.
errorText
,
contains
(
'It appears that your application still contains the default signing identifier.'
));
},
overrides:
<
Type
,
Generator
>{
FileSystem:
()
=>
fileSystem
,
ProcessManager:
()
=>
FakeProcessManager
.
list
(<
FakeCommand
>[
xattrCommand
,
_setUpFakeXcodeBuildHandler
(
exitCode:
1
,
onRun:
()
{
fileSystem
.
systemTempDirectory
.
childDirectory
(
_xcBundleFilePath
).
createSync
();
}),
_setUpXCResultCommand
(
stdout:
kSampleResultJsonNoIssues
),
_setUpRsyncCommand
(),
]),
Platform:
()
=>
macosPlatform
,
EnvironmentType:
()
=>
EnvironmentType
.
physical
,
XcodeProjectInterpreter:
()
=>
FakeXcodeProjectInterpreterWithBuildSettings
(
productBundleIdentifier:
'com.example'
),
});
testUsingContext
(
'Display xcresult issues with no provisioning profile.'
,
()
async
{
final
BuildCommand
command
=
BuildCommand
();
...
...
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