在适用于Windows 10 Home 64bit的Android Studio 3.1.3中运行构建失败

时间:2018-07-29 18:45:16

标签: java android android-studio gradle

[Attached Screenshot of my dashboard][1]

Here's all the activity on my 'activity_main.xml' file:


<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 xmlns:app="http://schemas.android.com/apk/res-auto"
 xmlns:tools="http://schemas.android.com/tools"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:paddingBottom="16dp"
 android:paddingLeft="16dp"
 android:paddingRight="16dp"
 android:paddingTop="16dp"
 android:visibility="visible"
 tools:context=".MainActivity"
 tools:onClick="onButtonTap">

<android.support.design.widget.AppBarLayout
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:layout_alignParentStart="true"
   android:layout_alignParentTop="true"
   android:layout_marginTop="92dp"
   android:theme="@style/AppTheme.AppBarOverlay

<android.support.v7.widget.Toolbar
   android:id="@+id/toolbar"
   android:layout_width="match_parent"
   android:layout_height="?attr/actionBarSize"
   android:background="?attr/colorPrimary"
   app:popupTheme="@style/AppTheme.PopupOverlay" />

 </android.support.design.widget.AppBarLayout>


   <android.support.design.widget.FloatingActionButton
   android:id="@+id/fab"
   android:layout_width="wrap_content"
   android:layout_height="wrap_content"
   android:layout_alignParentBottom="true"
   android:layout_alignParentEnd="true"
   android:layout_gravity="bottom|end"
   android:layout_marginBottom="114dp"
   android:layout_marginEnd="40dp"
   app:srcCompat="@android:drawable/ic_dialog_email" />

   <ImageButton
   android:id="@+id/imageButton"
   android:layout_width="match_parent"
   android:layout_height="wrap_content"
   android:layout_above="@+id/null"
   android:layout_centerHorizontal="true"
   android:layout_marginBottom="-92dp"
   app:srcCompat="@android:drawable/arrow_down_float" />

<TextView
 android:layout_width="wrap_content"
 android:layout_height="wrap_content"
 android:layout_alignParentTop="true"
 android:layout_centerHorizontal="true"
 android:layout_marginTop="174dp"
 android:text="Tap me if you dare!" />

<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="234dp"
android:text="@string/tapme" />

</RelativeLayout>


Hopefully this should help. Thanks!

运行构建失败,并显示以下错误消息:
引起原因:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException:执行进程时出错

C:\ Users \ NITISHA KUNDU \ AppData \ Local \ Android \ Sdk \ build-tools \ 27.0.3 \ aapt.exe,参数为{package -f --no-crunch -IC:\ Users \ NITISHA KUNDU \ AppData \ Local \ Android \ Sdk \ platforms \ android-28 \ android.jar -M \?\ C:\ Users \ NITISHA KUNDU \ AndroidStudioProjects \ FirstApp \ app \ build \ intermediates \ manifests \ full \ debug \ AndroidManifest.xml- SC:\ Users \ NITISHA KUNDU \ AndroidStudioProjects \ FirstApp \ app \ build \ intermediates \ res \ merged \ debug -m -J \?\ C:\ Users \ NITISHA KUNDU \ AndroidStudioProjects \ FirstApp \ app \ build \ generation \ source \ r \ debug -FC:\ Users \ NITISHA KUNDU \ AndroidStudioProjects \ FirstApp \ app \ build \ intermediates \ res \ debug \ resources-debug.ap_ --custom-package com.screwedupminds.firstapp -0 apk --output-text-符号\?\ C:\ Users \ NITISHA KUNDU \ AndroidStudioProjects \ FirstApp \ app \ build \ intermediates \ symbols \ debug --no-version-vectors}     在com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:503)     在com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:482)     在com.google.common.util.concurrent.AbstractFuture $ TrustedFuture.get(AbstractFuture.java:79)     在com.android.builder.internal.aapt.AbstractAapt.link(AbstractAapt.java:34)     在com.android.builder.core.AndroidBuilder.processResources(AndroidBuilder.java:807)     ...另外44个 引起原因:com.android.ide.common.process.ProcessException:执行进程C:\ Users \ NITISHA KUNDU \ AppData \ Local \ Android \ Sdk \ build-tools \ 27.0.3 \ aapt.exe时出现错误,参数为{package -f --no-crunch -IC:\ Users \ NITISHA KUNDU \ AppData \ Local \ Android \ Sdk \ platforms \ android-28 \ android.jar -M \?\ C:\ Users \ NITISHA KUNDU \ AndroidStudioProjects \ FirstApp \ app \ build \ intermediates \ manifests \ full \ debug \ AndroidManifest.xml -SC:\ Users \ NITISHA KUNDU \ AndroidStudioProjects \ FirstApp \ app \ build \ intermediates \ res \ merged \ debug -m -J \?\ C:\ Users \ NITISHA KUNDU \ AndroidStudioProjects \ FirstApp \ app \ build \ Generated \ source \ r \ debug -FC:\ Users \ NITISHA KUNDU \ AndroidStudioProjects \ FirstApp \ app \ build \ intermediates \ res \ debug \ resources-debug.ap_ --custom -package com.screwedupminds.firstapp -0 apk --output-text-symbols \?\ C:\ Users \ NITISHA KUNDU \ AndroidStudioProjects \ FirstApp \ app \ build \ intermediates \ symbols \ debug --no-version-vectors}     在com.android.build.gradle.internal.process.GradleProcessResult.buildProcessException(GradleProcessResult.java:73)

  [1]: https://i.stack.imgur.com/zeqak.jpg

2 个答案:

答案 0 :(得分:0)

我相信您想使用android:id="@+id/null"而不是android:layout_above="@+id/null"

如果没有,那么您忘记将android:id="@+id/null"添加到希望ImageView在其下方的视图中,并且还删除了+中的android:layout_above="@+id/null"

答案 1 :(得分:0)

此类问题的唯一解决方案是删除项目并再次构建项目。希望您的问题得到解决。