在Android Studio 3上进行发布构建时出现以下错误
错误:错误:json定义的类与Android现在提供的类冲突.解决方案包括查找没有相同问题的更新版本或替代库(例如,对于httpclient使用HttpUrlConnection或okhttp),或者使用jarjar之类的东西重新打包库.[DuplicatePlatformClasses]
以下是我的依赖项:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support:support-v4:26.0.1'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
compile 'com.evernote:android-job:1.2.0'
compile 'com.amitshekhar.android:android-networking:1.0.0'
compile 'com.facebook.stetho:stetho:1.5.0'
compile "me.tatarka.redux:redux-core:0.10"
compile "me.tatarka.redux:redux-android:0.10"
compile "me.tatarka.redux:redux-android-lifecycle:0.10"
compile "me.tatarka.redux:redux-thunk:0.10"
annotationProcessor "org.immutables:value:2.5.5" // <-- for annotation processor
provided "org.immutables:value:2.5.5" // for annotations
provided "org.immutables:builder:2.5.5" // for annotations
compile "me.tatarka.redux:redux-monitor:0.10"
testCompile 'junit:junit:4.12'
}
Run Code Online (Sandbox Code Playgroud)
它说的是json,但是我找不到上面哪个依赖项导致问题.
这是我跑步时得到的
gradlew assembleRelease
Run Code Online (Sandbox Code Playgroud)
任务:app:lintVitalRelease /Users/kruyvanna/Projects/key/HappyKey_Android2/app/build.gradle:错误:json定义的类与Android现在提供的类冲突.解决方案包括查找没有相同问题的更新版本或替代库(例如,对于httpclient使用HttpUrlConnection或okhttp),或者使用jarjar之类的东西重新打包库.[DuplicatePlatformClasses]
"DuplicatePlatformClasses"类型问题的解释:有许多库不仅复制Android平台的功能,而且使用与Android中提供的类名完全相同的类名 - 例如apache http类.这可能会导致意外崩溃.
要解决这个问题,您需要找到不再存在此问题的库的较新版本,或者使用jarjar工具重新打包库(及其所有依赖项),或者最后重写代码以使用不同的API(例如,对于http代码,请考虑使用HttpUrlConnection或类似okhttp的库.)
1个错误,0个警告
FAILURE:构建因异常而失败.
出了什么问题:任务执行失败':app:lintVitalRelease'.
Lint在组装释放目标时发现致命错误.
要继续,要么修复lint标识的问题,要么修改构建脚本,如下所示:... …
我尝试运行 NestJs 测试,但出现以下错误
Nest can't resolve dependencies of the (?). Please make sure that the argument at index [0] is available in the RootTestModule context.
该项目使用 Mongoose 连接到 MongoDB
您可以通过运行此存储库中的代码来重现错误 https://github.com/kruyvanna/nestjs-test-error
先感谢您