Flutter build ios error Expected identifier RunnerVersionNumber on Runner_vers.c - xcode

When I run flutter build ios I'm facing the above error:
error generated.
/Users/user926689/Library/Developer/Xcode/DerivedData/Runner-emyehpjhqbfhbsc
xayqxsyftfyix/Build/Intermediates.noindex/Runner.build/Release-iphoneos/Runn
er.build/DerivedSources/Runner_vers.c:5:72: error: expected identifier
const double RunnerVersionNumber attribute ((used)) = (double)29 .;
flutter doctor is just fine. Last time I had no problem to build my app for ios.
What is RunnerVersionNumber? Does anyone know how to fix that?

Problem solved.
Mistakenly I have added a white space right after the build number on Runner -> General -> Identity -> build.

Related

What is causing this problem in flutter? Class AMSupportURLConnectionDelegate?

Launching lib/main.dart on iPhone 12 Pro Max in debug mode...
lib/main.dart:1
Xcode build done. 8.9s
Failed to build iOS app
Error output from Xcode build:
objc[19485]: Class AMSupportURLConnectionDelegate is implemented in both ?? (0x20ffb8188) and ?? (0x13047c2b8). One of the two will be used. Which one is undefined.
objc[19485]: Class AMSupportURLSession is implemented in both ?? (0x20ffb81d8) and ?? (0x13047c308). One of the two will be used. Which one is undefined.
** BUILD FAILED **
Xcode's output:
error: the following command failed with exit code 0 but produced no further output
CompileC /Users/RuideWang/Library/Developer/Xcode/DerivedData/Runner-fxrieyfdpcpzjtcjlryrysiwwmvu/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/geolocator.build/Objects-normal/x86_64/GeolocatorPlugin.o /Users/RuideWang/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-7.0.3/ios/Classes/GeolocatorPlugin.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
/Users/RuideWang/Desktop/Programmieren/rift-1/ios/Runner/AppDelegate.swift:28:1: error: expected '}' in class
^
/Users/RuideWang/Desktop/Programmieren/rift-1/ios/Runner/AppDelegate.swift:6:45: note: to match this opening '{'
#objc class AppDelegate: FlutterAppDelegate {
^
/Users/RuideWang/Desktop/Programmieren/rift-1/ios/Runner/AppDelegate.swift:5:1: error: 'UIApplicationMain' attribute can only apply to one class in a module
#UIApplicationMain
^
/Users/RuideWang/Desktop/Programmieren/rift-1/ios/Runner/AppDelegate.swift:17:1: error: 'UIApplicationMain' attribute can only apply to one class in a module
#UIApplicationMain
^
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
note: Removed stale file '/Users/RuideWang/Library/Developer/Xcode/DerivedData/Runner-fxrieyfdpcpzjtcjlryrysiwwmvu/Build/Products/Debug-iphonesimulator/geolocator/geolocator.framework'
note: Removed stale file '/Users/RuideWang/Library/Developer/Xcode/DerivedData/Runner-fxrieyfdpcpzjtcjlryrysiwwmvu/Build/Products/Debug-iphonesimulator/google_maps_flutter/google_maps_flutter.framework'
note: Removed stale file '/Users/RuideWang/Library/Developer/Xcode/DerivedData/Runner-fxrieyfdpcpzjtcjlryrysiwwmvu/Build/Products/Debug-iphonesimulator/hexcolor/hexcolor.framework'
Could not build the application for the simulator.
Error launching application on iPhone 12 Pro Max.
Exited (sigterm)

Automatic appended .xctrunner in my XCUITest bundle id while running on device

After updating to Xcode 11.3, my all test cases stopped working because of the unnecessary text .xctrunner appended with bundle id.
Example- If I am giving bundle id as abc.com then it's showing abc.com.xctrunner at run time.
XCode 11 changed the format for building xcuitest. To run UI test on device create AppId and Profiles for "$YOUR_TEST_BUNDLE_ID.xctrunner".
Set bundle Id for test target without xctrunner like "$YOUR_TEST_BUNDLE_ID"
Here is my Fastlane match config for iOS and Catalyst.
PRODUCT_BUNDLE_IDENTIFIER = com.test
PROVISIONING_PROFILE_SPECIFIER[sdk=*] = match Development com.test.xctrunner
PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*] = match Development com.test.xctrunner catalyst
One Annoying Xcode issues is, Signing & Capabilities for UITest target shows status error. Because profiles don't match but no build error and UI test works just fine. Status error is bit hidden but love to resolve it.

Xcode 11 Beta 5 - Loading a plug-in failed

Opening a SwiftUI "Hello World" unaltered project in Xcode 11 beta 5 running on Catalina beta 4 produces a "Loading a plug-in failed" dialog warning.
Has anyone else experienced this or know how to solve it? I deleted Xcode, redownloaded it, reinstalled it and I'm still getting the same error.
No idea how to fix other than deleting the offending module, but that can't be right.
Error details:
Details
Loading a plug-in failed.
Domain: DVTPlugInErrorDomain
Code: 2
Failure Reason: The plug-in “com.apple.dt.UVKit” at path “/Applications/Xcode-beta.app/Contents/PlugIns/UVKit.framework” could not be loaded. The plug-in or one of its prerequisite plug-ins may be missing or damaged.
Recovery Suggestion: The plug-in or one of its prerequisite plug-ins may be missing or damaged and may need to be reinstalled.
User Info: {
DVTPlugInDYLDErrorMessageErrorKey = "dlopen(/Applications/Xcode-beta.app/Contents/PlugIns/UVKit.framework/UVKit, 0): Symbol not found: _$s2IDs12IdentifiablePTl\n Referenced from: /Applications/Xcode-beta.app/Contents/PlugIns/UVKit.framework/UVKit\n Expected in: /usr/lib/swift/libswiftCore.dylib\n in /Applications/Xcode-beta.app/Contents/PlugIns/UVKit.framework/UVKit";
DVTPlugInExecutablePathErrorKey = "/Applications/Xcode-beta.app/Contents/PlugIns/UVKit.framework/UVKit";
DVTPlugInIdentifierErrorKey = "com.apple.dt.UVKit";
NSFilePath = "/Applications/Xcode-beta.app/Contents/PlugIns/UVKit.framework";
}
--
The bundle “UVKit” couldn’t be loaded.
Domain: NSCocoaErrorDomain
Code: 3588
Failure Reason: The bundle couldn’t be loaded.
Recovery Suggestion: Try reinstalling the bundle.
User Info: {
NSBundlePath = "/Applications/Xcode-beta.app/Contents/PlugIns/UVKit.framework";
NSDebugDescription = "dlopen(/Applications/Xcode-beta.app/Contents/PlugIns/UVKit.framework/UVKit, 265): Symbol not found: _$s2IDs12IdentifiablePTl\n Referenced from: /Applications/Xcode-beta.app/Contents/PlugIns/UVKit.framework/UVKit\n Expected in: /usr/lib/swift/libswiftCore.dylib\n in /Applications/Xcode-beta.app/Contents/PlugIns/UVKit.framework/UVKit";
NSFilePath = "/Applications/Xcode-beta.app/Contents/PlugIns/UVKit.framework/UVKit";
}
--
I was able to get my SwiftUI project running on Catalina beta 4 with Xcode beta 5. I too got the warning mentioned by OP.
And as mentioned in comments, the only negative impact I've seen is being unable to use the preview canvas. Other than that, everything else in my project is running well. Just using the simulator more ;)
Problem is gone on Catalina build 19A558d when installing Xcode 11 GM Seed (build 11A419c, released September 10, 2019)
this will get rid of the error message but will not bring canvas back.
based on:
https://forums.developer.apple.com/thread/120614
Please go to: /Applications/Xcode-beta.app/Contents/PlugIns/UVKit.framework and delete all the shortcut files in all folders of UVKit.framework (Be sure DONOT delete orginal files).

Receiving a build error related to storyboard

I downloaded some Xcode projects from the Stanford University website.
But when I run them, I get the following two errors:
:-1: Build input file cannot be found: '/Users/myUserName/Documents/Stanford IOS/Lectures Swift Code/EmojiArt L13/EmojiArt/Supporting Files/Base.lproj/LaunchScreen.storyboard':-1: Build input file cannot be found: '/Users/myUserName/Documents/Stanford IOS/Lectures Swift Code/EmojiArt L13/EmojiArt/Supporting Files/Base.lproj/LaunchScreen.storyboard'
:-1: Build input file cannot be found: '/Users/myUserName/Documents/Stanford IOS/Lectures Swift Code/EmojiArt L13/EmojiArt/Supporting Files/Base.lproj/LaunchScreen.storyboard'
Here is the link to the project:
EmojiArtL12:
https://drive.google.com/drive/folders/1reg6-ZhLPIubmNO6aMDoTni-G728H0b0
I tried looking for answers on this board but couldn't find any.
Go to the 2 links in the error message, you will find the 2 files LaunchScreen.storyboard.xml -> change their file name to LaunchScreen.storyboard then it should build correctly. Hope this helps.

Provisioning profile not being accepted?

I'm trying to create a IPA from my cordova-ionic project using visual studio 2015. I can run the project on an iOS simulator using remotebuild.
I have followed the steps here and created a provisioning profile (using my free Apple ID). I am in a tricky situation and the iOS device that I would like to run the project on is in a different country.
I'm creating the provisioning profile on my friend's mac with the iOS device attached. I am then logging into an El Capitan VM on my machine and using the provisioning profile generated on my friend's mac to attempt to create an IPA. I am following what is outlined here and running the project on visual studio using debug and remote device or local device.
I get the following error:
Error: Remote build error from the build server Build failed with error Error code 65 for command:
xcodebuild with args: -xcconfig,/Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/cordova/build-debug.xcconfig,-project,BookYourTutor.xcodeproj,ARCHS=armv7 arm64,-target,BookYourTutor,-configuration,Debug,-sdk,iphoneos,build,VALID_ARCHS=armv7 arm64,CONFIGURATION_BUILD_DIR=/Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/build/sharedpch - 1 BookYourTutor 1
Looking at the output from build, towards the end, i see:
Libtool /Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/build/device/libCordova.a normal armv7
cd /Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/CordovaLib
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Users/noyolk/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Users/noyolk/Downloads/Xcode-beta.app/Contents/Developer/usr/bin:/Users/noyolk/.taco_home/node_modules/taco-remote-lib/2.2.1/node_modules/taco-remote-lib/node_modules/ios-sim/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Users/noyolk/Downloads/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only armv7 -syslibroot /Users/noyolk/Downloads/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS10.0.sdk -L/Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/build/device -filelist /Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/CordovaLib/build/CordovaLib.build/Debug-iphoneos/CordovaLib.build/Objects-normal/armv7/Cordova.LinkFileList -o /Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/build/device/libCordova.a
=== BUILD TARGET BookYourTutor OF PROJECT BookYourTutor WITH CONFIGURATION Debug ===
Check dependencies
Signing for "BookYourTutor" requires a development team. Select a development team in the project editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.0'
** BUILD FAILED **
The following build commands failed:
Check dependencies
(1 failure)
Failed to build app for buildNumber 708: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/cordova/build-debug.xcconfig,-project,BookYourTutor.xcodeproj,ARCHS=armv7 arm64,-target,BookYourTutor,-configuration,Debug,-sdk,iphoneos,build,VALID_ARCHS=armv7 arm64,CONFIGURATION_BUILD_DIR=/Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/build/sharedpch
MSBUILD : cordova-build error : Error: Remote build error from the build server Build failed with error Error code 65 for command: xcodebuild with args: -xcconfig,/Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/cordova/build-debug.xcconfig,-project,BookYourTutor.xcodeproj,ARCHS=armv7 arm64,-target,BookYourTutor,-configuration,Debug,-sdk,iphoneos,build,VALID_ARCHS=armv7 arm64,CONFIGURATION_BUILD_DIR=/Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/build/sharedpch - 1
Error Remote build error from the build server Build failed with error Error code 65 for command: xcodebuild with args: -xcconfig,/Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/cordova/build-debug.xcconfig,-project,BookYourTutor.xcodeproj,ARCHS=armv7 arm64,-target,BookYourTutor,-configuration,Debug,-sdk,iphoneos,build,VALID_ARCHS=armv7 arm64,CONFIGURATION_BUILD_DIR=/Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/build/device,SHARED_PRECOMPS_DIR=/Users/noyolk/.taco_home/remote-builds/taco-remote/builds/708/cordovaApp/platforms/ios/build/sharedpch - {1}
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
With what I believe to be the most important bit being,
=== BUILD TARGET BookYourTutor OF PROJECT BookYourTutor WITH CONFIGURATION Debug ===
Check dependencies
Signing for "BookYourTutor" requires a development team. Select a development team in the project editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.0'
** BUILD FAILED **
I'm having trouble understanding what exactly this means or how I should fix it. For context, I'm using xcode 8 beta 4 on my El Capitan VM.
I've tried searching around for this 'error code 65' and the error message 'Signing for XXX requires a development team. Select a development team in the project editor.' but have not had much luck.
Any help is greatly appreciated.
Downgrading to xcode 7 from xcode 8 beta 4 seems to have resolved this issue.
There is a change due to the release of iOS 10.
Reference https://dpogue.ca/articles/cordova-xcode8.html for a workaround.
I actually had to do some trial and error. The above link helped a lot, but the issues were still with what Apple was needing for XCode 8 to accept the build request. My settings in build.json are similar to this:
"ios": {
"debug": {
"developmentTeam": "[my team id]",
"provisioningProfile: "[my provisioning profile]"
},
"release": {
"developmentTeam": "[my team id]",
"provisioningProfile: "[my provisioning profile]"
}
}
}
To get your developmentTeam, log into developer.apple.com, click on Membership, and you will see your TEAM ID. Put that in as the developmentTeam.
For the provisioningProfile, open XCode --> Preferences, click on your profile, View Details. Click on your provisioning profile, right click, and Show in Finder. Your provisioning profile is the entire file name, minus the .mobileprovision file extension. Save build.json, rebuild your project, and you should be good to go.

Resources