从 crashlytics 迁移到 firebase SDK 并升级 gradle 插件版本时,仅在启用 r8 的发布版本上发生此崩溃
注意:我在 build.gradle 以及应用程序类中定义和设置了 multidex 依赖项。仅当我将 gradle 插件版本从 3.5 升级到 4.1 时才会发生这种情况
我正在使用 firebase-crashlytics 版本
implementation 'com.google.firebase:firebase-crashlytics:17.0.0'
Run Code Online (Sandbox Code Playgroud)
等级插件版本
classpath 'com.android.tools.build:gradle:4.0.1'
Run Code Online (Sandbox Code Playgroud)
Crashlytics gradle 插件版本
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
Run Code Online (Sandbox Code Playgroud)
我还在 logcat 中收到警告
W/ComponentDiscovery: Class com.google.firebase.crashlytics.CrashlyticsRegistrar is not an found.
java.lang.ClassNotFoundException: com.google.firebase.crashlytics.CrashlyticsRegistrar
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.crashlytics.CrashlyticsRegistrar" on path: DexPathList
W/ComponentDiscovery: Class com.google.firebase.auth.FirebaseAuthRegistrar is not an found.
java.lang.ClassNotFoundException: com.google.firebase.auth.FirebaseAuthRegistrar
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.auth.FirebaseAuthRegistrar" on path: DexPathList
W/ComponentDiscovery: Class com.google.firebase.database.DatabaseRegistrar is not …Run Code Online (Sandbox Code Playgroud) 我正在寻找一种在 android 中为 chrome 选项卡设置用户代理的方法。我们可以在 webview 中做到这一点,但我的要求不希望我使用 webview。chrome选项卡中是否有任何公开的api,我可以在其中设置用户代理,与其他外部浏览器不同,我们无法控制设置用户代理。请帮忙。
我遇到了一个奇怪的问题。我有一个在 kotlin 中实现 Parcelable 接口的 A 类。
我将 A 类数组从一个活动传递到另一个活动,这里没有问题。
var arrayOfA:Array<A> // just to tell the type assume the array is initialised with the value
intent.putExtra("array", arrayOfA)
Run Code Online (Sandbox Code Playgroud)
但是,在另一个活动中接收它时,我无法将它分配给类型为 Array 的变量,它要求我在 A 为 Parcelable 类型时将其分配给 Array 为什么我无法将变量分配给它。
in second Activity
var arrayOfA:Array<A>?=null
arrayA=intent.get("array") as Array<A> // Problem here. Class cast exception
Run Code Online (Sandbox Code Playgroud)
我不明白为什么。有人可以在这里帮助我。我不想将变量的类型更改为数组,因为它有很多相互依赖。(这里的类只是一个演示)
========================================
class A(val a:String?,val b:String?):Parcelable {
constructor(parcel: Parcel) : this(
parcel.readString(),
parcel.readString()) {
}
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeString(a)
parcel.writeString(b)
}
override fun describeContents(): Int …Run Code Online (Sandbox Code Playgroud) <com.myapp.view.widgets.TextImageTextView
android:id="@+id/tv_on_boarding_step_one"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:gravity="center"
android:text="1"
app:layout_constraintBottom_toTopOf="@+id/appCompatButton"
app:layout_constraintEnd_toStartOf="@+id/space_one_two"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/label_description"
app:textAbove="Nitin" />
Run Code Online (Sandbox Code Playgroud)
这是我在xml中的自定义视图
以及将textAbove绑定到此视图的方法
@BindingAdapter("app:textAbove")
fun setTextAbove(view: TextImageTextView, textAbove: Int) {
// this is the method I have in my custom view
view.setTextAbove(view.context.getString(textAbove))
}
Run Code Online (Sandbox Code Playgroud)
但是当我编译它时,我收到错误:错误:找不到属性'app:textAbove'.
我正在使用Worklight,我正在努力了解什么是worklight服务器.
它在哪里?
当我们构建应用程序时,它会在服务器控制台中显示该应用程序已部署到Worklight Server.
最初我想为了有一个适配器,我们从自定义java类调用过程,这些需要部署到worklight服务器.但是,当我看到应用程序在真正的设备上工作时,那里没有与运行工作灯的本地服务器联系,我很震惊地看到应用程序从自定义类获取数据,即使它不在某些远程工作光服务器上.