Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashlytics interaction with other packages #760

Closed
guillermo-gerard opened this issue Dec 4, 2019 · 8 comments
Closed

Crashlytics interaction with other packages #760

guillermo-gerard opened this issue Dec 4, 2019 · 8 comments
Projects

Comments

@guillermo-gerard
Copy link

guillermo-gerard commented Dec 4, 2019

Related to #755
@Redth @mattleibow

I've tested a minimal app and after struggling a bit it works.
Then I've added the packages on my actual project and it didn't work.

So I've performed a test using the minimum app, and, after removing all the packages and reinstall the minimum to get the build working I found that I have the same problem in the test app: the exceptions were not being logged in firebase.

I use these package versions:

<PackageReference Include="Xamarin.Android.Crashlytics" Version="2.9.4.1" />
<PackageReference Include="Xamarin.Android.Crashlytics.Answers" Version="1.4.2" />
<PackageReference Include="Xamarin.Android.Crashlytics.Beta" Version="1.2.9" />
<PackageReference Include="Xamarin.Android.Crashlytics.Core" Version="2.6.3" />
<PackageReference Include="Xamarin.Android.Fabric" Version="1.4.3" />
<PackageReference Include="Xamarin.Build.Download" Version="0.7.0" /> 

Along with (I know they are not the latest, but these are the versions I need in my project):

<PackageReference Include="Xamarin.Android.Support.v4" Version:28.0.0.1/>
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version>28.0.0.1 />

And nothing else.

Even updating all the packages to the latest version the test app didn't work anymore, it seems like I'm missing other required package, but I don't know which one.

The only time it worked, I had a bunch of other packages installed(and then I removed them because it seems that they were never used, but now it appears that at least one of them was required).
The minimal app builds correctly now, the install in the emulator or device is also correct, but then I cannot see any logs.

Any ideas to get this working again?

@Redth
Copy link
Member

Redth commented Dec 4, 2019

Yes it seems like we missed PrivateAssets="None" in the PackageReference declarations in the binding projects for Crashlytics, so not all the correct bits were being pulled in. @mattleibow is working on a fix.

@guillermo-gerard
Copy link
Author

Oh, yes, I see you are working on it, I've uninstalled all the crashlytics related packages and tried the last version just pushed out (2.9.4.2). It seems to install all the required dependencies, but still no love :(

@guillermo-gerard
Copy link
Author

Do I need any firebase (common, core, iid) installed to get this working?

@Redth
Copy link
Member

Redth commented Dec 4, 2019

Yes, the problem is we use a lot of .targets file inside the nupkg's build/ folder, and the default behaviour for some crazy reason is to ignore the build/* assets for transitive dependencies, unless the project declaring the dependency explicitly states for that dependency to be PrivateAssets="none" (there's also a newer convention using a buildTransitive/ folder in the nuget package which helps).

So in this case, we didn't add PrivateAssets="none" when we declared <PackageReference Include="Xamarin.Build.Download" ... /> in our binding project for Crashlytics, so when you go install just Crashlytics in your app, the Xamarin.Build.Download's build/* is ignored as a transitive dependency. You saw success in working around this by explicitly adding a reference to Xamarin.Build.Download in your project which causes build/* to be included as it's no longer a transitive dependency at that point. Without the build/* referenced for your project, important targets never get run which are necessary to use Crashlytics properly, hence the issues.

We are fixing our references to add PrivateAssets="none" as well as to use buildTransitive so you shouldn't have to add explicit references to the transitive dependencies any more.

@guillermo-gerard
Copy link
Author

I've just tested the last version just pushed: v2.9.4.3, At least the tiny test app is working again :)

@Redth Redth added this to Needs triage in Triage Dec 5, 2019
@guillermo-gerard
Copy link
Author

guillermo-gerard commented Dec 10, 2019

I'm still having an issue: when I installed the last version, Xamarin.Android.Crashlytics v2.9.4.3 , it installs Xamarin.Build.Download v0.7.1 as a dependency. That appears to be correct, but: If you clean up all the packages from NuGet cache and the rebuild the solution you will see build errors (sometimes there are others, they are not always the same):

image

Then, if I downgrade the Xamarin.Build.Download to the previous version (v0.4.11) everything back to a "normal"(-ish) state where I can do a build, but downgrading Xamarin.Build.Download also downgrade all the crashlytics packages to v2.9.4.1 and Crashlytics stops working again.
Any recommendation?

@jonathanantoine
Copy link

same for me :(

@guillermo-gerard
Copy link
Author

I fixed the issue at least for me.
It seems that the issue was caused by dependency interactions.

For anybody struggling with this, I've got it working by using exactly the following versions:

Xamarin.Android.Crashlytics 2.9.4.1
Xamarin.Android.Crashlytics.Answers 1.4.2
Xamarin.Android.Crashlytics.Beta 1.2.9
Xamarin.Android.Crashlytics.Core 2.6.3
Xamarin.Android.Fabric 1.4.3
Xamarin.Build.Download 0.4.11

Installing Crashlytics will install Xamarin.Build.Download 0.7.1 as a dependency, but (at least for me) it is not possible to get a proper build anymore with that version. So this package should be downgraded after it is installed.

Triage automation moved this from Needs triage to Closed Jan 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Triage
  
Closed
Development

No branches or pull requests

3 participants