I'm building a Universal app that includes SqLiteStore. I'm getting this odd error includes misspellings. SQLite doesn't let me pick AnyCPU so I'm at a conundrum. Any ideas on where to look?
error APPX3104: You cannot create an app bundle when building for platform 'x86' which is not included in the list of platforms selected for producting app bundle. Set platform to a one of following values: AnyCPU.
I believe the supported platforms list is set by the AppxBundlePlatforms property. Try something like this:
msbuild Foo.sln /p:Platform=x86;PlatformTarget=x86;Configuration=Release;AppxBundle=Always;AppxBundlePlatforms=x86
For more information see: https://stackoverflow.com/a/29353229/67824
Related
I've segregated my WinUI 3 application into different layers: Application, Infrastructure, Presentation etc.
And all the projects have targets: net6.0-windows and I want to move it to the Uno Platform.
So, I've added a new target: net6.0
And at this moment the problem arises:
Type [WinUI] component already defines a member, called InitializeComponent or some problems with binding.
Is it possible to make such type of library with targets to net6-windows and net6.0?
For the Windows app project itself, you need to use net6-windows, as that provides additional dependencies specific to Windows app projects. All other libraries (non-app projects) can then use net6.0.
Regarding the specific error message, you are getting, the reason might be the generated files have some kind of conflict - you can try deleting the obj and bin folders and rebuild.
The easiest way to make existing Windows app support Uno would probably be to create a blank Uno solution and then migrate the code there (as the solution has already the required setup for platform-specific projects prepared and you can then just add your code.
Uno also provides templates for cross-targeted libraries, so you might be able to use similar approach. The one linked is for "UWP" solution however, so to make it WinUI, you would need to switch from uap10.0.18362 to net6-windows.
I am trying to figure out how to set up different firebase environments in a flutter project.
I understand how to do this in firebase, I created two projects, one for production, one for the test. Then, in an iOS or Android project, I could use various methods to switch between these two environments using separate google-services.json or GoogleServices-Info.plist files.
In Flutter I found this description of how to separate environments, but it only explains how to differentiate between environments in the flutter code.
How can I get this environment to change what iOS and Android build at compile time? It would even be sufficient simply to allow a file copy hook at build time.
You can switch accounts using FirebaseApp.configure. You can offer your own solution or secret dev panel to switch between them.
The solutions will build flavours and plist implementations will lock you into builds when you deploy for TestFlight + they are messy.
Here's an example: (You could use Assets as well.)
// Load a named file.
let filePath = Bundle.main.path(forResource: "MyGoogleService", ofType: "plist")
guard let fileopts = FirebaseOptions(contentsOfFile: filePath!)
else { assert(false, "Couldn't load config file") }
FirebaseApp.configure(options: fileopts)
I wrote an article about how to do this for Firebase configuration as well as runtime configuration in dart code using flavors and platform channels.
https://medium.com/#matt.goodson.business/separating-build-environment-configurations-in-flutter-with-firebase-doing-it-the-right-way-c72c3ad3621f
Flutter flavors work pretty seamlessly with Android flavors. For iOS you need to create Xcode schemes for each flavor and link them to build configurations.
For dart configuration, you can use platform channels to get the flavor used during the build at runtime. This lets you configure the app without having multiple main.dart files or passing a target argument.
Salvatore Giordano has written a blog post with a detailed description of how to achieve this:
https://medium.com/#salvatoregiordanoo/flavoring-flutter-392aaa875f36
Flutter accepts a parameter --flavor=<flavor> which allows you to select different build flavors. In Android this works as expected, selecting different build flavors. IOS is a little tricker because a scheme is needed for every flavor, and the build configurations in the form of Release-<flavor> are also needed.
Once these parts are in place, they can be used, to select the firebase configuration as you would in any iOS or Android project.
The challenge is getting Dart code to also be aware of the flavor, and the blog post provides no good solution for this. It suggests the standard method of using different entry points can be used, but the correct entry point must be matched to the correct flavor manually by the person invoking the app.
Specifically to Firebase env config you can use this article and this article from CodeMagic which explains how you can set up plist files with build env variables.
If you need to have a different set of values inside your Dart code, like an option you can use this package. It allows to generate Dart class config file from console command params.
Update 12/05/2020
Since Flutter 1.17 you can actually use compile-time variables with --dart-define argument in flutter run and flutter build commands
Here is an article that describes how to specify and use them.
With the release of Flutter for Web to the stable channel, I put together instructions for targeting multiple firebase projects (e.g. dev, staging, prod) from multiple build platforms (i.e. iOS, Android, and Web).
I've got a Xamarin.Forms app and when I try to build the Android app I get the following compile time error:
Target _XamarinAndroidBuildAarRestore:
/packages/Xamarin.Build.Download.0.4.9/build/Xamarin.Build.Download.targets(120,4):
error MSB4064: The "VsInstallRoot" parameter is not supported by the "XamarinBuildAndroidAarRestore" task. Verify the parameter exists on the task, and it is a settable public instance property.
/packages/Xamarin.Build.Download.0.4.9/build/Xamarin.Build.Download.targets(114,3):
error MSB4063: The "XamarinBuildAndroidAarRestore" task could not be initialized with its input parameters.
The iOS app builds fine.
I'm using Visual Studio for Mac (version 7.4.1 build 48).
I was able to get this error to go away by deleting the packages, bin, and obj folders from my solution as referenced in this Xamarin Forum:
https://forums.xamarin.com/discussion/96703/the-user7zippath-parameter-is-not-supported
I create app with Realm database (RealmSwift)
When i try build app, there are a lot of errors , experimentally i found several libraries i should link to project for success compilation.
But i don't want to get it for final app version (size of app will very big), what to do ?
These frameworks for example:
CoreVideo.framework
CoreMedia.framework
AudioToolbox.framework
CommLibiOS.a
MediaLibiOS.a
My app doesn't use any video/audo/media features of Realm , i don't know why i need to link it.
If I try to delete for example AudioToolbox.framework from linked list , i have a lot of errors like this:
Undefined symbols for architecture x86_64:
"_AudioComponentFindNext", referenced from:
-[MPAudioUnitEngine voiceAudioUnit] in MediaLibiOS.a(MPAudioUnitEngine.o)
Why Realm needs these libraries?
p.s. sorry for my English
Realm doesn't require linking any of the libraries you've referenced. These must be referenced in your own Xcode project's configuration.
Realm Swift requires the following libraries to be linked: Realm, Foundation & libc++. Following the installation instructions in Realm's documentation should get all this set up properly: https://realm.io/docs/swift/latest/#installation
I suggest you look at some of the Realm example Xcode projects to compare and identify what you may be doing differently. https://github.com/realm/realm-cocoa/tree/master/examples
I am new in xcode.
I got recurring message error when building for testing:
*PWRequest.m
User defined issues
"ARC is required to compile Pushwoosh SDK"*
In code it shows:
#if ! __has_feature(objc_arc)
#error "ARC is required to compile Pushwoosh SDK"
#endif
I don't understand. I added a new pushwoosh sdk.
I thank you very much for your help.
You can set ARC on a file basis. Go to the BuildPhases->CompileSources. You can select sources there and pass ARC flag.
Same as here:
How can I disable ARC for a single file in a project?
but with -fobjc-arc flag
You can use XCode project that comes with the SDK. In this case you'll be linking to the output (library) that is produced by this project.
Hope it helps!
So if you want to use Pushwoosh in your app, you're going to need to turn on ARC in your project settings.
And then you'll be using ARC in your app.
Which is somewhat nicer than doing good old fashioned Manual Retain / Release memory management, yes?
If you are determined to use MRC (manual retain count), then follow the steps in this related question.