- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
<分区>
我的项目有 2 个模块,分别是 app 和 apphelper 作为库。我一直在尝试将 kotlin 与 android 数据绑定(bind)一起使用,但我不明白为什么它在我构建项目时一直向我显示这些错误:
失败:构建失败,出现异常。
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:stagingRuntimeClasspath'.
> Unable to find a matching configuration in project :apphelper:
- Configuration 'debugApiElements':
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aar}' and found compatible value 'AndroidTypeAttr{name=Aar}'.
- Required com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=staging}' and found incompatible value 'BuildTypeAttr{name=debug}'.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'VariantAttr{name=debug}' but wasn't required.
- Required org.gradle.api.attributes.Usage 'for runtime' and found incompatible value 'for compile'.
- Configuration 'debugRuntimeElements':
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aar}' and found compatible value 'AndroidTypeAttr{name=Aar}'.
- Required com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=staging}' and found incompatible value 'BuildTypeAttr{name=debug}'.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'VariantAttr{name=debug}' but wasn't required.
- Required org.gradle.api.attributes.Usage 'for runtime' and found compatible value 'for runtime'.
- Configuration 'releaseApiElements':
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aar}' and found compatible value 'AndroidTypeAttr{name=Aar}'.
- Required com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=staging}' and found incompatible value 'BuildTypeAttr{name=release}'.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'VariantAttr{name=release}' but wasn't required.
- Required org.gradle.api.attributes.Usage 'for runtime' and found incompatible value 'for compile'.
- Configuration 'releaseRuntimeElements':
- Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'AndroidTypeAttr{name=Aar}' and found compatible value 'AndroidTypeAttr{name=Aar}'.
- Required com.android.build.gradle.internal.dependency.BuildTypeAttr 'BuildTypeAttr{name=staging}' and found incompatible value 'BuildTypeAttr{name=release}'.
- Found com.android.build.gradle.internal.dependency.VariantAttr 'VariantAttr{name=release}' but wasn't required.
- Required org.gradle.api.attributes.Usage 'for runtime' and found compatible value 'for runtime'.
当我简单地点击构建按钮时会显示上面的错误日志,如果我点击运行按钮将应用程序安装到设备上会更奇怪:
:app:transformDexArchiveWithDexMergerForDebug
AGPBI: {"kind":"error","text":"Error converting bytecode to dex:\nCause: com.android.dex.DexException: Multiple dex files define Lorg/intellij/lang/annotations/PrintFormatPattern;","sources":[{}],"original":"UNEXPECTED TOP-LEVEL EXCEPTION:\ncom.android.dex.DexException: Multiple dex files define Lorg/intellij/lang/annotations/PrintFormatPattern;\n","tool":"Dex"}
AGPBI: {"kind":"error","text":"com.android.dex.DexException: Multiple dex files define Lorg/intellij/lang/annotations/PrintFormatPattern;","sources":[{}]}
AGPBI: {"kind":"error","text":"\tat com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:608)","sources":[{}]}
AGPBI: {"kind":"error","text":"\tat com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:563)","sources":[{}]}
AGPBI: {"kind":"error","text":"\tat com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:545)","sources":[{}]}
AGPBI: {"kind":"error","text":"\tat com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:167)","sources":[{}]}
AGPBI: {"kind":"error","text":"\tat com.android.dx.merge.DexMerger.merge(DexMerger.java:194)","sources":[{}]}
AGPBI: {"kind":"error","text":"\tat com.android.builder.dexing.DexArchiveMergerCallable.mergeDexes(DexArchiveMergerCallable.java:66)","sources":[{}]}
AGPBI: {"kind":"error","text":"\tat com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:54)","sources":[{}]}
AGPBI: {"kind":"error","text":"\tat com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:37)","sources":[{}]}
AGPBI: {"kind":"error","text":"\tat java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)","sources":[{}]}
AGPBI: {"kind":"error","text":"\tat java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)","sources":[{}]}
AGPBI: {"kind":"error","text":"\tat java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)","sources":[{}]}
AGPBI: {"kind":"error","text":"\tat java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)","sources":[{}]}
AGPBI: {"kind":"error","text":"\tat java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)","sources":[{}]}
FAILED
:app:buildInfoGeneratorDebug
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lorg/intellij/lang/annotations/PrintFormatPattern;
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED in 4s
74 actionable tasks: 7 executed, 67 avoided (91%)
我将 kotlin 版本降级为 '1.1.2-2' 以避免 error并且还在 local.properties 中添加了“kotlin.incremental=false”
这是我所有的 build.gradle 文件:
应用模块:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: 'test-environment.gradle'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
mavenCentral()
}
allprojects {
repositories {
jcenter()
mavenCentral()
maven { url 'https://maven.fabric.io/public' }
}
}
android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
applicationId "com.myapp.android"
minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
versionCode 1
versionName "1.0"
}
dataBinding {
enabled = true
}
dexOptions {
jumboMode = true
}
if (System.getenv("CIRCLE")) {
defaultConfig {
versionCode Integer.parseInt(System.getenv("CIRCLE_BUILD_NUM"))
versionName "1.0." + System.getenv("CIRCLE_BUILD_NUM")
}
} else {
defaultConfig {
versionCode 1
versionName "1.0"
}
}
signingConfigs {
debug {
storeFile file("../myappdebug.keystore")
storePassword "myapprocks"
keyAlias "myapp"
keyPassword "myapprocks"
}
staging {
storeFile file("../myapp_staging.keystore")
storePassword "myapprocks"
keyAlias "myapp"
keyPassword "myapprocks"
}
release {
storeFile rootProject.file('myapp.keystore')
storePassword System.getenv("KEYSTORE_PASS")
keyAlias System.getenv("ALIAS_NAME")
keyPassword System.getenv("ALIAS_PASS")
}
}
buildTypes {
debug {
ext.betaDistributionNotifications = false
signingConfig signingConfigs.debug
applicationIdSuffix ".dev"
minifyEnabled false
shrinkResources false
proguardFile 'proguard-release.cfg'
testProguardFile 'proguard-release.cfg'
manifestPlaceholders = [providerSuffix: ".dev"]
}
staging {
ext.betaDistributionEmailsFilePath = "staging_distribution_emails.txt"
ext.betaDistributionReleaseNotesFilePath = "release_notes.txt"
signingConfig signingConfigs.staging
applicationIdSuffix ".staging"
shrinkResources true
minifyEnabled true
proguardFile 'proguard-release.cfg'
manifestPlaceholders = [providerSuffix: ".staging"]
}
release {
signingConfig signingConfigs.release
shrinkResources true
minifyEnabled true
proguardFile 'proguard-release.cfg'
}
}
}
kapt {
generateStubs = true
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
api project(':apphelper')
compile 'com.android.support:appcompat-v7:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:cardview-v7:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:design:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:support-v13:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'hanks.xyz:smallbang-library:0.1.2'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.facebook.device.yearclass:yearclass:1.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.+'
compile group: 'com.google.code.gson', name: 'gson', version: '2.7'
compile('com.crashlytics.sdk.android:crashlytics:2.6.2@aar') {
transitive = true
}
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile "android.arch.lifecycle:runtime:" + project.ANDROID_ARCH_VERSION
compile "android.arch.lifecycle:extensions:" + project.ANDROID_ARCH_VERSION
annotationProcessor "android.arch.lifecycle:compiler:" + project.ANDROID_ARCH_VERSION
compile "android.arch.persistence.room:runtime:" + project.ANDROID_ARCH_VERSION
annotationProcessor "android.arch.persistence.room:compiler:" + project.ANDROID_ARCH_VERSION
kapt "com.android.databinding:compiler:$android_plugin_version"
}
库模块:
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion Integer.parseInt(project.ANDROID_BUILD_SDK_VERSION)
buildToolsVersion project.ANDROID_BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion Integer.parseInt(project.ANDROID_BUILD_MIN_SDK_VERSION)
targetSdkVersion Integer.parseInt(project.ANDROID_BUILD_TARGET_SDK_VERSION)
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/maven/com.squareup.okio/okio/pom.properties'
exclude 'META-INF/maven/com.squareup.okio/okio/pom.xml'
exclude 'META-INF/maven/com.squareup.retrofit/retrofit/pom.xml'
exclude 'META-INF/maven/com.squareup.retrofit/retrofit/pom.properties'
}
}
kapt {
generateStubs = true
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile group: 'com.squareup.retrofit2', name: 'converter-gson', version: '2.1.0'
compile group: 'com.squareup.okhttp3', name: 'logging-interceptor', version: '3.4.1'
compile 'org.jetbrains:annotations-java5:15.0'
compile 'hanks.xyz:smallbang-library:0.1.2'
compile 'com.android.support:support-annotations:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:support-v13:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:appcompat-v7:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:design:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile 'com.android.support:customtabs:' + project.ANDROID_SUPPORT_LIBRARY_VERSION
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile 'com.github.bumptech.glide:glide:3.7.0'
}
repositories {
mavenCentral()
}
主要的 gradle 构建脚本:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.2-2'
ext.android_plugin_version = '3.0.0-alpha2'
repositories {
jcenter()
maven { url 'https://maven.google.com' }
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
classpath "com.android.tools.build:gradle:$android_plugin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
谁有和我一样的问题,请分享解决方案。谢谢。
无论哪个 WebGPU 示例(austin-eng、jack1232/WebGPU-Step-By-Step 等),我在启用了不安全 WebGPU 标志的 Chrome Canary 97.0.468
自从我在新的 Android Studio 3.4 Canary 4 上更新了我的项目后,gradle sync 失败了,因为: ERROR: variant.getApplicationId() i
Android Studio canary 卡在启动画面上,自最近几个 canary 版本以来一直在发生这种情况,但稳定版本没有此类问题。我尝试了此 Post 中的修复程序但它没有用。我目前运行的是
我刚刚下载了 Chrome 的测试版浏览器,CSS 似乎已切换 off .在设置或开发工具中看不到任何更改它的内容。有什么想法吗? 最佳答案 在 chrome 中,你在设置部分有它 通过齿轮图标,选择
在 linux 中,除了 canary 之外,还有很多方法可以绕过安全机制(如 NX、ASLR)。其实我在/arch/arm/include/asm/stackprotector.h/boot_ini
错误:(249, 5) 资源“attr/font”的重复值与配置“”错误:(249, 5) 先前在此处定义的资源 错误:java.lang.RuntimeException:com.android.b
我正在使用 google canary,不知何故,canary 窗口全黑了: 当我尝试卸载 google canary 时,没有任何反应。如果打开了 google canary,图标就会出现: 有人知
我的gcc版本是4.8.2,操作系统是ubuntu 14.04(64位)。我发现有时gcc会自动生成金丝雀来做缓冲区溢出保护有时不会,为什么? 生成金丝雀的情况:SIZE是4的倍数 #include
我将 LeakCanary 导入到我的项目中,以了解我内部有哪些内存泄漏以及有多少内存泄漏,然后能够修复它们。我注意到这两个我无法修复。更好地说,我不知道如何用代码来解决它们。有人知道如何给我一些建议
我明白金丝雀是什么。但是,如果您不知道有哪些测试版功能可用,这将毫无用处。那么有没有可以找到这些信息的地方?我一直在谷歌搜索,但找不到任何东西。 最佳答案 Chrome Canary 不是 Chrom
我正在研究不同类型的发布策略,并在 Canary 和 A/B 策略之间感到困惑。他们两个似乎很相似。 我在 Canary 上读到的每一处都是“允许通过向一小群人发布新版本来测试部署”。在 A/B 上是
关闭。这个问题是opinion-based .它目前不接受答案。 想改善这个问题吗?更新问题,以便可以通过 editing this post 用事实和引文回答问题. 7年前关闭。 Improve t
我今天正在安装新的 CPAN 模块,结果发现 JSON::XS 模块显示了它自己的警告/咆哮,关于在 5.22 以上的 Perls 中使用它。似乎作者厌倦了据称在那之后引入 Perl 的向后不兼容的更
我们观察到 Leak Canary 的很多误报,即 Leak Canary 检测到有泄漏,但后来又返回消息: LeakCanary: * NO LEAK FOUND. 我认为这是因为 GC 没有及时认
当我尝试在常规的Android SDK版本上构建项目时,它没有任何问题,但是当我使用Android SDK预览版 Canary 4 时,出现此错误 > Error:Could not fi
我正在尝试为尚不属于 Istio 服务网格但仍在同一个 k8s 集群中的应用程序实现金丝雀式的流量管理。例如:Pod命名空间中的 A non-mesh来电Service命名空间中的 B mesh它绑定
我已将 Leak Canary 添加到个人 Android 应用程序,并生成了以下堆栈跟踪: 05-13 06:49:15.589 27088-28230/com.upwardsnorthwards
如何在 Chrome Canary 29 中生成背后弹出窗口? 另请参阅 GitHub 上报告的问题: jquery-popunder #33 js-popunder #14 免责声明:是的,弹出式广
大家好,我在 android studio canary 3 布局中遇到问题,无法正常工作,解决方案是什么? 消息显示Gradle project sync failed的截图 最佳答案 尝试替换这个
在PHP的错误日志中出现了一个奇怪的错误,但是产生这个错误的脚本经常被使用并且从来没有产生过这个错误,目前只出现过一次。谁能告诉我为什么会这样? Error: [client {some IP}] A
我是一名优秀的程序员,十分优秀!