无法生成应用捆绑包...关于mergeReleaseResources的一些事情 [英] Cannot generate app bundle... something with mergeReleaseResources

查看:36
本文介绍了无法生成应用捆绑包...关于mergeReleaseResources的一些事情的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试生成签名的捆绑包来发布我的第一个应用程序,但我无法编译它,而且我已经查找了每个错误,但找不到答案。 这是错误消息:

Task :app:mergeReleaseResources
 C:UsersTNS SASAndroidStudioProjects
umBusappuildintermediates
   incrementalmergeReleaseResourcesstripped.dirlayout
   activity_main.xml:17:53: Id 'id/ button' has an invalid entry name ' button'.
 C:UsersTNS SASAndroidStudioProjects
umBusappuildintermediates
   incrementalmergeReleaseResourcesstripped.dirlayout
   activity_main.xml: Failure to compile the resource file.

 Task :app:mergeReleaseResources FAILED
    Execution failed for task ':app:mergeReleaseResources'.
 A failure occurred while executing com.android.build.gradle.internal.res.ResourceCompilerRunnable
 Resource compilation failed. Check logs for details.

引用的原始.xml为以下代码:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
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"
tools:context=".MainActivity">

<ImageView
    android:id="@+id/imageView"
    android:layout_width="0dp"
    android:layout_height="0dp"
    android:layout_marginStart="40dp"
    android:layout_marginTop="20dp"
    android:layout_marginEnd="40dp"
    android:layout_marginBottom="20dp"
    android:contentDescription="logo"
    app:layout_constraintBottom_toTopOf="@+id/tvCedula"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:srcCompat="@drawable/logo" />

<EditText
    android:id="@+id/tvCedula"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="16dp"
    android:ems="10"
    android:hint="Cédula"
    android:inputType="number"
    android:minHeight="48dp"
    android:textColorHighlight="@color/purple_500"
    android:textColorLink="@color/purple_200"
    app:layout_constraintBottom_toTopOf="@+id/tvPlaca"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintHorizontal_bias="0.502"
    app:layout_constraintStart_toStartOf="parent"/>

<EditText
    android:id="@+id/tvPlaca"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_marginBottom="16dp"
    android:ems="10"
    android:hint="Placa"
    android:inputType="textAutoComplete"
    android:minHeight="48dp"
    app:layout_constraintBottom_toTopOf="@+id/spinnerEmpresas"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:textAllCaps="true" />

<Spinner
    android:id="@+id/spinnerEmpresas"
    android:layout_width="220dp"
    android:layout_height="48dp"
    android:layout_marginBottom="16dp"
    android:animationCache="false"
    android:dropDownWidth="wrap_content"
    android:ems="10"
    android:minHeight="48dp"
    android:spinnerMode="dropdown"
    app:layout_constraintBottom_toTopOf="@+id/sign_in_button"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    tools:ignore="SpeakableTextPresentCheck" />

<com.google.android.gms.common.SignInButton
    android:id="@+id/sign_in_button"
    android:layout_width="wrap_content"
    android:layout_height="55dp"
    android:layout_marginBottom="150dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent" />


</androidx.constraintlayout.widget.ConstraintLayout>

当我查看它正在组装的文件时,它是这样的:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
tools:context=".MainActivity">
<com.google.android.gms.common.SignInButton
    android:id="@+id/ button"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

解决方案不是删除资源...不删除Gradle中的兼容性...

推荐答案

我解决了,但我真的不知道它是什么。 从头开始创建新项目,并复制和粘贴每个活动。运行它,生成签名的捆绑包...就是这样。

这篇关于无法生成应用捆绑包...关于mergeReleaseResources的一些事情的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆