GithubHelp home page GithubHelp logo

Comments (16)

BirjuVachhani avatar BirjuVachhani commented on August 25, 2024 1

Fixed in v4.0.1

implementation 'com.github.BirjuVachhani:locus-android:4.0.1'

from locus-android.

AlvaroSanzRodrigo avatar AlvaroSanzRodrigo commented on August 25, 2024 1

Sorry for not being able to test it, will update to the new version tomorrow, thanks for your effort!

from locus-android.

larsmathuseck avatar larsmathuseck commented on August 25, 2024

+1
Same issue here

from locus-android.

BirjuVachhani avatar BirjuVachhani commented on August 25, 2024

This should fix it. Try this and let me know if it works fine. I'll release it.

implementation 'com.github.BirjuVachhani:locus-android:master-SNAPSHOT'

from locus-android.

BirjuVachhani avatar BirjuVachhani commented on August 25, 2024

@larsmathuseck @Zee-BA Can you please confirm?

from locus-android.

larsmathuseck avatar larsmathuseck commented on August 25, 2024

Thanks for the fast reply.
I have trouble building from the master snapshot

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.BirjuVachhani:locus-android:master-SNAPSHOT.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/BirjuVachhani/locus-android/master-SNAPSHOT/maven-metadata.xml
- https://dl.google.com/dl/android/maven2/com/github/BirjuVachhani/locus-android/master-SNAPSHOT/locus-android-master-SNAPSHOT.pom
- https://repo.maven.apache.org/maven2/com/github/BirjuVachhani/locus-android/master-SNAPSHOT/maven-metadata.xml
- https://repo.maven.apache.org/maven2/com/github/BirjuVachhani/locus-android/master-SNAPSHOT/locus-android-master-SNAPSHOT.pom
- https://jitpack.io/com/github/BirjuVachhani/locus-android/master-SNAPSHOT/maven-metadata.xml
- https://jitpack.io/com/github/BirjuVachhani/locus-android/master-SNAPSHOT/locus-android-master-d9f8b59f14-1.pom
Required by:
project :app

https://jitpack.io/com/github/BirjuVachhani/locus-android/master-SNAPSHOT/locus-android-master-d9f8b59f14-1.pom
gives Not found. Any idea what's wrong here?

from locus-android.

BirjuVachhani avatar BirjuVachhani commented on August 25, 2024

Could it be that the snapshot build failed for some reason?? Let me check.

from locus-android.

BirjuVachhani avatar BirjuVachhani commented on August 25, 2024

Found it. Its Java version issue. The project uses JAVA 1.8 but Gradle requires Java 11. I'll fix this.

from locus-android.

johnkevin123898 avatar johnkevin123898 commented on August 25, 2024

when the library gets updated for this issue.

from locus-android.

AlvaroSanzRodrigo avatar AlvaroSanzRodrigo commented on August 25, 2024

+1
😢
Your library is awesome thoug

from locus-android.

BirjuVachhani avatar BirjuVachhani commented on August 25, 2024

I am having hard time fixing Jitpack with Java 11. I'll try to release a version this weekend. Thank you for bearing this with me...

from locus-android.

BirjuVachhani avatar BirjuVachhani commented on August 25, 2024

Meanwhile can anyone try to run the sample project and see if the flags issue is gone or not? It is working for me so just wanted to confirm before releasing.

from locus-android.

larsmathuseck avatar larsmathuseck commented on August 25, 2024

I just checked the demo-app. It still crashes for me on my Pixel 4 with Android 12.

Caused by: java.lang.IllegalArgumentException: com.birjuvachhani.locationextensionsample: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
    Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
        at android.app.PendingIntent.checkFlags(PendingIntent.java:375)
        at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:645)
        at android.app.PendingIntent.getBroadcast(PendingIntent.java:632)
        at com.birjuvachhani.locus.LocationBroadcastReceiver$Companion.getPendingIntent(LocationBroadcastReceiver.kt:46)

I think the code should be

val flags =
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
        PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_MUTABLE
    else PendingIntent.FLAG_UPDATE_CURRENT

instead of

val flags =
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
        PendingIntent.FLAG_UPDATE_CURRENT and PendingIntent.FLAG_MUTABLE
    else PendingIntent.FLAG_UPDATE_CURRENT

( or instead of and).

Also, are you sure the Intent must be mutable?
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.

from locus-android.

BirjuVachhani avatar BirjuVachhani commented on August 25, 2024

@larsmathuseck Thanks for the super informative response. I am not 100% sure about mutability flag as this library was developed a long time ago. I'll do some research to remove it if possible.

For now, I have made suggested changes and have tested on Android 12 emulator (which I couldn't before). It is not crashing for me. Let me know if this works for you. I have pushed the fix to master.

from locus-android.

larsmathuseck avatar larsmathuseck commented on August 25, 2024

Thanks for the fast fix.
The latest version seems to work on my device.

from locus-android.

BirjuVachhani avatar BirjuVachhani commented on August 25, 2024

That's great. Now I need to fix Jitpack.

from locus-android.

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.