I make simple xamarin project.
Then add NugetPackage Zxing.Net.Mobile.Forms 2.2.9 PCL,Android,IOS projects.
I add this code in AppDelegats.cs
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
global::ZXing.Net.Mobile.Forms.iOS.Platform.Init();
NSBundle.MainBundle.InfoDictionary["CFBundleShortVersionString"];
LoadApplication(new App { OSVersion = "iOS Version " + "2.0" });
return base.FinishedLaunching(app, options);
}
Then add a Camera Permission in info.plist file like this.
<key>NSCameraUsageDescription</key>
<string>Scan using the camera.</string>
And i Test with IOS Simulator.
But It don't ask me to permit use camera.
And Zxing ScanPage showed, But it just graycolor view.
So, First I don't know why don't appear to ask permit Camera with dialog.
Second, IOS simulator Don't support camera?
Android emulator is at least able to checking work camera.
Please teach me if you know. Thank you.
Try in Visual Studio menu bar Build ➤ Rebuild Solution
Reopen Visual Studio and Run your app again
Related
We have a Xamarin.Forms app for iOS and Android that we have in the stores for some months now. We develop with VS 2017. For testing the iOS-version, we use TestFlight.
Everything worked pretty well, until mid-april when we wanted to test a new release via TestFlight:
We installed the iOS-App on our test devices via TestFlight, and now on our test devices the app closes down right after the splash screen without generating a crash report (we use HockeyApp).
The app works fine though on the iOS-simulator and when being published directly on a device (iPad) via VS.
We found out that the problem is the update of Xamarin.Forms from version 2.3.3.180 to version 2.3.4.231 or later.
We would like to use latest version of Xamarin.Forms. Does anyone have the same issue and did you find a solution?
We just found the solution for this problem:
We use a custom font for our app and changed the font of the navigation bar in the AppDelegate.FinishedLaunching method by using UINavigationBar.Appearance.SetTitleTextAttributes.
This caused the iOS version of our app to crash when distributing via TestFlight. We removed the code to change the font and now we can publish the app again.
I've developed a cross platform for iOS and android using Xamarin Forms. My app uses several screens and some tjird party dependencies such as Facebook, google maps and firebase.
Everything works good until I went to compile it in release mode. Assuming I want to support both armv7 and arm64, these are the app size:
* without linking and optimization: 103mb.
* with full optimization (link all + LLVM): 73mv.
With the optimization and without armv7 I'm getting 40mb - that's my desired result size.
To solve this issue I thought that I should enable bitcode compilation. However, even with the alpha tools, including visual studio for mac and mono v5 I'm getting "platform not supported: iOS" when enabling this feature. On the other hand, I dogged at the source code and saw that mono does allow it, and besides they allows watch and tv apps, which requires bitcode...
Does anybody knows how to enable it for iOS? I'll be huge (!) assistance for me!
Thanks!
So I couldn't find any solution and had to submit my app w/o bitcode support.
However, for everyone who may tackle this issue in the future and wish to use bitcode because of app size - I want to clarify this: Bitcode, as part of iOS 9 App Thining, is only relevant to future architecture releases, i.e. Apple will auto-slice your arm7+arm64 app when you'll upload it to the App Store, without any action from your side (besides linking your code ("Link All") and supporting both architectures).
You can check the estimated app size, but you shouldn't do it in Xamarin Studio since it shows the universal app version, and not the device-specific thinned one. To check what the size will be for device X, you should:
Create Ad-Hoc Distribution profile Apple Developer Site.
Create an archive at Xamarin Studio.
Open Xcode (if it was previously opened - close an re-open).
Open the Organizer.
Click on Export, then on "Ad Hoc".
You should see a dialog asking if you want universal ipa or device specific ipa. Universal IPA is a generic IPA containing the data for every device, so you can send it to everyone. The size of this ipa will be the size you saw in Xamarin Studio (before compression). A device-specific ipa is an ipa for specific device, after performing Thining. This is the ipa your users will download. So - select the device you wish to check.
Now you'll be able to get a device-specific ipa which matches the size for this specific device. Note that the same information will appear in iTunes Connect after you'll upload your build.
See:
So to summarize it: Currently you can't use bitcode in Xamarin apps (iOS and Forms, obviously). The option does exists in mono, but not included (it was explicitly disabled in the shipped mono runtime). However, that doesn't mean that the estimated app size that's being displayed in Xamarin Studio will be your users app size, since it varies on iOS 9+ App Thining feature, which doesn't need bitcode to be activated.
Let describe my issue:
I have developed JS app for Windows 10. It works on desktop- background audio, title, album cover- all stuff i need. In VisualStudio- when i deploy app to Mobile Emulator (10.10586)- still- background audio works even if app is gone.
If i deploy my app through Visual Studio to my Mobile Device- everything works great (when it is run/deployed from visual studio). BUT (notice that) - if i open that compile app again from my device (later, i exit visual studio or just close the solution)- backrgound audio: didnt work.
Hope i describe it well- i deploy app, which work great when compile it first time, but lately... didnt.
So, i can provide my code if someone need to check out, but i think is something with platform... and i am not sure how to fix that and how to get help with that :/
Thank you!
After research i made... there is no chance to build and complete that only with javascript. For now... after Anniversary update (2016, August) there is a chance- Microsoft employee confirms that will be possible and we can explorer that with this example they provide: https://github.com/Microsoft/Windows-universal-samples/tree/dev/Samples/BackgroundMediaPlayback ... so... will wait to see :)
I am developing an iPad application with Xamarin.iOS and MVVMcross. So I have a PCL with my View-Model and my Model, and an iOS project with the view. I use Visual Studio.
Before, I used Xamarin.iOS 6.3.6 beta version, and when I tried to launch the app on the device, an .app file was created and getting it with my Ipad, I could launch the application (impossible to launch directly from Visual Studio).
Yesterday, I uploaded Xamarin.iOS to 6.4.1. On simulator, everything's okay. When I try to launch the application on device, now the app is directly installed but the build stop and the following error appear in the debug output :
Failed to load AOT module '<my PCL>' while running in aot-only mode: doesn't match assembly.
And if I click on my app icon on the device,a black screen appear and disappear immediately.
Does someone know why this error appear?
This looks like something was cached somewhere or not updated correctly.
Here are a few ideas to try:
Delete the app from the device.
Clean & Rebuild your app.
Build & install from Xamarin Studio on your Mac.
Copy the Debug configuration to a new configuration (DebugTest for instance), and run that configuration instead.
I regularly get the same issue here.
The workaround that I use is to switch the platform in the Visual Studio build Configuration Manager to "iPhoneSimulator", run a quick debug session on that, then switch the platform back to "iPhone", and the problem disappears for a while.
Unfortunately I have no intelligent reason as to why this works. It seems to be doing a better job of the "Clean and Rebuild".
After reading a similar bug, I found that clearing the mtbs folder on the OS X host which is located at $HOME/Library/Caches/Xamarin/mtbs/ fixes this problem for me.
I have to do it so frequently I just have a PuTTY session open on my Windows box to clear the folder. I do hope that Xamarin fixes this issue soon.
Make sure Linker Behaviour is set to Don't Link
Clean, rebuild, remove old version from app.
Worked for me at least.
This happened to me after I upgraded to XCode 5/iOS7. I noticed a warning that I hadn't installed XCode Command Line Tools. After I did that I rebuilt the application and it now runs.
I just had this problem and got it to work again by opening the Apple project properties and changing the provisioning profile identity from "Distribution" to "Developer".
My workaround on Mac is to
Close Solution in XS
Quit XS. Command-Q
Reopen it and reopen solution.
After that it usually works again.
already i have built bar-code scanner app in android using phone-gap,now i want to implement same thing in ios also,i want use same java script,css files for this ios app also. Give me suggestions how to start i'm new to ios development.suggest me a library that runs on present ios mobiles like iphone 3gs,4...etc.
hi use barcode scanner plugin for IOS link