我接手了一个项目,它不编译。当我构建它时,我得到了以下错误:
已存在的程序类型:com.google.gson.exclusionStrategy
下面是该项目的构建。gradle应用插件:'com.android.application'
def app_version = 'v0.0.1'
def version = '0.0.1
android {
compileSdkVersion project.ext.globalCompileSdkVersion
buildToolsVersion project.ext.globalBuildToolsVersion
defaultConfig {
applicationId "com.sample.companyname"
minSdkVersion project.ext.globalMinSdkVersion
targetSdkVersion project.ext.globalTargetSdkVersion
versionCode 74
versionName app_version
multiDexEnabled true
}
compileOptions {
//noinspection GroovyAssignabilityCheck
sourceCompatibility JavaVersion.VERSION_1_7
//noinspection GroovyAssignabilityCheck
targetCompatibility JavaVersion.VERSION_1_7
}
// This has been added to deal with a duplicate file when using
// apache commons-codec and commons-validators
packagingOptions {
pickFirst 'META-INF/DEPENDENCIES.txt'
pickFirst 'META-INF/DEPENDENCIES'
pickFirst 'META-INF/dependencies.txt'
pickFirst 'META-INF/LICENSE.txt'
pickFirst 'META-INF/LICENSE'
pickFirst 'META-INF/license.txt'
pickFirst 'META-INF/LGPL2.1'
pickFirst 'META-INF/NOTICE.txt'
pickFirst 'META-INF/NOTICE'
pickFirst 'META-INF/notice.txt'
}
signingConfigs {
debug {
//noinspection GroovyAssignabilityCheck
storeFile file('../keystore/product.keystore')
storePassword "dont"
keyAlias "even"
keyPassword "try"
}
release {
//noinspection GroovyAssignabilityCheck
storeFile file('../keystore/product.keystore')
storePassword "dont"
keyAlias "even"
keyPassword "try"
}
}
//noinspection GroovyAssignabilityCheck
buildTypes {
debug {
applicationIdSuffix ".debug"
debuggable true
}
release {
debuggable false
minifyEnabled true
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
flavorDimensions 'tier'
productFlavors {
sampleFlavor1 {
dimension 'tier'
}
sampleFlavor2 {
dimension 'tier'
}
sampleFlavor3 {
dimension 'tier'
}
sampleFlavor4 {
dimension 'tier'
}
}
sourceSets {
main.java.srcDirs = ['src/main/java']
}
lintOptions {
abortOnError false
}
}
//noinspection GroovyAssignabilityCheck
dependencies {
// Project dependencies
implementation project(':module-1')
implementation project(':module-2')
implementation project(':module-3')
implementation project(':module-4')
implementation project(':module-5')
implementation(name: 'lib-a-2.1.1-release', ext: 'aar')
implementation(name: 'lib-b-2.1.1-release', ext: 'aar')
implementation(name: 'lib-c-2.1.1-release', ext: 'aar')
implementation(name: 'lib-d-2.1.1-release', ext: 'aar')
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
implementation('commons-codec:commons-codec:1.10')
implementation('commons-validator:commons-validator:1.4.0') {
exclude group: 'commons-logging', module: 'commons-logging'
exclude group: 'commons-digester', module: 'commons-digester'
exclude group: 'commons-beanutils', module: 'commons-beanutils'
exclude group: 'commons-collections', module: 'commons-collections'
}
implementation "com.google.android.gms:play-services-nearby:$play_services_version"
implementation "com.google.android.gms:play-services-gcm:$play_services_version"
implementation 'com.android.support:multidex:1.0.3'
implementation "com.android.support:appcompat-v7:$support_version"
implementation "com.android.support:design:$support_version"
implementation "com.android.support:support-annotations:$support_version"
implementation "com.android.support.constraint:constraint-layout:1.0.2"
// Test dependencies
androidTestImplementation 'com.squareup.okhttp:mockwebserver:2.3.0'
androidTestImplementation 'com.jayway.android.robotium:robotium-solo:5.2.1'
testImplementation 'junit:junit:4.12'
}
检查您的lib文件夹中是否有任何gson jar。我也遇到了同样的问题,gson-2.2.4.jar在我的lib目录中。移除它对我有效。
所有com.android.support库必须使用完全相同的版本规范(混合版本会导致运行时崩溃)。找到版本27.0.2、26.1.0.示例包括com.android.support:support-compat:27.0.2和com.android.support:animated-vector-drawable:26.1。 应用插件:“com.android.application” 当我运行
截至昨天下午,我们的Javascript单元测试套件已经开始失败。在出现一系列“未找到模块”错误后,所有测试均未运行,webpack报告生成失败。这是我们的构建堆栈: 节点6.11.5(是的,我知道,非常古老)业力1.7.1 Webpack 2.2.1 React 15.6.2 我们使用Karma运行单元测试。大多数测试套件都涉及React,所以我们使用Webpack来构建一切。为此,我们导入我们
我尝试将计算机中的java maven项目导入到eclipse sts/Spring tool Suite3.9中,如下所示:eclipse sts>file menu>import>existing maven projects>等等。 我在谷歌上找不到任何解决这个问题的答案。如何修复此错误?
下面是gradle StackTrace:
我刚刚创建了一个新的模板与与reactv17包括,我安装了eslint依赖,因为我以前,这是我的package.json文件 这是我的eslintrc.json:(注意我还没有添加所有的规则) 当我运行应用程序时,由于以下错误,应用程序将无法编译: 我在以前的项目中工作过,代码中显示了eslint错误,但没有导致应用程序崩溃。有人能指出我把事情弄糟的地方吗? 谢谢
完整的错误消息- 请访问下面的链接以找到关于如何更新Angular的说明。 https://angular-update-guide.firebaseapp.com/ **在研究此问题时,大多数解决方案都声明将Angular.json文件更改为“architect”:{“build”:{“builder”:“@angular-devkit/build-angular:browser”,“optio