【问题标题】:Android libpng ERROR: Failure processing PNG image - maven-pluginAndroid libpng 错误:处理PNG图像失败 - maven-plugin
【发布时间】:2013-01-16 18:06:24
【问题描述】:

使用 android-maven-plugin 编译我的项目给了我以下 png 错误。带有 android-m2e 的 Eclipse 可以毫无问题地编译并部署到我的平板电脑上。这是 aapt 命令和 libpng 的问题吗?

[INFO] /Users/foo/android-sdk-macosx/platform-tools/aapt [package, -f, -M, 
/Users/foo/source/app/abc-android/AndroidManifest.xml, -S, /Users/foo/source/app/abc-
android/res, -S, /Users/foo/source/app/abc-
android/target/unpack/apklibs/com.abc.aws.android_aws_apklib_1.0/res, --auto-add-overlay, 
-A, /Users/foo/source/app/abc-android/target/generated-sources/combined-assets/assets, -I, 
/Users/foo/android-sdk-macosx/platforms/android-15/android.jar, -F, 
/Users/foo/source/app/abc-android/target/abc-android-0.1-SNAPSHOT.ap_, --debug-mode]
[INFO] libpng error: Not a PNG file
[INFO] ERROR: Failure processing PNG image /Users/foo/source/app/abc-android/res/drawable-hdpi/login_full_screen.png
[INFO] /Users/foo/source/app/abc-android/res/layout/achievement_grid_item.xml:7: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/achievement_3_in_arow').
[INFO] /Users/foo/source/app/abc-android/res/layout/achievement_grid_item_post_class.xml:6: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/achievement_3_in_arow').
[INFO] /Users/foo/source/app/abc-android/res/layout/ant_fragment.xml:8: error: Error: No resource found that matches the given name (at 'background' with value '@drawable/distance_bg').
[INFO] /Users/foo/source/app/abc-android/res/layout/ant_fragment.xml:89: error: Error: No resource found that matches the given name (at 'background' with value '@drawable/cadence_bg').
[INFO] /Users/foo/source/app/abc-android/res/layout/ant_fragment.xml:168: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/heat_arrow_narrow_full_both').
[INFO] /Users/foo/source/app/abc-android/res/layout/ant_fragment.xml:198: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/avg_max_separator').
[INFO] /Users/foo/source/app/abc-android/res/layout/ant_fragment.xml:231: error: Error: No resource found that matches the given name (at 'background' with value '@drawable/power_bg').
[INFO] /Users/foo/source/app/abc-android/res/layout/ant_fragment.xml:318: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/total_effort_bg').
[INFO] /Users/foo/source/app/abc-android/res/layout/ant_fragment.xml:350: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/heat_arrow_wide_full_both').
[INFO] /Users/foo/source/app/abc-android/res/layout/ant_fragment.xml:380: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/avg_max_separator').
[INFO] /Users/foo/source/app/abc-android/res/layout/ant_fragment.xml:415: error: Error: No resource found that matches the given name (at 'background' with value '@drawable/resistance_bg').

【问题讨论】:

    标签: android maven m2e aapt


    【解决方案1】:

    在 MS Paint 中打开 png 文件并将其重新保存为 png 文件。它会将 png 转换为 32 位格式。由于 Android 同时支持 24 位和 32 位 png,这让我觉得 Adobe Photoshop 生成的 png 有一些 Android 不喜欢的东西。

    参考:Canvas & Drawables

    【讨论】:

      猜你喜欢
      • 2012-08-17
      • 1970-01-01
      • 2014-11-15
      • 2016-03-17
      • 1970-01-01
      • 2023-01-09
      • 2012-01-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多