小编J-Y*_*Yen的帖子

无法在lapism/SearchView中的null对象上调用void android.view.View.setElevation(float)

我正在我的项目中使用library lapism/SearchView(https://github.com/lapism/SearchView).但我只在Android 5.0上获得了运行时异常:

A/art: art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: can't call void android.view.View.setElevation(float) on null object
A/art: art/runtime/check_jni.cc:65]     in call to CallVoidMethodV
A/art: art/runtime/check_jni.cc:65]     from void android.animation.PropertyValuesHolder.nCallFloatMethod(java.lang.Object, long, float)
A/art: art/runtime/check_jni.cc:65] "main" prio=5 tid=1 Runnable
A/art: art/runtime/check_jni.cc:65]   | group="main" sCount=0 dsCount=0 obj=0x757838b0 self=0xb8994958
A/art: art/runtime/check_jni.cc:65]   | sysTid=28467 nice=0 cgrp=apps sched=0/0 handle=0xb6f80058
A/art: art/runtime/check_jni.cc:65]   | state=R schedstat=( 0 0 0 ) utm=27 stm=10 core=1 HZ=100
A/art: art/runtime/check_jni.cc:65]   | stack=0xbe01e000-0xbe020000 stackSize=8MB
A/art: art/runtime/check_jni.cc:65]   | held mutexes= "mutator lock"(shared held) …
Run Code Online (Sandbox Code Playgroud)

android searchview android-5.0-lollipop

24
推荐指数
1
解决办法
4032
查看次数

"错误"类型中不存在属性"代码"

我如何访问Error.code属性?我得到一个Typescript错误,因为属性'code'在'Error'类型上不存在.

this.authCtrl.login(user, {
   provider: AuthProviders.Password,
   method: AuthMethods.Password
}).then((authData) => {
    //Success
}).catch((error) => {
   console.log(error); // I see a code property
   console.log(error.code); //error
})
Run Code Online (Sandbox Code Playgroud)

或者有另一种方法来制作自定义错误消息吗?我想用另一种语言显示错误.

firebase typescript angularfire2 angular

4
推荐指数
2
解决办法
2744
查看次数