Android App running fine via debugging installation but crashes in case of created app(android-debug.apk)

时间:2019-03-19 14:46:20

标签: android firebase android-fragments android-runtime

Application is crashing when apk is created and installed in my phone. But works fine when is run with usb debugging.

java.lang.RuntimeException: java.lang.NoSuchMethodException: <init> [class android.view.View]
            at com.firebase.ui.database.FirebaseRecyclerAdapter.onCreateViewHolder(FirebaseRecyclerAdapter.java:165)
            at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6794)
            at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5975)
            at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
            at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
            at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
            at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1557)
            at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
            at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
            at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
            at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3336)
            at android.view.View.measure(View.java:22344)
            at android.support.v4.widget.NestedScrollView.measureChildWithMargins(NestedScrollView.java:1502)
            at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
            at android.support.v4.widget.NestedScrollView.onMeasure(NestedScrollView.java:556)
            at android.view.View.measure(View.java:22344)
            at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6704)
            at android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:733)
            at android.support.design.widget.HeaderScrollingViewBehavior.onMeasureChild(HeaderScrollingViewBehavior.java:95)
            at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onMeasureChild(AppBarLayout.java:1556)
            at android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:803)

Tried changing build Versions no code error

Please Help!!!

logcat here

link to MainActivity.java

link to HomeFragment.java

link to Manifest

link to build.gradle

1 个答案:

答案 0 :(得分:0)

尝试一些事情:

  1. 确保您的itemsfacility_items类是公开的。如果它们是内部类,则将它们设置为静态。
  2. 生成签名的apk,然后将其安装在设备中并运行。

在此处看到类似的问题:https://github.com/firebase/FirebaseUI-Android/issues/46

希望这会有所帮助