Is it possible to use Xamarin.Forms Android and UWP with the IoT Hub? How? I can't find a functioning example. Windows.Azure.Devices.Clint works, but only for UWP (for me at least). What to do? Is it possible to use Windows.Azure.Devices.Clint, or do I have to use Windows.Azure.Devices.Clint.PCL?
Some things from the logs (might be helpful):
Ignoring C:\Users\Korisnik.nuget\packages\system.runtime.compilerservices.unsafe\4.4.0\ref
And when trying to deploy:
03-30 10:09:33.202 D/Mono (16948): Assembly Loader probing location: 'System.Runtime.CompilerServices.Unsafe'.
03-30 10:09:33.203 F/monodroid-assembly(16948): Could not load assembly 'System.Runtime.CompilerServices.Unsafe' during startup registration.
03-30 10:09:33.203 F/monodroid-assembly(16948): This might be due to an invalid debug installation.
03-30 10:09:33.203 F/monodroid-assembly(16948): A common cause is to 'adb install' the app directly instead of doing from the IDE.
Check out the repo with the sample code: https://github.com/ChakraSpice/Xamarin-IoT-Android-Issue-Sample (use your own connection string)
I can't deploy it to the android devices.
It was a known issue but has already been fixed. Please check these issues: [1] and [2].
I install Microsoft.Azure.Devices.Client version 1.7.0 in Xamarin.Forms Android. It seems working. You can try to see if it helps.
Related
Unity editor version: 2019.3.15f1
Firebase Unity SDK version: firebase_unity_sdk_6.15.2
Additional SDKs im using: Unity IAP, Gamesparks, Ironsource, Facebook, Appsflyer, GameAnalytics
Platform im using the Unity editor on: Windows
Platform im targeting: Android
Scripting Runtime: IL2CPP
Problem
I am getting data on firebase analytics, but I cannot get crashlytics to report anything. Im stuck on this...
Steps to reproduce:
Add the firebase analytics and crashlytics sdks.
Add the google-services.json GoogleService-Info.plist files somewhere in assets folder
Add this code to initialise the firebase
// Use this for initialization
void Start ()
{
// Initialize Firebase
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWith(task => {
var dependencyStatus = task.Result;
if (dependencyStatus == Firebase.DependencyStatus.Available)
{
// Create and hold a reference to your FirebaseApp,
// where app is a Firebase.FirebaseApp property of your application class.
// Crashlytics will use the DefaultInstance, as well;
// this ensures that Crashlytics is initialized.
Firebase.FirebaseApp app = Firebase.FirebaseApp.DefaultInstance;
// Set a flag here for indicating that your project is ready to use Firebase.
VisualDebugger.SetText("crashlytics initialised");
}
else
{
UnityEngine.Debug.LogError(System.String.Format(
"Could not resolve all Firebase dependencies: {0}",dependencyStatus));
VisualDebugger.SetText("crashlytics NOT initialised: " + dependencyStatus);
// Firebase Unity SDK is not safe to use here.
}
});
Invoke("IsCrashEnabled", 5f);
}
void IsCrashEnabled()
{
VisualDebugger.AddLine("IsCrashlyticsCollectionEnabled: "+Firebase.Crashlytics.Crashlytics.IsCrashlyticsCollectionEnabled);
}
In order to get the app to run with the facebook sdk installed Ive added these two lines to proguard-user.txt
-keep public class com.facebook.**{public *; }
-keep public class com.facebook.internal.**{ public *; }
and commented out the following lines from mainTemplate.gradle
//implementation 'com.android.support:appcompat-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
//implementation 'com.android.support:customtabs:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
//implementation 'com.android.support:support-v4:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
When I run the app, firebase is initialised successfully. Also Firebase.Crashlytics.Crashlytics.IsCrashlyticsCollectionEnabled returns true.
I crash the app in a number of different ways, then open it again without reinstalling. But no crash reports are sent.
When I watch logcat when starting the app I see this error from firebase each time the app is opened
2020-09-28 16:18:59.332 25773-25847/? E/FirebaseCrashlytics: Failed to retrieve settings from https://firebase-settings.crashlytics.com/spi/v2/platforms/android/gmp/REDACTEDblahblahblah/settings
Update Oct 19, 2020:
Today a developer updated the issue I linked in this answer saying the Firebase team fixed a backend bug last Friday (Oct 16) that was affecting some new Unity Android apps registering w/ Firebase - likely the bug behind your issue. I had already solved the issue in my own project using the below solution, but if you haven't yet updated your project, I recommend running it again and seeing if Crashlytics is working for you now..
I've been dealing with the same issue this week in Unity 2019.4.11f1 - i see the same error message about not being able to retrieve settings, but with my specific project and appIds in the URL.
I found a solution in this Github issue, which suggests the problem is caused by the version of an android library that is a dependency for the Unity Firebase Crashlytics package. My rough understanding is that the firebase-crashlytics-unity library is a wrapper around android library firebase:firebase-crashlytics, and the unity package allows the underlying native Android code to be used from Unity. Version com.google.firebase:firebase-crashlytics:17.10.0 has issues with getting the settings for some Firebase projects on Android. Myself and several others following this issue found forcing Unity to use this specific dependency at version 17.1.1 resolved the issue.
Someone else with the same issue in the thread contacted Firebase support and was told:
The error you are seeing "Failed to retrieve settings" is related to
the SDK version being used. If you go to "Assets > Firebase > Editor>
CrashlyticsDependencies" you can manually update the SDK to point to
the latest Crashlytics SDK version 17.2.2. Please give it a try and if
you continue having issues, let me know.
It turned out this advice wasn't quite right - some of us following the thread then experienced a different issue when using the Android Crashlytics SDK version 17.2.2 with Unity crashlytics version 6.16.0. So I'd specifically recommend trying out the below suggestion or other solutions in the thread to set your Android crashlytics library to v17.1.1.
Changes I made in my project to address this:
First, I updated my unity firebase packages in the package manager to use version 6.16.0. In my project 4 packages were installed - core, analytics, crashlytics, and messaging.
Then I searched for the the Crashlytics package's dependency file - Crashlytics-Dependencies.xml (found by searching project - was in /Library/PackageCache/com.google.firebase.crashlytics#6.16.0/Firebase/Editor/ for me). This file initally had "com.google.firebase:firebase-crashlytics:17.0.0" listed, which I updated to be: "com.google.firebase:firebase-crashlytics:17.1.1".
As an extra precaution, I also added created a MyProject-Dependencies.xml file, as was suggested by a user in the thread - this file also specifies version "com.google.firebase:firebase-crashlytics:17.1.1".
Next, I modified the Unity build process to use a custom mainTemplate.gradle file to specify dependencies,
rather than using the External Dependency Resolver to manage and
embed unity packages (option in Build Settings > PlayerSettings >
Android).
I also updated the settings on the External Dependency Manager Android Ressolver:
Disabled AutoResolve and Disabled Resolve on Build (we dont want EDM updating dependencies without our knowledge when building)
I also turned disabled AndroidPackageInstallationEnabled - this has made the resolution process much faster and removed a bunch of .aar files from the android dependencies list, and hasn't caused any problems in my project.
I then ran External Dependency Resolver > Android > Force Resolve, which after the settings changes above, should now embed a list of the dependencies for the Android build into the mainTemplate.gradle file - Check this file (its in Assets/Plugins/Android) and you should now see com.google.firebase:firebase-crashlytics:17.1.1 in that list.
Also, I recommend reading this article about managing Unity Firebase dependencies from one of the Firebase developer advocates, Patrick Martin. It helped me wrap my head around how Android dependency management in Unity works, as well as how the Android gradle build process works.
I was using FirebaseDynamicLinks in my Xamarin forms project (everything works fine) and I decided to update my nuget packages.. but after I update Xamarin.Firebase.DynamicLinks (and all dependencies) I got null after calling FirebaseDynamicLinks.Instance.
There was some major changes? Do I need to modify my code somehow after this update? Thanks for any help!
I found this in logs, so my google-services.json should be right, right?
FirebaseInitProvider: FirebaseApp initialization successful
Xamarin.Android SDK Version: 9.3.0.23
Operating System & Version: Win 10, 1803
So if not necessary now, suggest downgrading to previous version of Xamarin.Firebase.DynamicLinks. Maybe there are something not incompatible or new methods not be used correctly.
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
Exception fault: VerifyError: Error #1014: Class com.distriqt.extension.googleanalytics::Tracker could not be found.
The issue does NOT occur when installed to a device.
The extension has been added to the application descriptor.
I have other Distriqt extensions (notifications, dialog) already in my app which are working fine.
Setup: Mac / FDT / AIR SDK 18
We accidentally missed a few classes in default library of the first release of this ANE.
Grab the update and it should resolve this issue.
Cheers
try to copy and rename your ANE: ane-file-name.ane to ane-file-name.swc, and also add it to your project (you must have both ane and swc)
I'm preparing to submit by app to marketplace and I wanted to run 'Marketplace Test Kit'. I've read some articles and as it was there I changed active config to Release|Any CPU.
When I want to rebuild I get couple of problems with references connected with SQLClient which I use in my app. Normally everything is working well. Just when I switch from debug to release they appears:
The type or namespace name 'SQLiteClient' could not be found (are you missing a using directive or an assembly reference?)
And I places when he shows I have defined them like that:
using SQLiteClient;
Reference is added as Community.Csharp.Sqlite.WP
Oh, poor me ;)
I just deleted/added again the dll and that worked!
Showing error in release mode
Topic above with similar problem