android studio 导入工程运行报错,帮忙分析下

Android 码拜 9年前 (2016-05-15) 1481次浏览
otal time: 4.3 secs
Executing tasks: [:workspaceH:clean, :workspaceH:generateDebugSources, :workspaceH:generateDebugAndroidTestSources, :workspaceH:prepareDebugUnitTestDependencies, :workspaceH:mockableAndroidJar, :workspaceH:assembleDebug]
Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:workspaceH:clean
:workspaceH:preBuild UP-TO-DATE
:workspaceH:preDebugBuild UP-TO-DATE
:workspaceH:checkDebugManifest
:pushSDK:preBuild UP-TO-DATE
:pushSDK:preReleaseBuild UP-TO-DATE
:pushSDK:compileReleaseNdk UP-TO-DATE
:pushSDK:compileLint
:pushSDK:copyReleaseLint UP-TO-DATE
:pushSDK:mergeReleaseProguardFiles UP-TO-DATE
:pushSDK:packageReleaseRenderscript UP-TO-DATE
:pushSDK:checkReleaseManifest
:pushSDK:prepareReleaseDependencies
:pushSDK:compileReleaseRenderscript UP-TO-DATE
:pushSDK:generateReleaseResValues UP-TO-DATE
:pushSDK:generateReleaseResources UP-TO-DATE
:pushSDK:packageReleaseResources UP-TO-DATE
:pushSDK:compileReleaseAidl UP-TO-DATE
:pushSDK:generateReleaseBuildConfig UP-TO-DATE
:pushSDK:mergeReleaseShaders UP-TO-DATE
:pushSDK:compileReleaseShaders UP-TO-DATE
:pushSDK:generateReleaseAssets UP-TO-DATE
:pushSDK:mergeReleaseAssets UP-TO-DATE
:pushSDK:processReleaseManifest UP-TO-DATE
:pushSDK:processReleaseResources UP-TO-DATE
:pushSDK:generateReleaseSources UP-TO-DATE
:pushSDK:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:pushSDK:compileReleaseJavaWithJavac UP-TO-DATE
:pushSDK:processReleaseJavaRes UP-TO-DATE
:pushSDK:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:pushSDK:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:pushSDK:mergeReleaseJniLibFolders UP-TO-DATE
:pushSDK:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:pushSDK:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
:pushSDK:bundleRelease UP-TO-DATE
:workspaceH:preReleaseBuild UP-TO-DATE
:workspaceH:prepareComAndroidSupportSupportV42000Library
:workspaceH:prepareWorkspaceH2PushSDKUnspecifiedLibrary
:workspaceH:prepareDebugDependencies
:workspaceH:compileDebugAidl
:workspaceH:compileDebugRenderscript
:workspaceH:generateDebugBuildConfig
:workspaceH:mergeDebugShaders
:workspaceH:compileDebugShaders
:workspaceH:generateDebugAssets
:workspaceH:mergeDebugAssets
:workspaceH:generateDebugResValues UP-TO-DATE
:workspaceH:generateDebugResources
:workspaceH:mergeDebugResources
AAPT: ERROR: 9-patch image /home/user/AndroidStudioProjects/WorkspaceH2/workspaceH/src/main/res/drawable-hdpi/img_title.9.png malformed.
AAPT:        Must have one-pixel frame that is either transparent or white.
AAPT: ERROR: 9-patch image /home/user/AndroidStudioProjects/WorkspaceH2/workspaceH/src/main/res/drawable-hdpi/tab_unread_bg.9.png malformed.
AAPT:        No marked region found along edge.
AAPT:        Found along left edge.
AAPT: ERROR: 9-patch image /home/user/AndroidStudioProjects/WorkspaceH2/workspaceH/src/main/res/drawable-hdpi/cell_bg.9.png malformed.
AAPT:        Image must be at least 3×3 (1×1 without frame) pixels.
AAPT: ERROR: 9-patch image /home/user/AndroidStudioProjects/WorkspaceH2/workspaceH/src/main/res/drawable-hdpi/back_tm_n.9.png malformed.
AAPT:        Must have one-pixel frame that is either transparent or white.
AAPT: ERROR: 9-patch image /home/user/AndroidStudioProjects/WorkspaceH2/workspaceH/src/main/res/drawable-hdpi/back_tm_h.9.png malformed.
AAPT:        Must have one-pixel frame that is either transparent or white.
AAPT: libpng error: Not a PNG file
:workspaceH:mergeDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task “:workspaceH:mergeDebugResources”.
> Crunching Cruncher cell_bg.9.png failed, see logs

* 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: 4.088 secs
解决方案

10

先新建 一个 简单的 测试  看  环境 又没问题

50

将你pushSDK这个library的buildtoolversion改为23.0.1试一试,估计是旧版的buildtool在执行generateDebugResource这个tasks时把9patch的边缘去掉了

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明android studio 导入工程运行报错,帮忙分析下
喜欢 (1)
[1034331897@qq.com]
分享 (0)