romtsn / ArcNavigationView

Another approach to create NavigationDrawer with Material concepts
Apache License 2.0
678 stars 135 forks source link

A strange issue when run on a real phone #5

Closed thefullhorizon closed 7 years ago

thefullhorizon commented 7 years ago

When i integrate the code to my project as the usage , then run on a real phone. then the android studio showed me this: E/dalvikvm: Could not find class 'com.rom4ek.arcnavigationview.ArcNavigationView$1', referenced from method com.rom4ek.arcnavigationview.ArcNavigationView.calculateLayoutAndChildre It makes me being at sea , could give me some suggestions

romtsn commented 7 years ago

Hi there. Could you post a full stacktrace of the error?

thefullhorizon commented 7 years ago

After searching for a while on the stackoverflow, the possible issue, I think, could be the compatibility of NavigationView. On Android API 5.0.0 it ran ok ,while it failed on Android API 4.4.4. It functioned well on both API version above when i replaced NavigationView with a general Layout such as LinearLayout . I ran the demo of ArcNavigationView, it functioned well on both Android API 5.0.0 and Android API 4.4.4. So i guess the possible issue could be the settings of my project. Well, could you give me some suggestions.

When i used NavigationView as the left side view. the full stacktrace of the error is here.

03-18 18:09:38.575 27885-27885/com.nanshanstudio.dispalymd I/InstantRun: Instant Run Runtime started. Android package is com.nanshanstudio.dispalymd, real application class is null. 03-18 18:09:38.580 27885-27885/com.nanshanstudio.dispalymd W/InstantRun: No instant run dex files added to classpath 03-18 18:09:38.620 27885-27885/com.nanshanstudio.dispalymd I/dalvikvm: Could not find method android.view.Window$Callback.onProvideKeyboardShortcuts, referenced from method android.support.v7.view.WindowCallbackWrapper.onProvideKeyboardShortcuts 03-18 18:09:38.620 27885-27885/com.nanshanstudio.dispalymd W/dalvikvm: VFY: unable to resolve interface method 21420: Landroid/view/Window$Callback;.onProvideKeyboardShortcuts (Ljava/util/List;Landroid/view/Menu;I)V 03-18 18:09:38.620 27885-27885/com.nanshanstudio.dispalymd W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;) 03-18 18:09:38.620 27885-27885/com.nanshanstudio.dispalymd I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested 03-18 18:09:38.620 27885-27885/com.nanshanstudio.dispalymd W/dalvikvm: VFY: unable to resolve interface method 21422: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z 03-18 18:09:38.625 27885-27885/com.nanshanstudio.dispalymd I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode 03-18 18:09:38.625 27885-27885/com.nanshanstudio.dispalymd W/dalvikvm: VFY: unable to resolve interface method 21426: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode; 03-18 18:09:38.625 27885-27885/com.nanshanstudio.dispalymd I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations 03-18 18:09:38.625 27885-27885/com.nanshanstudio.dispalymd W/dalvikvm: VFY: unable to resolve virtual method 726: Landroid/content/res/TypedArray;.getChangingConfigurations ()I 03-18 18:09:38.625 27885-27885/com.nanshanstudio.dispalymd I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType 03-18 18:09:38.625 27885-27885/com.nanshanstudio.dispalymd W/dalvikvm: VFY: unable to resolve virtual method 748: Landroid/content/res/TypedArray;.getType (I)I 03-18 18:09:38.710 27885-27885/com.nanshanstudio.dispalymd I/dalvikvm-heap: Grow heap (frag case) to 39.016MB for 11933268-byte allocation 03-18 18:09:38.780 27885-27885/com.nanshanstudio.dispalymd I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable 03-18 18:09:38.780 27885-27885/com.nanshanstudio.dispalymd W/dalvikvm: VFY: unable to resolve virtual method 689: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable; 03-18 18:09:38.780 27885-27885/com.nanshanstudio.dispalymd I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity 03-18 18:09:38.780 27885-27885/com.nanshanstudio.dispalymd W/dalvikvm: VFY: unable to resolve virtual method 691: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable; 03-18 18:09:38.785 27885-27885/com.nanshanstudio.dispalymd I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method android.support.v7.content.res.AppCompatResources.getColorStateList 03-18 18:09:38.785 27885-27885/com.nanshanstudio.dispalymd W/dalvikvm: VFY: unable to resolve virtual method 455: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList; 03-18 18:09:41.035 27885-27885/com.nanshanstudio.dispalymd I/dalvikvm: Could not find method android.widget.FrameLayout., referenced from method com.ashokvarma.bottomnavigation.BottomNavigationBar. 03-18 18:09:41.035 27885-27885/com.nanshanstudio.dispalymd W/dalvikvm: VFY: unable to resolve direct method 21865: Landroid/widget/FrameLayout;. (Landroid/content/Context;Landroid/util/AttributeSet;II)V 03-18 18:09:41.040 27885-27885/com.nanshanstudio.dispalymd W/dalvikvm: VFY: unable to resolve static field 10293 (BOUNDS) in Landroid/view/ViewOutlineProvider; 03-18 18:09:41.085 27885-27885/com.nanshanstudio.dispalymd W/ResourceType: Failure getting entry for 0x7f02005d (t=1 e=93) in package 0 (error -75) 03-18 18:09:41.085 27885-27885/com.nanshanstudio.dispalymd W/ResourceType: Failure getting entry for 0x7f02005e (t=1 e=94) in package 0 (error -75) 03-18 18:09:41.085 27885-27885/com.nanshanstudio.dispalymd W/ResourceType: Failure getting entry for 0x7f020062 (t=1 e=98) in package 0 (error -75) 03-18 18:09:41.085 27885-27885/com.nanshanstudio.dispalymd W/ResourceType: Failure getting entry for 0x7f02005f (t=1 e=95) in package 0 (error -75) 03-18 18:09:41.085 27885-27885/com.nanshanstudio.dispalymd W/ResourceType: Failure getting entry for 0x7f020061 (t=1 e=97) in package 0 (error -75) 03-18 18:09:41.085 27885-27885/com.nanshanstudio.dispalymd W/ResourceType: Failure getting entry for 0x7f020060 (t=1 e=96) in package 0 (error -75) 03-18 18:09:41.085 27885-27885/com.nanshanstudio.dispalymd W/ResourceType: Failure getting entry for 0x7f02005d (t=1 e=93) in package 0 (error -75) 03-18 18:09:41.090 27885-27885/com.nanshanstudio.dispalymd W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x41e35c50) 03-18 18:09:47.075 27885-27885/com.nanshanstudio.dispalymd I/Process: Sending signal. PID: 27885 SIG: 9

the layout file I used below

<?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/navigation_drawer" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/colorPrimary">

<include
    android:id="@+id/tv_content"
    layout="@layout/drawer_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>

<com.rom4ek.arcnavigationview.ArcNavigationView
    android:id="@+id/nav_view"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:background="@android:color/white"
    app:itemBackground="@android:color/white"
    app:headerLayout="@layout/nav_header_main"
    app:menu="@menu/activity_main_drawer"
    app:arc_cropDirection="cropInside"
    app:arc_width="96dp"/>

//the layout refer to LinearLayout 
<include
    layout="@layout/drawer_menu_right"
    android:layout_width="300dp"
    android:layout_height="match_parent"
    android:layout_gravity="start" />

<include
    layout="@layout/drawer_menu_right"
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:layout_gravity="end" />

</android.support.v4.widget.DrawerLayout>

romtsn commented 7 years ago

As you can see from the log, you have problems with Instant Run. So try to disable it, and then run, or try to update gradle/android studio version. I will close the issue as it's not relevant to my library.