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

App crash when request permission in Huawei Honor 7 #281

Open
zzulevi opened this issue Apr 2, 2019 · 4 comments
Open

App crash when request permission in Huawei Honor 7 #281

zzulevi opened this issue Apr 2, 2019 · 4 comments

Comments

@zzulevi
Copy link

zzulevi commented Apr 2, 2019

Basic Information

Device type: Huawei Honor 7
OS version: 6.0
EasyPermissions version: 2.0.1

Describe the problem

App crash when request permission in Activity onCreate, if use ActivityCompat API, it can run correctly.

Code and logs

@Override
 protected void onCreate(Bundle savedInstanceState) {
       if(!EasyPermissions.hasPermissions(this, permissions)){
       ...............
       }
}
04-02 11:51:11.141 6471-6471/? I/art: Late-enabling -Xcheck:jni
04-02 11:51:11.198 6471-6484/cn.joeyan.helloworld E/HAL: load: id=gralloc != hmi->id=gralloc
04-02 11:51:11.233 6471-6471/cn.joeyan.helloworld I/HwCust: Constructor found for class android.app.HwCustHwWallpaperManagerImpl
04-02 11:51:11.243 6471-6471/cn.joeyan.helloworld W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter android.support.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
04-02 11:51:11.274 6471-6471/cn.joeyan.helloworld I/art: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>
04-02 11:51:11.274 6471-6471/cn.joeyan.helloworld I/art: Rejecting re-init on previously-failed class java.lang.Class<android.support.v4.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>
04-02 11:51:11.659 6471-6471/cn.joeyan.helloworld I/Process: Sending signal. PID: 6471 SIG: 9
@samtstern
Copy link
Contributor

@zzulevi there's nothing in the logs you provided that shows EasyPermissions causing (or being involved in) the crash. Are there more logs maybe?

@vince-cooper
Copy link

vince-cooper commented Jun 25, 2019

@zzulevi您提供的日志中没有任何内容显示EasyPermissions导致(或参与)崩溃。是否有更多的日志?

java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
        at android.support.v7.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:555)
        at android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:518)
        at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:466)
        at android.support.v7.app.AppCompatDialog.setContentView(AppCompatDialog.java:94)
        at android.support.v7.app.AlertController.installContent(AlertController.java:232)
        at android.support.v7.app.AlertDialog.onCreate(AlertDialog.java:279)
        at android.app.Dialog.dispatchOnCreate(Dialog.java:550)
        at android.app.Dialog.show(Dialog.java:402)
        at android.support.v4.app.DialogFragment.onStart(DialogFragment.java:436)
        at android.support.v4.app.Fragment.performStart(Fragment.java:2477)
        at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1494)
        at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1784)
        at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1852)
        at android.support.v4.app.FragmentManagerImpl.dispatchStateChange(FragmentManager.java:3269)
        at android.support.v4.app.FragmentManagerImpl.dispatchStart(FragmentManager.java:3235)
        at android.support.v4.app.FragmentController.dispatchStart(FragmentController.java:212)
        at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:628)
        at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1419)
        at android.app.Activity.performStart(Activity.java:7476)
        at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3388)
        at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:180)
        at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:165)
        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:142)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2155)
        at android.os.Handler.dispatchMessage(Handler.java:109)
        at android.os.Looper.loop(Looper.java:207)
        at android.app.ActivityThread.main(ActivityThread.java:7539)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)

@vince-cooper
Copy link

The strange thing is that my Activity does not extend AppCompatActivity

@samtstern
Copy link
Contributor

samtstern commented Sep 20, 2019

@WwhOS I apologize for not responding here! There's no code in that stacktrace that references pub.devrel.easypermissions so it's not enough information to know how to fix this. Are you sure this crash comes from EP?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants