找不到类“android.app.Application$OnProvideAssistDataListener”

Posted

技术标签:

【中文标题】找不到类“android.app.Application$OnProvideAssistDataListener”【英文标题】:Could not find class 'android.app.Application$OnProvideAssistDataListener' 【发布时间】:2016-08-24 03:13:48 【问题描述】:

我正在使用 android studio 2.1。当我运行应用程序时,我收到了这种类型的错误。

04-29 10:47:50.870 20286-20286/com.demo.a_fatal E/Trace: error opening trace file: No such file or directory (2)
04-29 10:47:50.910 20286-20286/com.demo.a_fatal E/InstantRun: Could not find slices in APK; aborting.
04-29 10:47:50.920 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.app.Application$OnProvideAssistDataListener', referenced from method com.demo.a_fatal.applications.AFatalApp.access$super
04-29 10:47:50.920 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.app.Application$OnProvideAssistDataListener', referenced from method com.demo.a_fatal.applications.AFatalApp.access$super
04-29 10:47:51.010 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.util.ArrayMap', referenced from method com.android.tools.fd.runtime.MonkeyPatcher.monkeyPatchExistingResources
04-29 10:47:51.010 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.util.ArrayMap', referenced from method com.android.tools.fd.runtime.MonkeyPatcher.pruneResourceCache
04-29 10:47:51.080 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.demo.a_fatal.SplashActivity.access$super
04-29 10:47:51.080 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.demo.a_fatal.SplashActivity.access$super
04-29 10:47:51.080 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.media.session.MediaController', referenced from method com.demo.a_fatal.SplashActivity.access$super
04-29 10:47:51.080 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.widget.Toolbar', referenced from method com.demo.a_fatal.SplashActivity.access$super
04-29 10:47:51.090 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.app.ActivityManager$TaskDescription', referenced from method com.demo.a_fatal.SplashActivity.access$super
04-29 10:47:51.100 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.demo.a_fatal.SplashActivity.access$super
04-29 10:47:51.100 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.demo.a_fatal.SplashActivity.access$super
04-29 10:47:51.100 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.transition.TransitionManager', referenced from method com.demo.a_fatal.SplashActivity.access$super
04-29 10:47:51.100 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.demo.a_fatal.SplashActivity.access$super
04-29 10:47:51.110 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.app.assist.AssistContent', referenced from method com.demo.a_fatal.SplashActivity.access$super
04-29 10:47:51.110 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.view.SearchEvent', referenced from method com.demo.a_fatal.SplashActivity.access$super
04-29 10:47:51.110 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.demo.a_fatal.SplashActivity.access$super
04-29 10:47:51.130 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.demo.a_fatal.global.AFatalActivity.access$super
04-29 10:47:51.130 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.demo.a_fatal.global.AFatalActivity.access$super
04-29 10:47:51.130 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.media.session.MediaController', referenced from method com.demo.a_fatal.global.AFatalActivity.access$super
04-29 10:47:51.130 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.widget.Toolbar', referenced from method com.demo.a_fatal.global.AFatalActivity.access$super
04-29 10:47:51.130 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.app.ActivityManager$TaskDescription', referenced from method com.demo.a_fatal.global.AFatalActivity.access$super
04-29 10:47:51.130 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.demo.a_fatal.global.AFatalActivity.access$super
04-29 10:47:51.130 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method com.demo.a_fatal.global.AFatalActivity.access$super
04-29 10:47:51.130 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.transition.TransitionManager', referenced from method com.demo.a_fatal.global.AFatalActivity.access$super
04-29 10:47:51.130 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.app.SharedElementCallback', referenced from method com.demo.a_fatal.global.AFatalActivity.access$super
 04-29 10:47:51.140 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.app.assist.AssistContent', referenced from method com.demo.a_fatal.global.AFatalActivity.access$super
 04-29 10:47:51.150 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.view.SearchEvent', referenced from method com.demo.a_fatal.global.AFatalActivity.access$super
04-29 10:47:51.150 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.os.PersistableBundle', referenced from method  com.demo.a_fatal.global.AFatalActivity.access$super
04-29 10:47:51.160 20286-20286/com.demo.a_fatal E/dalvikvm: Could not find class 'android.view.SearchEvent', referenced from method com.demo.a_fatal.dialog.ProgressDialog.access$super

我该如何解决这个错误?

【问题讨论】:

***.com/questions/31342684/… 【参考方案1】:

see this。 我也遇到过这个问题,解决方法如下: 首先禁用“InstantRun”功能,然后点击“文件”菜单中的“Invalidate Cache/Restart”,卸载手机或模拟器中的apk就可以了,再重建它。然后就没有这样的错误了。事实上,这些错误对 apk 没有任何影响。

【讨论】:

【参考方案2】:

您遇到此问题是因为您尝试使用仅从 API 级别 21 可用的方法。问题是因为更改为 compileSdkVersion 22 并将 build.gradle 更新为 编译'com.android.support:appcompat-v7:22.0.0'

【讨论】:

以上是关于找不到类“android.app.Application$OnProvideAssistDataListener”的主要内容,如果未能解决你的问题,请参考以下文章

找不到 Spring Boot Mongo Reactive 类 - 找不到类 [org.springframework.data.mongodb.MongoDatabaseFactory]

找不到xml找不到类

java 主启动类找不到

找不到类 'dalvik.system....'

eclipse 保存后就找不到类

找不到类“Fideloper\Proxy\TrustProxies”