我已经在android studio中添加了登录活动并安装了google play服务但是当我运行该程序时,我不断收到以下错误。我认为这是由于64方法问题合并多个dix文件,但解决方案不起作用。任何想法?感谢
Executing tasks: [:app:assembleDebug]
Parallel execution with configuration on demand is an incubating feature.
Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0
:app:preBuild
:app:compileDebugNdk
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV71910Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices4452Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava
:app:dexDebug
unknown output extension: E:\year4\4thYearProject\projectCode\Train
usage:
dx --dex [--debug] [--verbose] [--positions=<style>] [--no-locals]
[--no-optimize] [--statistics] [--[no-]optimize-list=<file>] [--no-strict]
[--keep-classes] [--output=<file>] [--dump-to=<file>] [--dump-width=<n>]
[--dump-method=<name>[*]] [--verbose-dump] [--no-files] [--core-library]
[--num-threads=<n>] [--incremental] [--force-jumbo]
[--multi-dex [--main-dex-list=<file> [--minimal-main-dex]]
[<file>.class | <file>.{zip,jar,apk} | <directory>] ...
Convert a set of classfiles into a dex file, optionally embedded in a
jar/zip. Output name must end with one of: .dex .jar .zip .apk or be a directory.
Positions options: none, important, lines.
--multi-dex: allows to generate several dex files if needed. This option is
exclusive with --incremental, causes --num-threads to be ignored and only
supports folder or archive output.
--main-dex-list=<file>: <file> is a list of class file names, classes defined by
those class files are put in classes.dex.
--minimal-main-dex: only classes selected by --main-dex-list are to be put in
the main dex.
dx --annotool --annotation=<class> [--element=<element types>]
[--print=<print types>]
dx --dump [--debug] [--strict] [--bytes] [--optimize]
[--basic-blocks | --rop-blocks | --ssa-blocks | --dot] [--ssa-step=<step>]
[--width=<n>] [<file>.class | <file>.txt] ...
Dump classfiles, or transformations thereof, in a human-oriented format.
dx --find-usages <file.dex> <declaring type> <member>
Find references and declarations to a field or method.
declaring type: a class name in internal form, like Ljava/lang/Object;
member: a field or method name, like hashCode
dx -J<option> ... <arguments, in one of the above forms>
Pass VM-specific options to the virtual machine that runs dx.
dx --version
Print the version of this tool (1.8).
dx --help
Print this message.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Users\carl\AppData\Local\Android\android-studio\sdk\build-tools\19.1.0\dx.bat --dex --num-threads=4 --multi-dex --output E:\year4\4thYearProject\projectCode\Train&Gain\app\build\intermediates\dex\debug E:\year4\4thYearProject\projectCode\Train&Gain\app\build\intermediates\classes\debug E:\year4\4thYearProject\projectCode\Train&Gain\app\build\intermediates\dependency-cache\debug E:\year4\4thYearProject\projectCode\Train&Gain\app\build\intermediates\exploded-aar\com.google.android.gms\play-services\4.4.52\classes.jar C:\Users\carl\AppData\Local\Android\android-studio\sdk\extras\android\m2repository\com\android\support\support-v4\19.1.0\support-v4-19.1.0.jar E:\year4\4thYearProject\projectCode\Train&Gain\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\19.1.0\classes.jar
Error Code:
1
Output:
unknown output extension: E:\year4\4thYearProject\projectCode\Train
usage:
dx --dex [--debug] [--verbose] [--positions=<style>] [--no-locals]
[--no-optimize] [--statistics] [--[no-]optimize-list=<file>] [--no-strict]
[--keep-classes] [--output=<file>] [--dump-to=<file>] [--dump-width=<n>]
[--dump-method=<name>[*]] [--verbose-dump] [--no-files] [--core-library]
[--num-threads=<n>] [--incremental] [--force-jumbo]
[--multi-dex [--main-dex-list=<file> [--minimal-main-dex]]
[<file>.class | <file>.{zip,jar,apk} | <directory>] ...
Convert a set of classfiles into a dex file, optionally embedded in a
jar/zip. Output name must end with one of: .dex .jar .zip .apk or be a directory.
Positions options: none, important, lines.
--multi-dex: allows to generate several dex files if needed. This option is
exclusive with --incremental, causes --num-threads to be ignored and only
supports folder or archive output.
--main-dex-list=<file>: <file> is a list of class file names, classes defined by
those class files are put in classes.dex.
--minimal-main-dex: only classes selected by --main-dex-list are to be put in
the main dex.
dx --annotool --annotation=<class> [--element=<element types>]
[--print=<print types>]
dx --dump [--debug] [--strict] [--bytes] [--optimize]
[--basic-blocks | --rop-blocks | --ssa-blocks | --dot] [--ssa-step=<step>]
[--width=<n>] [<file>.class | <file>.txt] ...
Dump classfiles, or transformations thereof, in a human-oriented format.
dx --find-usages <file.dex> <declaring type> <member>
Find references and declarations to a field or method.
declaring type: a class name in internal form, like Ljava/lang/Object;
member: a field or method name, like hashCode
dx -J<option> ... <arguments, in one of the above forms>
Pass VM-specific options to the virtual machine that runs dx.
dx --version
Print the version of this tool (1.8).
dx --help
Print this message.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 44.126 secs
答案 0 :(得分:0)
尝试将您的构建工具从Android SDK管理器更新为比您正在使用的19.1.0
更新的东西。
答案 1 :(得分:0)
提示:检查输出并尝试在发布之前了解出现了什么问题。
查看错误说明的内容:
未知输出扩展名:E:\ year4 \ 4thYearProject \ projectCode \ Train
然后再看一下dx命令的输出参数:
C:\ Users \用户卡尔\应用程序数据\本地\的Android \机器人工作室\ SDK \构建工具\ 19.1.0 \ dx.bat --dex --num-threads = 4 --multi-dex - 输出E:\ year4 \ 4thYearProject \ projectCode \ Train&amp; Gain \ app \ build \ intermediates \ dex \ debug E:\ year4 \ 4thYearProject \ projectCode \培训和放大器,增益\程序\编译\中间体\ Classes下\调试 E:\ year4 \ 4thYearProject \ projectCode \培训和放大器,增益\程序\编译\中间体\依赖缓存\调试 E:\ year4 \ 4thYearProject \ projectCode \培训和放大器,增益\程序\编译\ \中间体爆炸-AAR \ com.google.android.gms \播放服务\ 52年4月4日\ classes.jar C:\ Users \用户卡尔\应用程序数据\本地\的Android \ Android的工作室\ SDK \演员\机器人\ m2repository \ COM \机器人\ SUPPORT \支持-V4 \ 19.1.0 \支持,v4-19.1.0.jar E:\ year4 \ 4thYearProject \ projectCode \列车&安培;增益\应用\构建\中间体\分解-AAR \ com.android.support \程序兼容性-V7 \ 19.1.0 \ classes.jar 强>
你现在能看到[可能]的错误吗?看起来dx命令终止于'&amp;'标志。将其从项目名称中删除,然后重试。
答案 2 :(得分:0)
我遇到了这个错误,并将其跟踪到处理BAT文件的CMD。编辑后,它工作。 构建符号%arch_ext%的 tools \ lib \ find_java.bat 中的行失败;它附加了一个尾随空格,因此 arch_ext 是&#34; 32&#34;而不是&#34; 32&#34;。当符号稍后展开时,引入的空间破坏了路径。只需在&#34; set&#34;周围添加括号即可。修复它的操作。
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" 1>NUL && (set arch_ext=32) || (set arch_ext=64)