我在崩溃报告中遇到了这个崩溃:
Exception java.lang.NoClassDefFoundError: pim
pil.<clinit> (SourceFile:2)
pij.onAnimationEnd (SourceFile:10)
android.animation.AnimatorSet$AnimatorSetListener.onAnimationEnd (AnimatorSet.java:818)
android.animation.ValueAnimator.endAnimation (ValueAnimator.java:1056)
android.animation.ValueAnimator.access$400 (ValueAnimator.java:50)
android.animation.ValueAnimator$AnimationHandler.doAnimationFrame (ValueAnimator.java:644)
android.animation.ValueAnimator$AnimationHandler.run (ValueAnimator.java:660)
android.view.Choreographer$CallbackRecord.run (Choreographer.java:761)
android.view.Choreographer.doCallbacks (Choreographer.java:574)
android.view.Choreographer.doFrame (Choreographer.java:543)
android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:747)
android.os.Handler.handleCallback (Handler.java:733)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:136)
android.app.ActivityThread.main (ActivityThread.java:5154)
java.lang.reflect.Method.invokeNative (Method.java)
java.lang.reflect.Method.invoke (Method.java:515)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:732)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:566)
dalvik.system.NativeStart.main (NativeStart.java)
在我将 recyclelView 添加到我的布局和更多代码后开始发生这种情况,但我怀疑它:
com.testapp.MyRecyclerView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/recycleViewImages"
这是我的自定义 recyclerview,但即使使用常规 recyclerview(不是我的自定义)也会发生此错误
这是我的自定义 View 的代码:
public class MyRecyclerView extends RecyclerView {
private FirebaseAnalytics mFirebaseAnalytics = null;
public MyRecyclerView(Context context) {
super(context);
if (mFirebaseAnalytics == null && context != null) {
mFirebaseAnalytics = FirebaseAnalytics.getInstance(context);
}
}
public MyRecyclerView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
if (mFirebaseAnalytics == null && context != null) {
mFirebaseAnalytics = FirebaseAnalytics.getInstance(context);
}
}
public MyRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
if (mFirebaseAnalytics == null && context != null) {
mFirebaseAnalytics = FirebaseAnalytics.getInstance(context);
}
}
@Override
protected void onAnimationEnd() {
try {
super.onAnimationEnd();
}
catch (Exception e) {
Log.d("erez", "animation onAnimationEnd");
if (mFirebaseAnalytics != null && e != null && e.getMessage() != null) {
Bundle bundleCatch = new Bundle();
bundleCatch.putString(FirebaseAnalytics.Param.ITEM_ID, "myrecycleview e: " + e.getMessage());
bundleCatch.putString(FirebaseAnalytics.Param.ITEM_NAME, "myrecycleview e: " + e.getMessage());
bundleCatch.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "onAnimationEnd catched");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundleCatch);
}
}
catch (NoClassDefFoundError ncdfe) {
if (mFirebaseAnalytics != null && ncdfe != null && ncdfe.getMessage() != null) {
Bundle bundleCatch = new Bundle();
bundleCatch.putString(FirebaseAnalytics.Param.ITEM_ID, "myrecycleview ncdfe: " + ncdfe.getMessage());
bundleCatch.putString(FirebaseAnalytics.Param.ITEM_NAME, "myrecycleview ncdfe: " + ncdfe.getMessage());
bundleCatch.putString(FirebaseAnalytics.Param.CONTENT_TYPE, "onAnimationEnd catched");
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.SELECT_CONTENT, bundleCatch);
}
}
}
}
如您所见,我正在尝试覆盖 onAnimationEnd 以便将捕获日志写入 firebase,但它没有被捕获并仍然为用户崩溃。
无论如何,这个 MyRecyclerView 在我的 Activity 中作为成员持有:
我通过 findViewById 设置它,然后:
LinearLayoutManager layoutManager = new LinearLayoutManager(Player.this);
if (mScreenOrientation == Configuration.ORIENTATION_PORTRAIT) {
layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
} else if (mScreenOrientation == Configuration.ORIENTATION_LANDSCAPE) {
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
}
mRecycleViewPreviewedVideos.setLayoutManager(layoutManager);
然后我设置它的适配器,就像用户在这里看到的那样。没什么特别的。 我知道 View 有一个名为 onAnimationEnd 的方法,但它从未在我的智能手机中到达它。它主要只在 Api 19 上达到。 (以及 17 和 18)。
有人遇到过这种崩溃吗?如何解决?
我在这里报告了这个错误:https://issuetracker.google.com/issues/73048586
最佳答案
所以我向 Google 报告了这个问题,现在他们回复说该错误已修复! :-) 我想不需要更新库,因为没有可用的更新。此外,我还尝试使用 YouTube API 的 old 库,但遇到了同样的崩溃,因此与该库有关系。 Google 写信给我:“开发团队已修复您报告的问题,并将在未来的版本中提供。”
关于java - 异常 java.lang.NoClassDefFoundError : pim,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48674311/
我真的很习惯使用Ruby编写以下代码:my_hash={}my_hash['test']=1Java中对应的数据结构是什么? 最佳答案 HashMapmap=newHashMap();map.put("test",1);我假设? 关于java-等价于Java中的RubyHash,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/22737685/
我正在学习Rails,并阅读了关于乐观锁的内容。我已将类型为integer的lock_version列添加到我的articles表中。但现在每当我第一次尝试更新记录时,我都会收到StaleObjectError异常。这是我的迁移:classAddLockVersionToArticle当我尝试通过Rails控制台更新文章时:article=Article.first=>#我这样做:article.title="newtitle"article.save我明白了:(0.3ms)begintransaction(0.3ms)UPDATE"articles"SET"title"='dwdwd
在Cooper的书BeginningRuby中,第166页有一个我无法重现的示例。classSongincludeComparableattr_accessor:lengthdef(other)@lengthother.lengthenddefinitialize(song_name,length)@song_name=song_name@length=lengthendenda=Song.new('Rockaroundtheclock',143)b=Song.new('BohemianRhapsody',544)c=Song.new('MinuteWaltz',60)a.betwee
我早就知道Ruby中的“常量”(即大写的变量名)不是真正常量。与其他编程语言一样,对对象的引用是唯一存储在变量/常量中的东西。(侧边栏:Ruby确实具有“卡住”引用对象不被修改的功能,据我所知,许多其他语言都没有提供这种功能。)所以这是我的问题:当您将一个值重新分配给常量时,您会收到如下警告:>>FOO='bar'=>"bar">>FOO='baz'(irb):2:warning:alreadyinitializedconstantFOO=>"baz"有没有办法强制Ruby抛出异常而不是打印警告?很难弄清楚为什么有时会发生重新分配。 最佳答案
我正在尝试使用boilerpipe来自JRuby。我看过guide从JRuby调用Java,并成功地将它与另一个Java包一起使用,但无法弄清楚为什么同样的东西不能用于boilerpipe。我正在尝试基本上从JRuby中执行与此Java等效的操作:URLurl=newURL("http://www.example.com/some-location/index.html");Stringtext=ArticleExtractor.INSTANCE.getText(url);在JRuby中试过这个:require'java'url=java.net.URL.new("http://www
我只想对我一直在思考的这个问题有其他意见,例如我有classuser_controller和classuserclassUserattr_accessor:name,:usernameendclassUserController//dosomethingaboutanythingaboutusersend问题是我的User类中是否应该有逻辑user=User.newuser.do_something(user1)oritshouldbeuser_controller=UserController.newuser_controller.do_something(user1,user2)我
什么是ruby的rack或python的Java的wsgi?还有一个路由库。 最佳答案 来自Python标准PEP333:Bycontrast,althoughJavahasjustasmanywebapplicationframeworksavailable,Java's"servlet"APImakesitpossibleforapplicationswrittenwithanyJavawebapplicationframeworktoruninanywebserverthatsupportstheservletAPI.ht
这篇文章是继上一篇文章“Observability:从零开始创建Java微服务并监控它(一)”的续篇。在上一篇文章中,我们讲述了如何创建一个Javaweb应用,并使用Filebeat来收集应用所生成的日志。在今天的文章中,我来详述如何收集应用的指标,使用APM来监控应用并监督web服务的在线情况。源码可以在地址 https://github.com/liu-xiao-guo/java_observability 进行下载。摄入指标指标被视为可以随时更改的时间点值。当前请求的数量可以改变任何毫秒。你可能有1000个请求的峰值,然后一切都回到一个请求。这也意味着这些指标可能不准确,你还想提取最小/
HashMap中为什么引入红黑树,而不是AVL树呢1.概述开始学习这个知识点之前我们需要知道,在JDK1.8以及之前,针对HashMap有什么不同。JDK1.7的时候,HashMap的底层实现是数组+链表JDK1.8的时候,HashMap的底层实现是数组+链表+红黑树我们要思考一个问题,为什么要从链表转为红黑树呢。首先先让我们了解下链表有什么不好???2.链表上述的截图其实就是链表的结构,我们来看下链表的增删改查的时间复杂度增:因为链表不是线性结构,所以每次添加的时候,只需要移动一个节点,所以可以理解为复杂度是N(1)删:算法时间复杂度跟增保持一致查:既然是非线性结构,所以查询某一个节点的时候
SPI接收数据左移一位问题目录SPI接收数据左移一位问题一、问题描述二、问题分析三、探究原理四、经验总结最近在工作在学习调试SPI的过程中遇到一个问题——接收数据整体向左移了一位(1bit)。SPI数据收发是数据交换,因此接收数据时从第二个字节开始才是有效数据,也就是数据整体向右移一个字节(1byte)。请教前辈之后也没有得到解决,通过在网上查阅前人经验终于解决问题,所以写一个避坑经验总结。实际背景:MCU与一款芯片使用spi通信,MCU作为主机,芯片作为从机。这款芯片采用的是它规定的六线SPI,多了两根线:RDY和INT,这样从机就可以主动请求主机给主机发送数据了。一、问题描述根据从机芯片手