小编Fun*_*LAM的帖子

com.google.android.gms.internal.firebase-perf.zzw上的NoClassDefFoundError

从Firebase Crashlytics收到了大量的崩溃报告.我觉得它与firebase-perf有关.

Fatal Exception: java.lang.NoClassDefFoundError: com.google.android.gms.internal.firebase-perf.zzw
   at com.google.firebase.perf.metrics.Trace.start(Unknown Source:44)
   at com.google.android.gms.internal.firebase-perf.zze.onActivityStarted(Unknown Source:48)
   at android.app.Application.dispatchActivityStarted(Application.java:205)
   at android.app.Activity.onStart(Activity.java:1150)
Run Code Online (Sandbox Code Playgroud)

已经使用最新版本的Firebase和Google Play服务.

它不会在Firebase测试实验室中的设备上崩溃.但约有1%的用户面临这个问题.

是否与缺少GMS Core有关?如果是这样,如何正确处理它,不会导致这些设备崩溃?

---更新---

project build.gradle

buildscript {
    repositories {
        google()
        maven {
            url 'https://maven.fabric.io/public'
        }
        jcenter()

    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0-alpha04'
        classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
        classpath 'com.google.firebase:firebase-plugins:1.1.5'
        classpath 'io.fabric.tools:gradle:1.25.4'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
Run Code Online (Sandbox Code Playgroud)

App build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
apply plugin: 'io.fabric' …
Run Code Online (Sandbox Code Playgroud)

android firebase google-play-services firebase-performance

21
推荐指数
2
解决办法
2097
查看次数

NestedScroll与NestedScrollView,RecyclerView(水平),在CoordinatorLayout内

我有一个使用CollapsingToolbarLayout的UI设计,如下所示.

<android.support.design.widget.AppBarLayout
    android:id="@+id/appbar"
    android:layout_width="match_parent"
    android:layout_height="@dimen/detail_backdrop_height"
    android:fitsSystemWindows="true"
    android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

    <android.support.design.widget.CollapsingToolbarLayout

        android:id="@+id/collapsing_toolbar"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        app:contentScrim="?attr/colorPrimary"
        app:expandedTitleMarginEnd="64dp"
        app:expandedTitleMarginStart="48dp"
        app:layout_scrollFlags="scroll|exitUntilCollapsed">

        <ImageView
            android:id="@+id/backdrop"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            android:scaleType="centerCrop"
            app:layout_collapseMode="parallax" />

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            app:layout_collapseMode="pin"
            app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />

    </android.support.design.widget.CollapsingToolbarLayout>

</android.support.design.widget.AppBarLayout>

<android.support.v4.widget.NestedScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:fillViewport="true"
    android:theme="@style/ThemeOverlay.AppCompat.Light"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingTop="24dp">

        <!-- Hiding unrelated code -->

        <android.support.v7.widget.CardView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="@dimen/card_margin"
            android:padding="16dp">


                <android.support.v7.widget.RecyclerView
                    android:id="@+id/recycler_movie_suggestion"
                    android:layout_width="match_parent"
                    android:layout_height="170dp"
                    android:fillViewport="true"
                    android:nestedScrollingEnabled="false"
                    app:layout_behavior="@string/appbar_scrolling_view_behavior" />

            </LinearLayout>

        </android.support.v7.widget.CardView>

    </LinearLayout>

</android.support.v4.widget.NestedScrollView>
Run Code Online (Sandbox Code Playgroud)

我的问题是,只有当我触摸并滚动RecyclerView外面的区域时滚动才能正常.如果我尝试在RecyclerView内部垂直滚动,则滚动"陷阱"并且只有NestedScrollView滚动,CollaspingToolbarLayout不会重叠.

android android-recyclerview coordinator-layout nestedscrollview

13
推荐指数
1
解决办法
1万
查看次数

CollapsingToolbarLayout with Image,固定宽高比

我在CollapsingToolbarLayout中有一个图像(与示例https://github.com/chrisbanes/cheesesquare相同).

但是,我想将背景的宽高比固定为16:9.

我尝试设置android:layout_height="wrap_content",更新LayoutParams代码,但它不起作用.

有帮助吗?

android android-appbarlayout

7
推荐指数
1
解决办法
696
查看次数