GithubHelp home page GithubHelp logo

Comments (13)

moljac avatar moljac commented on August 17, 2024 1

Fixed.
Tagging for new preview!

from androidx.

semanticer avatar semanticer commented on August 17, 2024

If this is possible under Xamarin rule (running java 8 underneath) we should simply switch from annotation processing based lifecycle to java8 variant that uses default method implementations. We need to move from androidx.lifecycle:lifecycle-compiler: package to androidx.lifecycle:lifecycle-common-java8: and replace all LifecycleObserver with DefaultLifecycleObserver remove the annotations and only implement lifecycle methods that we need. No need for annotation magic.

from androidx.

daividssilverio avatar daividssilverio commented on August 17, 2024

Hey, I was able to use the annotations by simply adding a custom OnStart and OnStop annotation that references the updated androidX package. It works! Anyone facing the same problem can check the workaround here: https://github.com/toggl/mobileapp/commit/ec70d8c00dd3e1d8b067e81f2eec21a5fc167416

from androidx.

Redth avatar Redth commented on August 17, 2024

We need to update the types here: https://github.com/xamarin/AndroidX/blob/master/source/androidx.lifecycle/lifecycle-common/additions/Additions.cs

from androidx.

moljac avatar moljac commented on August 17, 2024

@daividssilverio
Please can you provide feedback?

from androidx.

daividssilverio avatar daividssilverio commented on August 17, 2024

Sure thing, I'll try it later today.

from androidx.

daividssilverio avatar daividssilverio commented on August 17, 2024

@moljac I've updated our repo to target the preview06 version of the androidX packages and the correct reference seems to be there for the annotations. But I can't build the application anymore on that version.

I'm currently getting this error during build time:

  Xamarin.AndroidX.Migration.targets(131, 9): Could not find 2 Android X assemblies, make sure to install the following NuGet packages:
 - Xamarin.AndroidX.Arch.Core.Runtime
 - Xamarin.AndroidX.Collection
You can also copy-and-paste the following snippet into your .csproj file:
    <PackageReference Include="Xamarin.AndroidX.Arch.Core.Runtime" Version="2.0.1-preview02" />
    <PackageReference Include="Xamarin.AndroidX.Collection" Version="1.0.0-preview02" />

The instructions don't make sense to me... why would I use -preview02 only for those two libs?

Here's the test branch that produces that error: https://github.com/toggl/mobileapp/tree/doivid/test-updated-androidx-nuget-packages

from androidx.

moljac avatar moljac commented on August 17, 2024

@daividssilverio

The instructions don't make sense to me... why would I use -preview02 only for those two libs?

Spot on. Not sure why -preview02!?!!??

Checking sample. Thanks

from androidx.

moljac avatar moljac commented on August 17, 2024

@daividssilverio
Regarding the sample app:

  1. Why mixture of Android.Support and AndroidX?
  2. Which version of Xamarin.AndroidX.Migration do you use?
    Never mind. I'll find that out.

from androidx.

daividssilverio avatar daividssilverio commented on August 17, 2024

@moljac

Glad you asked. We've followed the guide on https://devblogs.microsoft.com/xamarin/androidx-for-xamarin/

And, yes, I've tried removing the Android.Support libs, but the GoogleServices/Firebase related libs adds them all back!

The Xamarin.AndroidX.Migration does some "magic", right? It should remove the support libs and others during the build. We are using preview-06 in the test branch I've sent you.

In our develop branch we are using preview-02.

from androidx.

moljac avatar moljac commented on August 17, 2024

@daividssilverio

but the GoogleServices/Firebase related libs adds them all back!

That's the problem. We haven't published GPS-FB stuff that depend on AndroidX. Not even preview.

OK. Alles klar (all clear).

from androidx.

moljac avatar moljac commented on August 17, 2024

@daividssilverio Feedback would really be nice and appreciated. Thanks

from androidx.

Redth avatar Redth commented on August 17, 2024

I believe this is fixed and released in preview. If you still have problems with this, please open a new issue.

from androidx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.