gpt4 book ai didi

android - 当我尝试在Android程序中放入背景时出现错误

转载 作者:行者123 更新时间:2023-12-03 06:10:33 25 4
gpt4 key购买 nike

我尝试将任何背景放在我的android程序中,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/mypic"
tools:context="com.mm.openreg.MainActivity">

<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:id="@+id/S1"
android:layout_height="60dp"
android:layout_alignParentTop="true"
android:layout_marginTop="15dp"

android:layout_centerHorizontal="true">

我得到这个错误:

AAPT err(Facade for 972607565): D:\MyAndroid_Prog\MyAndroidProgram\OpenReg\app\src\main\res\drawable\savea.png: libpng warning: iCCP: Not recognizing known sRGB profile that has been edited AAPT err(Facade for 1945943478): libpng error: Not a PNG file
Error:Execution failed for task ':app:mergeDebugResources'. Some file crunching failed, see logs for details



运行程序时,我尝试了所有操作,但仍然遇到相同的错误。

有没有人可以帮忙?
  • 我也尝试png文件和小文件-但是

  • 这是我的 Gradle
    apply plugin: 'com.android.application'

    android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
    applicationId "com.mm.openreg"
    minSdkVersion 18
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    }

    最佳答案

    您需要更新构建工具来修复错误的aapt。

    打开sdk管理器并安装build-tools 23.0.1并更改build.gradle,使其如下所示:

    apply plugin: 'com.android.application'
    android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"

    关于android - 当我尝试在Android程序中放入背景时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35069433/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com