android as gradle 使用过称中 错误处理
16lz
2021-01-25
阅读更多
1.出现以下错误
在 gradle 中添加
configurations.all { resolutionStrategy.force 'com.google.code.findbugs:jsr305:2.0.1' }
2.出现 com.android.ide.common.process.ProcessException错误
这个问题的出现是在将eclipse项目导入到Android Studio中,由(.9.png)图片造成的,现在的解决方法是将其换成png图片
该问题出现原因 是 你引用了 盗来的 .9.png 非正规渠道的美工图片
3. Error:(1, 1) 错误: 非法字符: '\ufeff'
没有看见 明显 乱码错误等
文件 内部 编码格式 ,重新 新建该类,并把内容 复制进去 ,即可解决
4. 一下 错误
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/LICENSEFile1: I:\cache\ai-w\IteyeBlog\app\libs\httpclient-4.3.5.jarFile2: I:\cache\ai-w\IteyeBlog\app\libs\httpcore-4.3.2.jarFile3: I:\cache\ai-w\IteyeBlog\app\libs\httpmime-4.3.5.jarFile4: I:\cache\ai-w\IteyeBlog\app\libs\jackson-all-1.6.0.jar
解决方法
packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' }
5.错误 包重复 Multiple
Error:indicate that it is *not* an inner class.Error:Execution failed for task ':app:transformClassesWithDexForDebug'.> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lorg/slf4j/impl/AndroidLoggerFactory;Information:BUILD FAILEDInformation:Total time: 9.049 secsInformation:89 errorsInformation:0 warningsInformation:See complete output in console
取出多余重复报,一般在 gradle 中配置两个包没有问题,但在lib 中添加了并在gradle 中存在就会报改错误
6.以下错误
Error:Execution failed for task ':app:transformClassesWithDexForBAIDUDebug'.> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
解决
defaultConfig { ... multiDexEnabled true ... }com.android.support:multidex:1.0.0
7. multidex NoClassDefFoundError 问题
public class MyApplication extends Application { public static MyApplication myApplication; public static MyApplication newInstance() { return myApplication; } @Override public void onCreate() { super.onCreate(); myApplication = this; } @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this); }}android { compileSdkVersion Integer.parseInt(COMPILE_SDK_VERSION) buildToolsVersion BUILD_TOOLS_VERSION defaultConfig { applicationId "com.curiousby.baoyou.cn.iteyeblog" minSdkVersion SAMPLE_MIN_SDK_VERSION targetSdkVersion SAMPLE_TARGET_SDK_VERSION versionCode 3 versionName "3.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled true }} compile 'com.android.support:multidex:1.0.1'
捐助开发者
在兴趣的驱动下,写一个免费
的东西,有欣喜,也还有汗水,希望你喜欢我的作品,同时也能支持一下。 当然,有钱捧个钱场(支持支付宝和微信捐助,加入it技术扣扣群),没钱捧个人场,谢谢各位。
谢谢您的赞助,我会做的更好!
- 查看图片附件
更多相关文章
- android轮播图封装 (网络图片glide解析,手势触摸,三种viewpager
- 新浪下载图片的ProgressBar进度样式源码
- android错误:The method makeText(Context, CharSequence, int) i
- Hello Android(安卓)- Bitmap转换为黑白的灰度图和加圆角效果
- Android错误解决方法之:Debug certificate expired on
- Android(安卓)requires compiler compliance level 5.0 or 6.0.
- 【Android(安卓)开发教程】Gallery和ImageView
- Android(安卓)Bitmap 缩放 旋转 水印 裁剪操作
- Android(安卓)批量上传sd卡图片