AndroidStudio错误记录

Android dependency ‘com.android.support:support-fragment‘ has different version for the compile (25.3.1) and runtime (26.1.0) classpath. You should manually set the same version via DependencyResolution

这是引用了不同版本的v4包造成的


Caused by : android . view.InflateException: Binary XML file line #2

如果是从低版本升级到高版本AS出现的这个错误,把图片资源从drawable放到mipmap里


android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

添加intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); 


java.lang.RuntimeException: Unable to start service com.speedata.huanxin.service.VoiceService@a1fc4d0 with Intent { cmp=com.speedata.huanxin/.service.VoiceService }: org.greenrobot.eventbus.EventBusException: Subscriber class com.speedata.huanxin.service.VoiceService already registered to event class com.speedata.huanxin.domain.MsgEvent

Caused by: org.greenrobot.eventbus.EventBusException: Subscriber class com.speedata.huanxin.service.VoiceService already registered to event class com.speedata.huanxin.domain.MsgEvent

Service使用EventBus时注册放在onBind方法里


Error:A problem was found with the configuration of task ':app:packageRelease'.File '

> F:\AndroidStudioProjects\sun\SunshineCarLife\app\build\intermediates\res\resources-release-stripped.ap_'

> specified for property 'resourceFile' does not exist

build里shrinkResources false //改为false 就解决了


Error:Program type already present:

检查项目引用的jar包和第三方框架之间是否引用了相同的包


R文件报红,但是程序能够运行

修改build.gradle里 classpath版本号 

dependencies {

classpath'com.android.tools.build:gradle:3.2.1'

}



Tinker does not support instant run mode, please trigger build by assembleDebug or disable instant run in 'File->Settings...'.

关闭Instant Run


java.lang.NoSuchFieldError: No static field material_type_img of type I in class Lcom/offcn/module_material/R$id; or its superclasses (declaration of 'com.offcn.module_material.R$id' appears in /data/app/com.offcn.android.yikaowangxiao-QLmpif3bjc2IXUpPTsp0hw==/base.apk!classes2.dex)

或者

Caused by: java.lang.IllegalStateException: Required view 'iv_head_back' with ID 2131296706 for field 'iv_head_back' and method 'onViewClicked' was not found. If this view is optional add '@Nullable' (fields) or '@Optional' (methods) annotation.

Butterknife这个框架报错原因:

整个程序中包括其他Module不能有相同名称的layout


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Correctness AdapterViewChildren Summary: AdapterViews can...
    MarcusMa阅读 8,925评论 0 6
  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,523评论 25 708
  • 用两张图告诉你,为什么你的 App 会卡顿? - Android - 掘金 Cover 有什么料? 从这篇文章中你...
    hw1212阅读 12,971评论 2 59
  • To 小柚子: 和你的第一次见面,是和大豆一起,在建环楼下,等待着我们的第一次面试。你十分灿烂的笑容将我们面试的紧...
    外联一家人阅读 197评论 0 0
  • 女人到了一定年龄就开始彷徨,到底应该选择一个爱自己的,还是坚持选择自己爱的那一个? 主持人黄执中这样说: ...
    白白鹭阅读 528评论 2 1