AndroidStudio错误记录

2018-11-20  本文已影响0人  Jumping_张明

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


上一篇 下一篇

猜你喜欢

热点阅读