android studio 打包报错,困扰了好久,急急急

刘鸣 2016-10-08 10:04:41
今天使用gradle build 命令执行,build.gradle文件,打包生成apk文件过程中,提示 Position 7 : No resource identifier found for attribute 'elevation' in package 'android'
Position 7 : No resource identifier found for attribute 'elevation' in package 'android'
Position 7 : No resource identifier found for attribute 'elevation' in package 'android' Position 7 : No resource identifier found for attribute 'elevation' in package 'android' Position 6 : No resource identifier found for attribute 'elevation' in package 'android' Position 2 : No resource identifier found for attribute 'elevation' in package 'android' Position 19:27-82 : No resource found that matches the given name (at 'drawable' with value '@drawable/abc_textfield_search_right_selected_holo_dark').
Position 19:27-83 : No resource found that matches the given name (at 'drawable' with value '@drawable/abc_textfield_search_right_selected_holo_light'). Position 20:29-84 : No resource found that matches the given name (at 'drawable' with value '@drawable/abc_textfield_search_right_default_holo_light'). :LakalaClient:processPreDebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':LakalaClient:processPreDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\SoftWare\AS_SDK\build-tools\22.0.1\aapt.exe'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED
我全局收索了提示缺少的资源文件,'@drawable/abc_textfield_search_right_default_holo_light等,发现都是在build文件件中,也就是自动生成的文件,一直没有得到解决,做编译打包也有一段时间了 ,遇到过很多问题都能顺利的解决,唯独这个问题困扰了我好久,希望CSDN的大神们帮忙找一找原因啊,
...全文
662 8 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
softwareon2012 2016-10-29
  • 打赏
  • 举报
回复
gradle版本太低了,jdk版本比较 偏高,所以报异常找不到jdk,将gradle版本改高一点就好了 比如我刚刚报这个异常是 classpath 'com.android.tools.build:gradle:1.1.1‘ 改为classpath 'com.android.tools.build:gradle:2.2.2‘就可以了 jdk我用的是1.8,反正这个问题就是jdk跟gradle不匹配,一方太高了,一方比较低
xyb618 2016-10-19
  • 打赏
  • 举报
回复
引用 6 楼 xyb618 的回复:
你看看上面运行编译的地方,需要选你项目的app名字,不要选成其他的,在androidstudio那个运行的按钮左边的选项
我以前也遇到和你一样的问题,你看看是不是我说的这个
xyb618 2016-10-19
  • 打赏
  • 举报
回复
你看看上面运行编译的地方,需要选你项目的app名字,不要选成其他的,在androidstudio那个运行的按钮左边的选项
_周星星 2016-10-19
  • 打赏
  • 举报
回复
我去 你检查一下 xml文件中 是不是哪儿 用了图片 图片的名字elevation 但是你有没得这个图片
passself 2016-10-08
  • 打赏
  • 举报
回复
应该是项目本身的配置,JDK的使用路径和本机不符合
刘鸣 2016-10-08
  • 打赏
  • 举报
回复
既然是针对本项目的问题,是不是和gradle版本有关系呢,但是其他同事电脑上却没有这个问题
刘鸣 2016-10-08
  • 打赏
  • 举报
回复
当我把项目导入到studio中,编译运行时,又会提示以下错误: Error:Execution failed for task ':LakalaLibCommon:compileReleaseJava'. > Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory. 可以更定的是,我的Java Compiler是没问题的,运行其他的项目也没问题
qq_24552307 2016-10-08
  • 打赏
  • 举报
回复
看报错是你环境变量配置有问题

80,472

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧