Android之BuildConfig.DEBUG的用处

 

Android 开发中一般会通过 BuildConfig.DEBUG 判断是否是 Debug 模式,从而做一些在 Debug 模式才开启的特殊操作,比如打印日志。这样好处是不用在发布前去主动        修改,因为这个值在 Debug 模式下为 true,Release 模式下为 false。【http://www.cnblogs.com/zhujiabin/p/6874508.html

aar包可以获取jar包

解压classes.jar,重命名

recyclerview单独分离出来com.android.support:recyclerview-v7:25.0.0

The import android.support.v7.app.AlertDialog collides with another import statement

import android.app.AlertDialog;存在则会冲突

【PermissionsDispatcher第三方库】android 6.0运行时权限

com.github.hotchemi:permissionsdispatcher:2.4.0

butterknife-8.4.0.jar缺少butterknife.BindView,butterknife.OnClick

不能使用@BindView,@OnClick

Remove the need for the binder class | JakeWharton committed on Aug 23 2016

Remove Finder and always rely on a View as the source. | JakeWharton committed on Aug 23 2016

原因可能是;不建议使用ButterKnife , 它是通过反射来查找对应的View,使得App效率大大降低;建议使用能自动生成        findViewById的插件来简化开发工作

R文件生成不完整

xml引用别的xml定义的属性不存在,eclipse不会红叉提示

可以将红叉的代码全注释掉,clean后会在console中提示

values\styles.xml:30: error: Error: No resource found that matches the given name (at 'android:textColor' with value '@color/md_black').

补充之后,问题解决

将findViewById放在onCreate之外,会导致默认的MainActivity.this还未初始化

java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.Window.findViewById(int)' on a null object reference

Didn't find class "android.support.v4.widget.ScrollerCompatGingerbread"

support-v4-24.0.0.jar没有这个类

  support-v4-24.0.0.aar包中support-v4-24.0.0.jar和internal_impl-24.0.0.jar  后者有这个类

Didn't find class "android.support.v7.recyclerview.R$styleable"

aar包中有个xml文件,添加到工程,并不能解决问题,还是需要lib当中的R

eclipse只能导入21.0.0的才可以使用 【http://blog.csdn.net/chenleicpp/article/details/46848785

猜你喜欢

转载自blog.csdn.net/u010144805/article/details/81557594