Could not install Xamarin.Mobile in PCL iOS Project - ios

I'm trying to install Xamarin.Mobile in a PCL iOS project by NuGet and i'm gotting this error!
Could not install package 'xamstore-xamarin.mobile 0.7.1'. You are
trying to install this package into a project that targets
'Xamarin.iOS,Version=v1.0', but the package does not contain any
assembly references or content files that are compatible with that
framework. For more information, contact the package author.
This is my AppDelegate
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register("AppDelegate")]
public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
{
//
// This method is invoked when the application has loaded and is ready to run. In this
// method you should instantiate the window, load the UI into it and then make the window
// visible.
//
// You have 17 seconds to return from this method, or iOS will terminate your application.
//
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
global::Xamarin.Forms.Forms.Init();
Xamarin.FormsMaps.Init();
LoadApplication(new App());
return base.FinishedLaunching(app, options);
}
}
My SDK version is 10.1.
Xamarin.Mobile is working fine in Android Project.
Any idea how to fix this ?

Use the Microsoft Resolution of problems.
Clean your Solution and Rebuild again.

The Xamarin.Mobile NuGet package is not compatible with a PCL, hence the error. This DLL is meant to be installed into an iOS/Android/Windows app project. There is no cross-platform API for PCL use.
You could use this with a Shared Library instead. Or, you'll need to work in each platform project.

Instead of add the package of Xamarin.Mobile with NuGet, you can try adding Xamarin.Mobile as a component.
Right click the Components folder:
Search and select Xamarin.Mobile on Xamarin Components window:
It might work!

Related

Xamarin IOS debug, app crashes with no error

When I run app with debug from Visual Studio in IOS Emulator, app launches, shows splash screen and then crashes.
Visual Studio continue showing normal behavior like it is still attached to debug process and everything go according to plan.
When I launch that same app on emulator manually, it works perfectly.
Debug log always as this:
Loaded assembly:
/Users/admin/Library/Developer/CoreSimulator/Devices/40C63365-3924-44EA-9145-AAF5F59D170F/data/Containers/Bundle/Application/FED2C1CB-FD8E-441A-856C-66981DB384B5/WebtutorMobileX.iOS.app/Xamarin.iOS.dll
[External] Loaded assembly:
/Users/admin/Library/Developer/CoreSimulator/Devices/40C63365-3924-44EA-9145-AAF5F59D170F/data/Containers/Bundle/Application/FED2C1CB-FD8E-441A-856C-66981DB384B5/WebtutorMobileX.iOS.app/System.dll
[External] Loaded assembly:
/Users/admin/Library/Developer/CoreSimulator/Devices/40C63365-3924-44EA-9145-AAF5F59D170F/data/Containers/Bundle/Application/FED2C1CB-FD8E-441A-856C-66981DB384B5/WebtutorMobileX.iOS.app/Mono.Security.dll [External]
After that app crashes and nothing happens. Visual Studio stays in blessed ignorance.
No errors whatsoever.
This began after I upgraded to 4.7.0.1179 and XCode 11.6. Visual Studio 2019 16.6.5.
Changing iOS Linker settings to "Link Framework SDKs Only" has fixed it for me (if someone still has this problem in 2022).
VS for Mac 17.3.8 - XCode 14 - XF 5.0.0.2515
Put a try/catch block in the Main.cs file in the xamarin.ios project and a breakpoint in the catch block, it usually tells you what wrong in this kind of crash.
public class Application
{
// This is the main entry point of the application.
static void Main(string[] args)
{
try
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, "AppDelegate");
}
catch (Exception ex)
{
//Breakpoint here
}
}
}
Visual Studio Version 16.7.4 + Xamarin IOS 14.0, debug working again.

exception using Flutter share module

I have created a flutter app using Android Studio and am adding some code to implement the social media share function using this package [https://pub.dartlang.org/packages/share].
I modified the code so the share function is called each time the floating button is tapped/clicked.
I added share: ^0.5.3 to pub spec.yaml and import the package. I added a line to the increment counter function as follows
`
void _incrementCounter() {
Share.share('check out my website https://example.com');
setState(() {
_counter++;
});
`
Everything runs fine until I press the button and then I get the following exception:
VERBOSE-2:shell.cc(181)] Dart Error: Unhandled exception:
MissingPluginException(No implementation found for method share on channel plugins.flutter.io/share)
Any help appreciated :)
It seems that these problems are caused by the new build system Apple introduced in Xcode 10. There is more info here github.com/flutter/flutter/issues/20685#issuecomment-421511890
I have changed from the beta channel to the master channel and now have the example code provided by the Share package authors running in the simulator and on a device.

IllegalAccessError on Android Things

My app is throwing an IllegalAccessError after updating to the latest Android Things
preview. I have the following code to check for an OTA update:
UpdateManager manager = new UpdateManager();
manager.performUpdateNow(UpdateManager.POLICY_CHECKS_ONLY);
When I run this code I get the following error output:
java.lang.IllegalAccessError: Method 'void com.google.android.things.update.UpdateManager.<init>()' is inaccessible to class 'com.example.android.things.screensettings.MainActivity' (...)
This code was working before, why has this started happening after the update?
Starting in Preview 7, Android Things API services are not constructed as new
instances. They are instead accessed as singletons via getInstance() to be
more in line with Android API paradigms.
Be sure to update your app to use the Preview 7 SDK:
dependencies {
compileOnly 'com.google.android.things:androidthings:0.7-devpreview'
}
Then modify your code to use getInstance() instead:
UpdateManager manager = UpdateManager.getInstance();
manager.performUpdateNow(UpdateManager.POLICY_CHECKS_ONLY);
Review the Android Things API reference
to verify if any of the other APIs you are calling have changed.

Protocol buffer code compiles for iOS simulator but not device

I am using github.com/apple/swift-protobuf tag 0.9.904 and github.com/grpc/grpc-swift tag 0.1.12 with Xcode in my iOS app. I am also using the same versions with protoc to compile my .proto file.
The app works fine in the iOS simulator but when I try to run the app on my device I get compile errors on the following bit of generated code in myapp.pb.swift:
// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that your are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
typealias Version = _2
}
The errors are
No type named 'ProtobufAPIVersion_2' in module 'SwiftProtobuf'
and
Type '_GeneratedWithProtocGenSwiftVersion' does not conform to protocol 'ProtobufAPIVersionCheck'
The comment on the piece of code causing the errors speaks for itself. However, if this is true, why does the app compile and run fine in the simulator? How can I get it to compile and run on my device as well?
If this is still a problem for you, please file a GitHub issue on the swift-protobuf project.

blackberry playbook simulator

i have downloaded the VMWare iso for blackberry playbook simulator and it works well.
how can i upload to it my Android application (blackberry online test says that is compatible) on the simulator?
In my Eclipe i don't have the "Run as" Blackberry simulator...so i can't upload it as i do with all the android apps.
Even if i create a new app choosing Blackberry project i can't upload it and, as you can see is the default one.
package mypackage;
import net.rim.device.api.ui.UiApplication;
/**
* This class extends the UiApplication class, providing a
* graphical user interface.
*/
public class MyApp extends UiApplication
{
/**
* Entry point for application
* #param args Command line arguments (not used)
*/
public static void main(String[] args)
{
// Create a new instance of the application and make the currently
// running thread the application's event dispatch thread.
MyApp theApp = new MyApp();
theApp.enterEventDispatcher();
}
/**
* Creates a new MyApp object
*/
public MyApp()
{
// Push a screen onto the UI stack for rendering.
pushScreen(new MyScreen());
}
}
The source code you've listed is a BB7 (or lower version) Java app which won't run on Playbook.
To upload an AIR or C++ app written for Playbook (or its VMWare simulator) you use blackberry-deploy.bat coming with WebWorks SDK or with the other RIM SDKs:
blackberry-deploy.bat -installApp -password qaqa -device 192.168.1.128 -package my_app.bar"
I'm not sure about Android Java apps, maybe you can use the same batch file for them too?
What exactly you want to do ?
Playbook support Application created for Playbook not for Blackberry smartphones & it provide runtime environment for Android applications.
So if you wish to create an app for Playbook You can choose Flash builder to develop in Adobe Air.
Or if you want to run your android application to playbook follow this to install blackberry plugin on your eclipse.
https://developer.blackberry.com/android/documentation/install_plugin_prerequisites_1895476_11.html
Once you are ready with Blackberry plugin , you need to verify your app for Blackberry Playbook(Follow this Link)
https://developer.blackberry.com/android/documentation/Test_your_app_1985225_11.html

Resources