Android(安卓)打包出错 failed for task ':app:lintVitalRelease'
16lz
2021-12-04
E:\Project\AndroidStudioProjects\FaceDetection\app\build.gradle: Error: json defines classes that conflict with classes now provided by Android. Solutions include finding newer versions or alternative libraries that don't have the same problem (for example, for httpclient use HttpUrlConnection or okhttp instead), or repackaging the library using something like jarjar. [DuplicatePlatformClasses] Explanation for issues of type "DuplicatePlatformClasses": There are a number of libraries that duplicate not just functionality of the Android platform but using the exact same class names as the ones provided in Android -- for example the apache http classes. This can lead to unexpected crashes. To solve this, you need to either find a newer version of the library which no longer has this problem, or to repackage the library (and all of its dependencies) using something like the jarjar tool, or finally, rewriting the code to use different APIs (for example, for http code, consider using HttpUrlConnection or a library like okhttp).1 errors, 0 warnings:app:lintVitalRelease FAILEDFAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:lintVitalRelease'.> Lint found fatal errors while assembling a release target. To proceed, either fix the issues identified by lint, or modify your build script as follows: ... android { lintOptions { checkReleaseBuilds false // Or, if you prefer, you can continue to check for errors in release builds, // but continue the build even when errors are found: abortOnError false } }
解决方法:build.gradle添加如下配置,参考各自项目jks文件细节:
signingConfigs { config { keyAlias 'key0' keyPassword '123456' storeFile file('E:/Project/AndroidStudioProjects/FaceDetection/fc.jks') storePassword '123456' } } lintOptions { checkReleaseBuilds false // Or, if you prefer, you can continue to check for errors in release builds, // but continue the build even when errors are found: abortOnError false }
更多相关文章
- Android(安卓)问题集合
- android实现拨打电话
- Android启动时启动Activity 的定义的位置
- android string.xml中添加特殊字符
- Android(安卓)原生SQLite数据库操作实战
- android个人错误,持续更新
- Android(安卓)项目混编flutter报错
- 高德地图Android,绘制自定义定位蓝点、marker、面
- Android(安卓)ProgressDialog