0

I have 2 phones, 1 samsung S8 running v8.0 and a LG G4 running v6.0. I have both plugged into the same computer and build the app and run it on the phones. All seems good on the Samsung, and all installs and seems good on the LG until I press the menu button on the first Activity.

My first activity loads a fragment which puts the 3 dot menu in the top right. I only have 1 item in the menu which opens a new activity that has a list of items to select from. On the LG when this 3 dot menu is pressed, the app crashes, but on the S8, it opens the menu and allows me to select the 1 item and open the next activity.

Looking for any ideas on where to go with this.

The Error I get:

I/ViewRootImpl: ViewRoot's Touch Event : ACTION_DOWN
I/ViewRootImpl: ViewRoot's Touch Event : ACTION_UP
I/AudioManagerEx: AudioManagerEx created
I/ListPopupWindow: Could not find method setEpicenterBounds(Rect) on PopupWindow. Oh well.
W/ResourceType: Failure getting entry for 0x7f07013a (t=6 e=314) (error -75)
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: com.czdev.booktimeline, PID: 15910
                  android.content.res.Resources$NotFoundException: Resource ID #0x7f07013a
                      at android.content.res.Resources.getValue(Resources.java:1401)
                      at android.support.v7.widget.AppCompatDrawableManager.loadDrawableFromDelegates(AppCompatDrawableManager.java:332)
                      at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:197)
                      at android.support.v7.widget.AppCompatDrawableManager.getDrawable(AppCompatDrawableManager.java:190)
                      at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:100)
                      at android.support.v7.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:425)
                      at android.support.v7.view.menu.ListMenuItemView.initialize(ListMenuItemView.java:116)
                      at android.support.v7.view.menu.MenuAdapter.getView(MenuAdapter.java:100)
                      at android.support.v7.view.menu.MenuPopup.measureIndividualMenuWidth(MenuPopup.java:160)
                      at android.support.v7.view.menu.StandardMenuPopup.tryShow(StandardMenuPopup.java:153)
                      at android.support.v7.view.menu.StandardMenuPopup.show(StandardMenuPopup.java:187)
                      at android.support.v7.view.menu.MenuPopupHelper.showPopup(MenuPopupHelper.java:290)
                      at android.support.v7.view.menu.MenuPopupHelper.tryShow(MenuPopupHelper.java:175)
                      at android.support.v7.widget.ActionMenuPresenter$OpenOverflowRunnable.run(ActionMenuPresenter.java:803)
                      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:5525)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
Application terminated.

Here is my Gradle:

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.oss.licenses.plugin'

android {
    compileSdkVersion 27
    defaultConfig {
        applicationId "<com.android.application>"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 25
        versionName "0.8"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.google.android.gms:play-services-oss-licenses:15.0.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:support-vector-drawable:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation 'com.github.bumptech.glide:glide:4.7.1'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'

}
repositories {
    mavenCentral()
}

Here is my first fragment:

public class HomeFrag extends Fragment {

    View rootView;

    public HomeFrag() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.fragment_home, container, false);

        Toolbar toolbar = (Toolbar) rootView.findViewById(R.id.toolbar);
        toolbar.setTitle(R.string.app_name);

        ((MainActivity) Objects.requireNonNull(getActivity())).setSupportActionBar(toolbar);
        setHasOptionsMenu(true);

        return rootView;
    }

    @Override
    public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
        inflater.inflate(R.menu.main_menu, menu);
        super.onCreateOptionsMenu(menu, inflater);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();

        if (id == R.id.menu_action_info) {
            startActivity(new Intent(getContext(), InfoMenu.class));
            return true;
        }
        return super.onOptionsItemSelected(item);
    }
}

Here is my menu:

<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto" >
    <item
        android:id="@+id/menu_action_info"
        android:icon="@drawable/ic_info_outline_white_24dp"
        android:orderInCategory="100"
        android:title="@string/menu_info_action"
        app:showAsAction="never" />
</menu>

Any ideas would be great.

rogue5_
  • 13
  • 2
  • Check Resources.java at line 1401, that is where the problem is – Kristofer May 13 '18 at 00:08
  • Have you tried uninstalling the app from both devices and run the app again...? – Xenolion May 13 '18 at 00:09
  • @Kristofer that line is in a comment area of the class about themes... When I get back home I will edit and post that part. – rogue5_ May 13 '18 at 00:42
  • @Xenolion yes I have. There is no issue on the S8 phone, only the G4. I only noticed this after I installed on the G4 in testing before going to publish it. I though everything was good since it was all working on the S8 – rogue5_ May 13 '18 at 00:44
  • If the problem happens in Android 6 only, Try checking the Manifest. Or you can add it here! – Xenolion May 13 '18 at 00:49

1 Answers1

0

From the crash logs , it seems its failing to load the icon

at android.support.v7.content.res.AppCompatResources.getDrawable(AppCompatResources.java:100) at android.support.v7.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:425)

Can you please check your R.java for Resource ID #0x7f07013a , it will tell you exactly which resource is failing to load, my guess is the icon is missing in a particular drawable folder.

Ankit

  • Ding Ding Ding! I literally was editing my post when the notification came in with your comment. as I was going down the line while posting the Resources.java code, I suspected this. i wasn't using the icon anyways, so i removed it from the menu xml and it's working. Thanks! – rogue5_ May 13 '18 at 01:35