Coder Social home page Coder Social logo

Comments (6)

canelmas avatar canelmas commented on July 20, 2024 1

it should be fixed with 0.1.10

from let.

mendhak avatar mendhak commented on July 20, 2024

Same problem in my app, crashing on Android N devices. I am asking for:

@AskPermission({Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.WRITE_EXTERNAL_STORAGE})

And the crash looks like this:

java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String[] com.canelmas.let.AskPermission.value()' on a null object reference
    at com.canelmas.let.RuntimePermissionRequest.proceed(RuntimePermissionRequest.java:61)
    at com.canelmas.let.RuntimePermissionRequest.proceed(RuntimePermissionRequest.java:52)
    at com.canelmas.let.LetAspect.ajc$inlineAccessMethod$com_canelmas_let_LetAspect$com_canelmas_let_RuntimePermissionRequest$proceed(LetAspect.java:1)
    at com.canelmas.let.LetAspect.annotatedMethods(LetAspect.java:57)
    at com.mendhak.gpslogger.ui.fragments.display.GenericViewFragment.requestToggleLogging(GenericViewFragment.java:98)
    at com.mendhak.gpslogger.ui.fragments.display.GpsSimpleViewFragment$1.onClick(GpsSimpleViewFragment.java:101)
    at android.view.View.performClick(View.java:5565)
    at android.view.View$PerformClick.run(View.java:22047)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:148)
    at android.app.ActivityThread.main(ActivityThread.java:5849)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:763)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:653)

from let.

canelmas avatar canelmas commented on July 20, 2024

@olsontl @mendhak hey, thanks for reporting. I'm also able to reproduce the crash.

I believe the issue is related to the retention policy set to RetentionPolicy.CLASS for @AskPermission

To be honest, I don't really remember what was I really thinking when I changed it from Runtime to Class in the first place. I will fix it in a day.

But the thing is I'm having trouble understanding why it's working on pre-N and not on N.

from let.

olsontl avatar olsontl commented on July 20, 2024

Looks good. Thanks!

from let.

canelmas avatar canelmas commented on July 20, 2024

It seems that retention policies are not being honored in certain cases; which is fixed and should be expected with the upcoming new N releases.

You can check official issue here : https://code.google.com/p/android/issues/detail?id=203109

from let.

mufumbo avatar mufumbo commented on July 20, 2024

this problem still happens on 0.1.11:

    Process: com.craftlog.android.cooking, PID: 14695
    java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.annotation.Annotation java.lang.reflect.Method.getAnnotation(java.lang.Class)' on a null object reference
        at com.canelmas.let.RuntimePermissionRequest.proceed(SourceFile:61)
        at com.canelmas.let.RuntimePermissionRequest.proceed(SourceFile:52)
        at com.canelmas.let.LetAspect.ajc$inlineAccessMethod$com_canelmas_let_LetAspect$com_canelmas_let_RuntimePermissionRequest$proceed(SourceFile:1)
        at com.canelmas.let.LetAspect.annotatedMethods(SourceFile:57)

it started happening after we disabled D8 compiler.

Do you think this library should never crash? Maybe a big-O try/catch will be necessary, regardless of android bugs.

from let.

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.