Method not found: void Facebook.CoreKit.AppEvents.ActivateApp() - xamarin

My Xamarin.iOS app was working fine until I deleted some packages that I didn't need anymore, and were preventing my app to build. Now my app builds, but it crashes on startup. In the application output:
Method not found: void Facebook.CoreKit.AppEvents.ActivateApp()
I have these packages still installed and up-to-date:
Xamarin.Facebook.CoreKit.iOS
Xamarin.Facebook.CoreKit.CoreKit.iOS
Xamarin.Facebook.GamingServiceKit.iOS
Xamarin.Facebook.LoginKit.iOS
Xamarin.Facebook.MarketingKit.iOS
Xamarin.Facebook.PlaceKit.iOS
Xamarin.Facebook.ShareKit.iOS
I am calling FacebookClientManager.Initialize(application, launchOptions) in my FinishedLaunching and FacebookClientManager.OnActivated() in my OnActivated

Try removing those nugets from solution. Then add them back in.

Related

Unable to activate instance of type Android.Util.SparseArray`1[E] from native handle 0x15 (key_handle 0x98855da)

I am just get stuck of this problem.
In xamarin.Android I am getting this is error in ReceiveDetections method.
here is the error:
System.NotSupportedException: 'Unable to activate instance of type Android.Util.SparseArray`1[E] from native handle 0x15 (key_handle 0x98855da).'
Before it was working I'm getting this error after upgrading the android version.
Here is the snippet:
public void ReceiveDetections(Detections detections)
{
SparseArray qrcodes = detections.DetectedItems; // getting the error here
if (qrcodes.Size() != 0)
{
//////////////////////////////
}
}
I am getting this problem in debug mode.
According to the Visual Studio Developer Community, try to
Clear temporary bin and obj files
Update to the latest version of VS
Disable Android Share Runtime
Build the app in release mode, or
Increase the Target Framework version of the Android project to 10 or above
Let me know if neither of those solve your issue

VS Code (Flutter, dart) error don't go away after commenting or deleting code

I'm using Mac OS Catalina (10.15.3) Here is my code.
dart shows an error Only static members can be accessed in initializers
And that's it. Error doesn't go away. Even when comment everything delete everything dart continues giving that error. I don't understand. Was working in Android Studio. Exactly the same. I thought it was Android Studio problem. Because of that I downloaded VS Code but again. Here is the photo of error after I comment lines.
Please help me. It annoys me. I don't know what to do.
Edit 1:
I could reproduce the issue.
Let's say I have some StateLessWidget class
class SearchPage extends StatelessWidget {
// Whenever I try to write property beginning with type Future
Future<... // <--- Android Studio and VS Code both stop working.
// then it starts working when I restart
#override
Widget build(BuildContext context) {
return Container();
}
}
Then doesn't matter what you do. Nothing works until restart.
Here's a few things you can try :
Update VS Code.
Does flutter doctor -v contains any error message ?
Try running flutter clean
Open pubspec.yaml, right-click and "Get Packages".
Move to another channel (flutter channel beta for example) and run
flutter upgrade
Delete and reinstall Flutter and its IDE extensions

iOS Swift how to debug SIGABRT :"fatal error: call of deleted method" from a CocoaPod?

I have an app which uses SlideMenuControllerSwift. I've modified some code to see how to present different panels, then rolled back my changes.
When running the project I get SIGABRT fatal error: call of deleted method in console when SlideMenuControllerSwift is initializing. No other error messages are given.
The project's source control appears to be in exactly the same state as before
changes.
I did a "clean"
Reinstalled pods.
Deleted pods directory and made a clean install
Deleted app from device and ran again
Did a fresh checkout into a different folder
Updated cocoapods gem
Even modified the function to use self.addLeftGestures()
How do I debug an issue caused by cocoa pod throwing "fatal error: call of deleted method"?
UPDATE: seems like something is seriously broken with the functions inside that pod, calling another function within init causes bad access exception:
In my case, I had created a project scheme that uses the release build configuration:
In this configuration, if your project build settings does not allow testability in this release mode then setting custom breakpoints or app crashes do not let you debug properly and you are served the fatal error: call of deleted method
Solution:
Check the project build settings for "testability".
Ensure it is "Yes" for the build configuration you are testing under.
In my case, I temporarily enabled testability for Release by making it Yes.
For anyone seeing this error using SwiftUI on XCode 11.4 and trying to access a property on an ObservableObject subclass eg.
class Model: ObservableObject {
#Published var name = ""
}
class ModelSub: Model {}
let model = ModelSub()
// This line causes `fatal error: call of deleted method` on XCode 11.4
$model.name
// Instead do
model._name.projectedValue
See more details here

Not able to run Test Automation using Xamarin.UITest from Visual Studio on my local emulator

We are doing investigation for the Test Clouds for our Android and IOS apps. I made a test snippet which installs and launches the android app. And then takes the screenshot. I am using Visual Studio to write the tests. And Visual Studio emulator to run the android app and xamarin test. Xamarin test is able to install the app, but then throws the error. Code and Errors can be found below.
Other observations:
I am using Test account for my investigations which is free for 30 days.
But I don't see my computer added in the link: https://store.xamarin.com/account/my/subscription/computers. While, I have logged in from Visual Studio in my PC.
Due to this I can't copy the license file too. Can that be the reason? If yes, what is the best way to investigate this without getting full subscription.
Code:
[TestFixture]
public class Tests
{
AndroidApp app;
[SetUp]
public void BeforeEachTest()
{
// TODO: If the Android app being tested is included in the solution then open
// the Unit Tests window, right click Test Apps, select Add App Project
// and select the app projects that should be tested.
app = ConfigureApp
.Android
// TODO: Update this path to point to your Android app and uncomment the
// code if the app is not included in the solution.
.ApkFile(#"C:\MobileOnly\SampleProjects\AndroidSampleProjects\InfraTest\app\build\outputs\apk\app-debug.apk")
// .InstalledApp("com.microsoft.mobile.infratest")
.StartApp(Xamarin.UITest.Configuration.AppDataMode.Clear);
}
[Test]
public void AppLaunches()
{
app.Screenshot("First screen.");
}
}
Error:
Test Name: AppLaunches
Test FullName: XamarinUITest.Tests.AppLaunches
Test Source: : line 0
Test Outcome: Failed
Test Duration: 0:00:11.233
Result StackTrace:
at Xamarin.UITest.Shared.Processes.ProcessRunner.Run(String path, String arguments)
at Xamarin.UITest.Shared.Android.Commands.CommandAdbInstallPackage.Execute(IProcessRunner processRunner, IAndroidSdkTools androidSdkTools)
at Xamarin.UITest.Shared.Android.LocalAndroidAppLifeCycle.InstallApps(ApkFile[] apkFiles)
at Xamarin.UITest.Shared.Android.LocalAndroidAppLifeCycle.EnsureInstalled(ApkFile appApkFile, ApkFile testServerApkFile)
at Xamarin.UITest.Android.AndroidApp..ctor(IAndroidAppConfiguration appConfiguration)
at Xamarin.UITest.Configuration.AndroidAppConfigurator.StartApp(AppDataMode appDataMode)
at XamarinUITest.Tests.BeforeEachTest() in C:\MobileOnly\SampleProjects\AndroidSampleProjects\XamarinUITest\XamarinUITest\Tests.cs:line 22
Result Message:
SetUp : System.Exception : Failed to execute: C:\NugetCache\androidsdk.23.0.4\platform-tools\adb.exe -s 169.254.138.177:5555 install "C:\Users\gunjansa\AppData\Local\Temp\uitest\a-6EAAB1A4CD21F05DB755FBC781EAD620D4ADACBC\final-D9BA1DA5963F9B7853DABC6DEC56BFF2F4740ADE.apk" - exit code: -1073740940
WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
pkg: /data/local/tmp/final-D9BA1DA5963F9B7853DABC6DEC56BFF2F4740ADE.apk
Update the Xamarin.UITest NuGet and try
public void BeforeEachTest()
{
// TODO: If the Android app being tested is included in the solution then open
// the Unit Tests window, right click Test Apps, select Add App Project
// and select the app projects that should be tested.
app = ConfigureApp
.Android
.StartApp();
}
I would do below actions
Restore your UITest project packages
Make sure that you dont see any app named with the package id though the app is completely uninstalled from the device. Often this is the case where uitests uninstalls the existing version of the app and leaves the folders behind causing this issue.
Hope this resolves your issue.

Very Frustrating Sandboxing Error

To preface, I haven't changed any code or entitlements in my app. It always built and worked great but now all of a sudden I am getting this error.
12/8/15 10:05:45.388 AM appleeventsd[51]: A
sandboxed application with pid 2414, "XXX" checked in with
appleeventsd, but its code signature could not be read and validated
by appleeventsd, and so it cannot receive AppleEvents targeted by
name, bundle id, or signature. Install the application in
/Applications/ or some other world readable location to resolve this
issue. Error=ERROR: #100013 {
"NSDescription"="SecCodeCopySigningInformation() returned 100013, -."
} (handleMessage()/appleEventsD.cp #2098) com.apple.root.default-qos
I have tried the following
Install the app in "Applications" as the error suggest.
Restart the computer.
Delete the container and empty the trash.
Killing off cfprefsd. Both root and user.
Re-installing Xcode.
Removing the "Developer" folder in my Library.
Running the app in a virtual machine with a brand new install of my app.
Recreate all my developer certificates, provisioning profiles, etc...
None of the above works.
I have also tried all suggestions in the following links
Mac sandbox created but no NSUserDefaults plist
Error while implementing Sandbox: "deny file-read-metadata /Library"
Can't code sign helper app properly
Error in Sandboxed App, When loading Helper (LoginItems), code signing issue
And nothing has resolved the issue. My app, all of a sudden stopped working.
I think I figured it out. I re-wrote the code for creating a security scoped bookmark... all is working again. I couldn't find any differences but I think it was something in my code.

Resources