这是我的问题 有人可以帮忙吗? 我已经尝试在gradle上更改构建版本,但它仍然没有运行
BUILD FAILED
Total time: 11.872 secs
Executing tasks: [:app:compileDebugSources, :app:compileDebugAndroidTestSources]
Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72300Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2300Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42300Library 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
AAPT err(Facade for 1220063698): libpng error: Not a PNG file
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> Some file crunching failed, see logs for details
* 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: 11.771 secs
WHEN I TRY TO CLEAN BUILD:
Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources]
Configuration on demand is an incubating feature.
:clean
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72300Library FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:prepareComAndroidSupportAppcompatV72300Library'.
> Failed to create parent directory 'P:\BudgetWiseApp\app\build' when creating directory 'P:\BudgetWiseApp\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.0.0'
* 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: 13.896 secs
答案 0 :(得分:1)
您的日志显示了这个:
AAPT错误(Facade for 1220063698):libpng错误:不是PNG文件
这意味着您拥有的图像资源不是PNG。
日志通常显示导致问题的文件,但您可能需要使用--stacktrace
选项(例如gradlew assembleDebug --stacktrace
)运行。
如果仍然没有显示文件名,则需要查看可绘制文件夹中的非PNG图像。
答案 1 :(得分:0)
构建 - >清洁项目
构建 - >重建项目
答案 2 :(得分:0)
确保drawable中的图像为png格式。 只需打开图像编辑器即可转换为png格式的任何图像并保存为png。