我知道这是一个重复的问题,但我已经阅读并尝试了这个网站上的每个解决方案,我仍然得到错误; 另外,我只是在从Eclipse导出我签名的apk时才得到它.我能够构建并运行unsigned apk.
我有:
我知道错误1意味着我有重复的符号,但我检查,清理和重建我的构建路径一百万次,我仍然得到错误,只有当我导出.
我的项目结构如下:
几天前一切都在运作!任何建议都非常感谢!
提前致谢...
EDIT-UPDATE:当我禁用Proguard时,错误就消失了.很奇怪.
添加compile 'com.android.support:support-v13:21.0.+'后build.gradle,我在构建我的应用程序时遇到了一些冲突,所以我不得不在内部添加multiDexEnabled = true.那些冲突已经消失,但是我为缺少的书法图书馆提供了另一个例外(在打开应用程序时):defaultConfigbuild.gradle
java.lang.NoClassDefFoundError: uk.co.chrisjenx.calligraphy.R$attr
at uk.co.chrisjenx.calligraphy.CalligraphyConfig$Builder.<init>(CalligraphyConfig.java:150)
at com.taxiyaab.android.util.ApplicationClass.onCreate(ApplicationClass.java:120)
at newapp.com.taxiyaab.taxiyaab.PassengerApplication.onCreate(PassengerApplication.java:68)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1007)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4462)
at android.app.ActivityThread.access$1500(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:212)
at android.app.ActivityThread.main(ActivityThread.java:5135)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
at dalvik.system.NativeStart.main(Native Method)
Run Code Online (Sandbox Code Playgroud)
我最新的sdk构建工具版本是22.0.1.以前有人遇到过这个问题吗?
我已经升级到Android Studio 2.1,当我尝试构建和运行我的企业大项目时,我遇到了这个错误:
任务':app:transformClassesWithDexForMyAppDebug'的执行失败.com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:java.lang.OutOfMemoryError:GC开销超过限制
我已经搜索了论坛并禁用了即时运行,也写入了我的build.gradle:
dexOptions {
incremental true
javaMaxHeapSize "6g"
}
...
dependencies{
compile 'com.android.support:multidex:'
}
Run Code Online (Sandbox Code Playgroud)
但它无法解决我的问题.我在gradle中启用了multidex,因为没有它我得到了错误:
com.android.dex.DexIndexOverflowException:方法ID不在[0,0xffff]中:65536
所以这是它的解决方案,它之前的Android Studio版本(也适用于公司的其他人,使用的是Android Studio 1.4-2.0),但是在我升级Android Studio之后却没有.
有谁知道会导致什么问题?
有趣的是,如果我只是做项目我没有得到错误,只有当我尝试运行它.任何想法都表示赞赏!
编辑1:
有趣的是,如果我重启我的android工作室,比第一次运行成功,但第二次运行不成功.
编辑2:
如果我将堆大小设置为更大(比如8-10g),那么应用程序甚至不会在第一次运行时编译.
编辑3:
似乎问题是即时运行,如果我强迫android studio不使用它(比如一次部署到两个设备或更改gradle.properties,如答案)错误消失.
android android-build android-studio android-gradle-2.0 android-instant-run
当我尝试构建我的项目时,我遇到了这样一个错误:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dataBindingGenBaseClassesDebug'.
> Parameter 'directory' is not a directory
Run Code Online (Sandbox Code Playgroud) android android-build android-studio build.gradle android-gradle-plugin
我正在尝试构建一个(继承的)Android项目.我正在使用Ant和命令行工具(和IDEA).
在styles.xml中,有些引用无法解析,例如:
<style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light">
Run Code Online (Sandbox Code Playgroud)
这是我遇到的原始错误:
[...]/res/values/styles.xml:8: error: Error retrieving parent for item:
No resource found that matches the given name '@style/Theme.AppCompat.Light'.
Run Code Online (Sandbox Code Playgroud)
然后我注意到project.properties这个appcompat引用在我的(OS X)机器上被破坏了:
target=android-18
android.library.reference.1=../../../../adt-bundle-linux-x86_64/sdk/extras/android/support/v7/appcompat
Run Code Online (Sandbox Code Playgroud)
我尝试通过使相对于的引用来解决这个问题${sdk.dir}:
android.library.reference.1=${sdk.dir}/extras/android/support/v7/appcompat
Run Code Online (Sandbox Code Playgroud)
所以现在这条道路应该是正确的.但是现在我跑的时候ant debug:
BUILD FAILED
/opt/android-sdk-macosx/tools/ant/build.xml:573:
/opt/android-sdk-macosx/extras/android/support/v7/appcompat resolve to a
path with no project.properties file for project /Users/joka/devel/project/
Run Code Online (Sandbox Code Playgroud)
那么,有什么想法吗?建立这个项目最简单的方法是什么?
(请注意,Ecplise特定的建议对我没用.)
编辑:Android SDK安装如下所示:

我发现了一篇关于Android构建过程如何工作的好文章,其中显示了以下过程:
但是,我也看到了另一篇文章它说,它使用javac的所有文件转换成.class文件,然后dx tool在adk将所有.class的文件classes.dex,就像这样:

请有人澄清哪一个是正确的?
我试图建立一个发布apk时遇到以下错误
:app:compileReleaseNdk UP-TO-DATE
:app:compileReleaseSources
:app:lintVitalRelease
:app:proguardRelease
Warning: android.support.v4.app.NotificationCompat$NotificationCompatImplBase: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification
Warning: android.support.v4.app.NotificationCompat$NotificationCompatImplGingerbread: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification
Warning: android.support.v4.app.NotificationCompatGingerbread: can't find referenced method 'void setLatestEventInfo(android.content.Context,java.lang.CharSequence,java.lang.CharSequence,android.app.PendingIntent)' in library class android.app.Notification
Warning: there were 3 unresolved references to library class members.
You probably need to update the library versions.
(http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedlibraryclassmember)
:app:proguardRelease FAILED
Run Code Online (Sandbox Code Playgroud)
在build.gradle中我有这个:
依赖项{compile"com.android.support:support-v4:23.0.0"}
如果我将其更改为仍然会得到相同的错误 "com.android.support:support-v13:23.0.0"
当错误消息显示:"您可能需要更新库版本." 它指的是什么库,如何更新它?
错误中引用的文档说:
"If you're developing for Android and ProGuard complains that it …
我正在使用外部库payu money sdk和linkedin-sdk,两者都使用volley库,在编译项目时会给出AuthFailureError.class的重复条目
错误:任务':app:packageAllDebugClassesForMultiDex'的执行失败.
java.util.zip.ZipException:重复条目:com/android/volley/AuthFailureError.class"
我还添加了以下代码来排除模块,但仍然是相同的错误
configurations{
all*.exclude module: 'com.android.volley'
}
请帮忙
我不得不在构建时遇到问题.我添加了构建firebase核心16.0.0,但是在构建时,这是构建firebase核心17.0.0.为什么它构建17.0.0.I检查android https://firebase.google.com/docs/android/setup#available_libraries,现在版本16.0.0,我必须删除构建项目,但这不成功.你能帮助我吗?谢谢.
当我增加版本构建
classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
Run Code Online (Sandbox Code Playgroud)
和
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//them multiDexEnabled = true
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
// butter knife.
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
// gson.
implementation 'com.google.code.gson:gson:2.8.2'
// image loading.
implementation 'com.github.bumptech.glide:glide:4.7.1'
annotationProcessor 'com.github.bumptech.glide:compiler:4.7.1'
implementation "com.github.bumptech.glide:okhttp3-integration:4.7.1"
implementation 'com.github.bumptech.glide:annotations:4.7.1'
//com.squareup.retrofit2
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
//com.squareup.okhttp3
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
//io.reactivex.rxjava2
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.13'
// keyboard keyboardvisibilityevent
implementation …Run Code Online (Sandbox Code Playgroud) 我的目标是:
我更喜欢使用小型独立工具而不是IDE.我更喜欢使用过程式或命令式(纯Java)而不是声明式(XML)进行编码.
我按照说明安装了独立的Android SDK .我有必要的最少的其他工具(文本编辑器,命令shell和JDK).但我能找到的唯一开始指令与Android Studio,Eclipse或其他IDE相关联.我跟不上他们.
如何使用我的文本编辑器编写Java程序以在Android设备上显示"Hello world"?如何使用SDK模拟器进行测试?请给我指示.