- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在将应用程序从 2.3 升级到 Nougat (SDK 25)。当我添加 com.android.support:appcompat-v7:25.0.0
以支持 ActivityCompat.requestPermissions
时。当我在 Debug模式下运行它时,应用程序运行没有问题,但是使用 ./gradlew assembleDebug
运行会导致以下错误:
Error:Execution failed for task ':transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/hardware/display/DisplayManagerCompat.class
当我在 Debug模式下运行它时,应用程序构建没有问题,但是,当我尝试构建 APK
时,我收到上述错误。
有什么方法可以找到重复的包裹吗?我运行了以下命令:
./gradlew -q dependencies :dependencies --configuration compile
------------------------------------------------------------
Root project
------------------------------------------------------------
compile - Classpath for compiling the main sources.
+--- com.android.support:multidex:1.0.1
+--- com.android.support:appcompat-v7:25.0.0
| +--- com.android.support:support-vector-drawable:25.0.0
| | \--- com.android.support:support-compat:25.0.0
| | \--- com.android.support:support-annotations:25.0.0
| \--- com.android.support:animated-vector-drawable:25.0.0
| \--- com.android.support:support-vector-drawable:25.0.0 (*)
+--- project :deps:android-map-utils:library
| \--- project :deps:google-maps-m4b
\--- project :deps:google-play-services
(*) - dependencies omitted (listed previously)
这是我的build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
}
}
apply plugin: 'com.android.application'
dependencies {
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:25.0.0'
compile fileTree(include: '*.jar', dir: 'libs')
compile fileTree(include: '*.jar', dir: 'lib')
compile project(':deps:google-maps-m4b')
compile project(':deps:android-map-utils:library')
compile project(':deps:google-play-services')
}
android {
compileSdkVersion 24
buildToolsVersion '25.0.0'
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/license.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/notice.txt'
}
defaultConfig {
// Already hit dex limit
multiDexEnabled true
dexOptions {
javaMaxHeapSize "4g"
}
}
lintOptions {
abortOnError false
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
allprojects {
repositories {
jcenter()
}
}
libs
中的文件:armeabi/libcryptowrapper.so
lib
中的文件:
ClientCertUtil.jar
apache-mime4j-0.6.jar
commons-codec-1.6.jar
commons-io-2.4.jar
commons-logging-1.1.3.jar
gcm.jar
httpclient-4.3.4.jar
httpclientandroidlib-1.2.1.jar
httpcore-4.3.jar
httpmime-4.3.1.jar
javarosa.jar
joda-time-2.0.jar
kxml2-2.3.0.jar
mgrs.jar
opencsv-2.3.jar
regexp-me.jar
zip4j_1.3.2.jar
将 exclude module: 'support-v4'
添加到 appcompat-v7
时,构建仍然失败并显示调试日志,无法使用 加载主要 Activity 索引越界,长度:0,索引:3
:
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:(net.lingala.zip4j.unzip.Unzip$1) that doesn't come with an
Error:associated EnclosingMethod attribute. This class was probably produced by a
Error:compiler that did not target the modern .class file format. The recommended
Error:solution is to recompile the class from source, using an up-to-date compiler
Error:and without specifying any "-target" type options. The consequence of ignoring
Error:this warning is that reflective operations on this class will incorrectly
Error:indicate that it is *not* an inner class.
运行
./gradlew -q projects
------------------------------------------------------------
Root project
------------------------------------------------------------
Root project 'opendatakit-collect'
\--- Project ':deps'
+--- Project ':deps:android-map-utils'
| \--- Project ':deps:android-map-utils:library'
+--- Project ':deps:google-maps-m4b'
\--- Project ':deps:google-play-services'
运行 ./gradlew :dependencies
因为我似乎没有项目名称:
Incremental java compilation is an incubating feature.
:dependencies
------------------------------------------------------------
Root project
------------------------------------------------------------
_debugAndroidTestAnnotationProcessor - ## Internal use, do not manually configure ##
No dependencies
_debugAndroidTestApk - ## Internal use, do not manually configure ##
\--- com.android.support:multidex-instrumentation:1.0.1
\--- com.android.support:multidex:1.0.1
_debugAndroidTestCompile - ## Internal use, do not manually configure ##
\--- com.android.support:multidex-instrumentation:1.0.1
\--- com.android.support:multidex:1.0.1
_debugAnnotationProcessor - ## Internal use, do not manually configure ##
No dependencies
_debugApk - ## Internal use, do not manually configure ##
+--- com.android.support:multidex:1.0.1
+--- com.android.support:appcompat-v7:25.0.0
| +--- com.android.support:support-vector-drawable:25.0.0
| | \--- com.android.support:support-compat:25.0.0
| | \--- com.android.support:support-annotations:25.0.0
| \--- com.android.support:animated-vector-drawable:25.0.0
| \--- com.android.support:support-vector-drawable:25.0.0 (*)
+--- project :deps:google-maps-m4b
+--- project :deps:android-map-utils:library
| \--- project :deps:google-maps-m4b
\--- project :deps:google-play-services
_debugCompile - ## Internal use, do not manually configure ##
+--- com.android.support:multidex:1.0.1
+--- com.android.support:appcompat-v7:25.0.0
| +--- com.android.support:support-vector-drawable:25.0.0
| | \--- com.android.support:support-compat:25.0.0
| | \--- com.android.support:support-annotations:25.0.0
| \--- com.android.support:animated-vector-drawable:25.0.0
| \--- com.android.support:support-vector-drawable:25.0.0 (*)
+--- project :deps:google-maps-m4b
+--- project :deps:android-map-utils:library
| \--- project :deps:google-maps-m4b
\--- project :deps:google-play-services
_debugUnitTestAnnotationProcessor - ## Internal use, do not manually configure ##
No dependencies
_debugUnitTestApk - ## Internal use, do not manually configure ##
No dependencies
_debugUnitTestCompile - ## Internal use, do not manually configure ##
No dependencies
_releaseAnnotationProcessor - ## Internal use, do not manually configure ##
No dependencies
_releaseApk - ## Internal use, do not manually configure ##
+--- com.android.support:multidex:1.0.1
+--- com.android.support:appcompat-v7:25.0.0
| +--- com.android.support:support-vector-drawable:25.0.0
| | \--- com.android.support:support-compat:25.0.0
| | \--- com.android.support:support-annotations:25.0.0
| \--- com.android.support:animated-vector-drawable:25.0.0
| \--- com.android.support:support-vector-drawable:25.0.0 (*)
+--- project :deps:google-maps-m4b
+--- project :deps:android-map-utils:library
| \--- project :deps:google-maps-m4b
\--- project :deps:google-play-services
_releaseCompile - ## Internal use, do not manually configure ##
+--- com.android.support:multidex:1.0.1
+--- com.android.support:appcompat-v7:25.0.0
| +--- com.android.support:support-vector-drawable:25.0.0
| | \--- com.android.support:support-compat:25.0.0
| | \--- com.android.support:support-annotations:25.0.0
| \--- com.android.support:animated-vector-drawable:25.0.0
| \--- com.android.support:support-vector-drawable:25.0.0 (*)
+--- project :deps:google-maps-m4b
+--- project :deps:android-map-utils:library
| \--- project :deps:google-maps-m4b
\--- project :deps:google-play-services
_releaseUnitTestAnnotationProcessor - ## Internal use, do not manually configure ##
No dependencies
_releaseUnitTestApk - ## Internal use, do not manually configure ##
No dependencies
_releaseUnitTestCompile - ## Internal use, do not manually configure ##
No dependencies
androidJacocoAgent - The Jacoco agent to use to get coverage data.
\--- org.jacoco:org.jacoco.agent:0.7.5.201505241946
androidJacocoAnt - The Jacoco ant tasks to use to get execute Gradle tasks.
\--- org.jacoco:org.jacoco.ant:0.7.5.201505241946
+--- org.jacoco:org.jacoco.core:0.7.5.201505241946
| \--- org.ow2.asm:asm-debug-all:5.0.1
+--- org.jacoco:org.jacoco.report:0.7.5.201505241946
| +--- org.jacoco:org.jacoco.core:0.7.5.201505241946 (*)
| \--- org.ow2.asm:asm-debug-all:5.0.1
\--- org.jacoco:org.jacoco.agent:0.7.5.201505241946
androidTestAnnotationProcessor - Classpath for the annotation processor for 'androidTest'.
No dependencies
androidTestApk - Classpath packaged with the compiled 'androidTest' classes.
No dependencies
androidTestCompile - Classpath for compiling the androidTest sources.
No dependencies
androidTestProvided - Classpath for only compiling the androidTest sources.
No dependencies
androidTestWearApp - Link to a wear app to embed for object 'androidTest'.
No dependencies
annotationProcessor - Classpath for the annotation processor for 'main'.
No dependencies
apk - Classpath packaged with the compiled 'main' classes.
No dependencies
archives - Configuration for archive artifacts.
No dependencies
compile - Classpath for compiling the main sources.
+--- com.android.support:multidex:1.0.1
+--- com.android.support:appcompat-v7:25.0.0
| +--- com.android.support:support-vector-drawable:25.0.0
| | \--- com.android.support:support-compat:25.0.0
| | \--- com.android.support:support-annotations:25.0.0
| \--- com.android.support:animated-vector-drawable:25.0.0
| \--- com.android.support:support-vector-drawable:25.0.0 (*)
+--- project :deps:google-maps-m4b
+--- project :deps:android-map-utils:library
| \--- project :deps:google-maps-m4b
\--- project :deps:google-play-services
debugAnnotationProcessor - Classpath for the annotation processor for 'debug'.
No dependencies
debugApk - Classpath packaged with the compiled 'debug' classes.
No dependencies
debugCompile - Classpath for compiling the debug sources.
No dependencies
debugProvided - Classpath for only compiling the debug sources.
No dependencies
debugWearApp - Link to a wear app to embed for object 'debug'.
No dependencies
default - Configuration for default artifacts.
No dependencies
default-mapping - Configuration for default mapping artifacts.
No dependencies
default-metadata - Metadata for the produced APKs.
No dependencies
instrumentTestAnnotationProcessor - Classpath for the annotation processor for 'instrumentTest'.
No dependencies
instrumentTestApk - Classpath packaged with the compiled 'instrumentTest' classes.
No dependencies
instrumentTestCompile - Classpath for compiling the instrumentTest sources.
No dependencies
instrumentTestProvided - Classpath for only compiling the instrumentTest sources.
No dependencies
instrumentTestWearApp - Link to a wear app to embed for object 'instrumentTest'.
No dependencies
provided - Classpath for only compiling the main sources.
No dependencies
releaseAnnotationProcessor - Classpath for the annotation processor for 'release'.
No dependencies
releaseApk - Classpath packaged with the compiled 'release' classes.
No dependencies
releaseCompile - Classpath for compiling the release sources.
No dependencies
releaseProvided - Classpath for only compiling the release sources.
No dependencies
releaseWearApp - Link to a wear app to embed for object 'release'.
No dependencies
testAnnotationProcessor - Classpath for the annotation processor for 'test'.
No dependencies
testApk - Classpath packaged with the compiled 'test' classes.
No dependencies
testCompile - Classpath for compiling the test sources.
No dependencies
testDebugAnnotationProcessor - Classpath for the annotation processor for 'testDebug'.
No dependencies
testDebugApk - Classpath packaged with the compiled 'testDebug' classes.
No dependencies
testDebugCompile - Classpath for compiling the testDebug sources.
No dependencies
testDebugProvided - Classpath for only compiling the testDebug sources.
No dependencies
testDebugWearApp - Link to a wear app to embed for object 'testDebug'.
No dependencies
testProvided - Classpath for only compiling the test sources.
No dependencies
testReleaseAnnotationProcessor - Classpath for the annotation processor for 'testRelease'.
No dependencies
testReleaseApk - Classpath packaged with the compiled 'testRelease' classes.
No dependencies
testReleaseCompile - Classpath for compiling the testRelease sources.
No dependencies
testReleaseProvided - Classpath for only compiling the testRelease sources.
No dependencies
testReleaseWearApp - Link to a wear app to embed for object 'testRelease'.
No dependencies
testWearApp - Link to a wear app to embed for object 'test'.
No dependencies
wearApp - Link to a wear app to embed for object 'main'.
No dependencies
BUILD SUCCESSFUL
Total time: 13.053 secs
This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html
最佳答案
感谢您编辑问题。由于jar lib太多,我们几乎不可能复制错误。
那么,这里有一些值得尝试的东西。由于您说在添加 com.android.support:appcompat-v7:25.0.0
库后出现错误,请执行以下操作:
compile (compile 'com.android.support:appcompat-v7:25.0.0') {
exclude module: 'support-v4'
}
看看是否有效或者报错有没有变化
编辑:
您运行了以下命令:./gradlew -q dependencies :dependencies --configuration compile
您能否在您的 Android Studio 终端中运行此命令并在您的问题中发布 debugApk
和 releaseApk
依赖项。
命令(如果不同,将 app 更改为您的模块名称):
./gradlew app:dependencies
关于android - 构建在调试中工作,在发布中失败 - ZipException 重复条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40415072/
情况:我想从数据条目列表导航回我的 PageViewController。 before 和 previous 函数起作用 func pageViewController(pageViewContro
尊敬的 StackOverflow 用户 我有一个 gradle 项目,我想将其工件转换为 osgi 包。在这个包中,我有: 我不想导出的包(可能不会出现在 list 的 Export-Package
我为我的 PendingIntent 设置了一个警报。现在我想在我的 Activity 中显示是否设置了此警报。 Intent service = new Intent(context, MyServ
我有 2 个表、作者和书籍 authors 包含唯一的 IDauthorId 书籍也包含此作为外键 我需要知道书籍数量最多的作者。如果 2 个或更多作者并列最多书籍,我需要显示这两位作者 我已经能够通
我有一个名为 prospective_shop 的表,其中一个列名称是“用户名”。用户名未设置为主键,但我想删除所有具有重复用户名的行。我怎样才能以最快的方式做到这一点? 我尝试执行以下操作: ALT
我现在可以添加条目了。在我的应用程序中,用户可以在他的日历上输入约会/事件。但在他这样做之前,它应该向他显示他已经添加的事件。它应该从日历中获取事件并将其显示给他。这该怎么做?我被困在这部分。提前致谢
#include #include #include #include #include #include char *msg; ssize_t write_proc(struct file
我想将大于 1024 个字符的字符串传递到我的模块(文件系统)。由于内核参数限制为 1024 个字符,someone recommended改为使用 sysfs。 我试图包括 this example
我正在尝试使用 SQLAlchemy 构建以下查询(用作包含查询的子查询,该查询定义名为 tbl_outer 的别名): SELECT max(tbl.ts) AS max_1 FROM tbl WH
假设我有两张 map : Map map1 = Map.of( "a", "1", "b", "2", "c", "3", "x
通过简化示例,假设您有以下数据集: A B C Name Group Amount Dave A 2 Mike B 3 Adam C 4
我正在尝试在我的服务器上创建一个三级域虚拟主机。我希望配置设置正确,但我得到一个 ERR_NAME_NOT_RESOLVED错误。 我已经读到我必须在某处“添加 DNS 条目”以便解析名称,但我该怎么
我需要一个可用于在逗号分隔列表中查找第 N 个条目的正则表达式。 例如,假设此列表如下所示: abc,def,4322,mail@mailinator.com,3321,alpha-beta,43 .
GWT 应用程序(在 Eclipse 中开发)的源代码管理忽略文件中的典型条目是什么? 最佳答案 我会推荐: 你leave the eclipse files (.project, .classpat
我必须创建显示表 (Tbl) 中所有字段的输出,并创建一个额外的列来按月计算每个客户的累计总和(例如,如果客户在 4 月份有两次销售,新列将具有这些销售额和两行中任何先前销售额的总和)。我能做的就这么
文档 ( http://kubernetes.io/docs/user-guide/configmap/ ) 上用于使用值的示例基于 ConfigMap,其中每个数据条目都是一对/值。例子: apiV
我有一个奇怪的错字,我一遍又一遍地犯,而不是实际工作我的打字技巧,我想编辑我的 AutoHotkey 脚本来弥补这一点。 有时,当我输入大写字母时,我会点击:按钮并输入“I:”,我希望 AHK 仅用字
使用 lgdt 初始化 GDT 并将其加载到 GDTR 后,稍后如何更新 GDT? 如果我使用 sgdt 命令获取基地址,然后更新或添加条目,然后使用 lgdt 再次重新加载,我是否正确?还有其他方法
我有两个应用程序共享同一个数据库,即 API 和 MVC5 应用程序。两者都在本地主机上运行良好,但在部署到我的 Azure 帐户时出现此错误 Configuration Error Descrip
我正在尝试修剪我拥有的一些文件。我将为您保存到目前为止我编写的野兽,并通过提供虚构代码使其保持简单。 让我们来看看这个数组: [System.String[]]$Collection = 'Invit
我是一名优秀的程序员,十分优秀!