Error accessing Intent.ACTION_PICK for contacts in apk release

0

Very good, I'm accessing the contact list by pressing a button, to select the contact to which you want to send an SMS. My code is as follows

 findViewById(R.id.get_contacts).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
             Intent intent = new Intent(getApplicationContext(), ContactPickerActivity.class)
                     .putExtra(ContactPickerActivity.EXTRA_THEME, "dark")

                    .putExtra(ContactPickerActivity.EXTRA_CONTACT_BADGE_TYPE,
                            ContactPictureType.ROUND.name())

                    .putExtra(ContactPickerActivity.EXTRA_CONTACT_DESCRIPTION,
                            ContactDescription.ADDRESS.name())

                    .putExtra(ContactPickerActivity.EXTRA_CONTACT_DESCRIPTION_TYPE,
                            ContactsContract.CommonDataKinds.Email.TYPE_WORK)

                    .putExtra(ContactPickerActivity.EXTRA_CONTACT_SORT_ORDER,
                            ContactSortOrder.AUTOMATIC.name()); 
         //   Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI);
            startActivityForResult(intent, REQUEST_CONTACT);
        }
    });

While I'm in the development option (Build Variant = Debug) this works perfectly for me, but when I go to production (Build Variant = Release) it gives an error:

Fatal Exception: java.lang.RuntimeException: Unable to resume activity {com.martruchagr.bloquearllamadas/com.onegravity.contactpicker.core.ContactPickerActivity}: org.greenrobot.eventbus.e: Subscriber class com.onegravity.contactpicker.core.ContactPickerActivity and its super classes have no public methods with the @Subscribe annotation
   at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3103)
   at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
   at android.app.ActivityThread.access$900(ActivityThread.java:150)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:148)
   at android.app.ActivityThread.main(ActivityThread.java:5417)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Caused by org.greenrobot.eventbus.e: Subscriber class com.onegravity.contactpicker.core.ContactPickerActivity and its super classes have no public methods with the @Subscribe annotation
   at org.greenrobot.eventbus.SubscriberMethodFinder.findSubscriberMethods(Unknown Source)
   at org.greenrobot.eventbus.EventBus.getDefault(Unknown Source)
   at com.onegravity.contactpicker.core.ContactPickerActivity.onResume(Unknown Source)
   at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1259)
   at android.app.Activity.performResume(Activity.java:6361)
   at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3092)
   at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3134)
   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2481)
   at android.app.ActivityThread.access$900(ActivityThread.java:150)
   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
   at android.os.Handler.dispatchMessage(Handler.java:102)
   at android.os.Looper.loop(Looper.java:148)
   at android.app.ActivityThread.main(ActivityThread.java:5417)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

I can not find the why. You could help me out.

Thank you very much

    
asked by Martruchagr 26.10.2017 в 17:15
source

1 answer

0

Well, I finally found the solution. It seems to be a proguard problem

Here's the answer

With this I have solved it

    
answered by 26.10.2017 в 20:05