/** * 可能会遇到的问题: * 1> * 退出登录(结束所有进程) * startActivity(new Intent(this, LoginActivity.class).setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK|Intent.FLAG_ACTIVITY_NEW_TASK)); * 2> * 引入Eclipse的项目 File----new---import—选择一个eclipseproject(必须是这个project最顶层的文件夹) * 然后会 报错:"There are unrecoverable errors which must be corrected first" * 这么改: * 把eclipse的project里面的the project.properties 删掉 android.library.reference.1=../appcompat_v7 * 然后引入到Android Studio里面之后把这句话加入到app/build.gradlefile: * dependencies{ compile "com.android.support:appcompat-v7:21.0.3" } * 有可能导入之后,说SDK不支持你的版本。这个时候你可以安装相应的平台, * 也可以修改app/build.gradle文件里面的额targetSDK版本,修改dependicies的版本 * 3> * 使用ButterKnife引入Dagger2后发现点击以及控件的查找均失效,主要是butterknife和dagger2都用到了annotation; * * 按照官方正常配置App的build * dependencies { * classpath 'com.android.tools.build:gradle:2.3.2' * //配置butterKnife * classpath 'com.jakewharton:butterknife-gradle-plugin:8.6.0' * //配置Dagger2 * classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' * } * 项目build中配置 * apply plugin: 'com.jakewharton.butterknife' * apply plugin: 'com.neenbedankt.android-apt' * * //在android中配置 * //解决Dagger2跟ButterKnife的冲突 * packagingOptions { * exclude 'META-INF/services/javax.annotation.processing.Processor' * } * * //配置ButterKnife:注意使用compile导包 : compile会编译到最后的APK或library,apt不会 * compile 'com.jakewharton:butterknife:8.6.0' * compile 'com.jakewharton:butterknife-compiler:8.6.0' * * //Dagger2的使用注意使用provided引用butterKnife中的library解决冲突 * compile 'org.glassfish:javax.annotation:10.0-b28' * compile 'com.google.dagger:dagger:2.5' * provided 'com.google.dagger:dagger-compiler:2.5' * */
杂记
最新推荐文章于 2021-05-27 12:30:52 发布
