19474


MonacaでCordova4.1からCordova5.2にアップデートしたところ、Androidビルドに失敗するようになりました。  
ビルド設定などの対応方法があれば、お教えください。

・Cordovaアップデート前はビルドに成功していました。  
・ビルドではなくMonacaデバッガーで動作させた場合、特にエラーはなく動作します。  
・デバックビルド、リリースビルド両方ともビルドに失敗します。  
・iOSビルドの場合、問題なくビルドに成功します。

ビルド失敗後のメッセージには、ビルド設定に間違いがある可能性があるので下記の設定を再確認してください  
と表示されます。  
・AndroidManifest.xmlは正しく設定されていますか？  
・キーストアの設定が正しいですか？  
→これらの設定はCordovaアップデート前から変更していません。

以下はビルド失敗時のログになります。

[code]

    Temporary folder: /private/tmp/monaca/565bfce4fd1734416071b4f9
    Downloading project
    Download complete
    Running for 5.2
    plugin add mobi.monaca.plugins.Monaca
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Installing &quot;mobi.monaca.plugins.Monaca&quot; for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    plugin add cordova-plugin-camera@0.3.4
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Fetching plugin &quot;cordova-plugin-camera@0.3.4&quot; via npm
    Installing &quot;org.apache.cordova.camera&quot; for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    plugin add cordova-plugin-file-transfer@0.4.8
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Fetching plugin &quot;cordova-plugin-file-transfer@0.4.8&quot; via npm
    Installing &quot;org.apache.cordova.file-transfer&quot; for android
    Fetching plugin &quot;org.apache.cordova.file&quot; via npm
    WARNING: org.apache.cordova.file has been renamed to cordova-plugin-file. You may not be getting the latest version! We suggest you `cordova plugin rm org.apache.cordova.file` and `cordova plugin add cordova-plugin-file`.
    Fetching plugin &quot;org.apache.cordova.file&quot; via cordova plugins registry
    Installing &quot;org.apache.cordova.file&quot; for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    plugin add cordova-plugin-splashscreen@0.3.5
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Fetching plugin &quot;cordova-plugin-splashscreen@0.3.5&quot; via npm
    Installing &quot;org.apache.cordova.splashscreen&quot; for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    plugin add cordova-plugin-statusbar@0.1.9
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Fetching plugin &quot;cordova-plugin-statusbar@0.1.9&quot; via npm
    Installing &quot;org.apache.cordova.statusbar&quot; for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    plugin add cordova-plugin-whitelist@1.0.0
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Fetching plugin &quot;cordova-plugin-whitelist@1.0.0&quot; via npm
    Installing &quot;cordova-plugin-whitelist&quot; for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    plugin add cordova-plugin-crosswalk-webview@1.3.1 --variable XWALK_VERSION=14.43.343.25 
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Fetching plugin &quot;cordova-plugin-crosswalk-webview@1.3.1&quot; via npm
    Installing &quot;cordova-plugin-crosswalk-webview&quot; for android
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    Project has 7 plugins.
    8 plugins has been installed.
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf disabled
    No ALTQ support in kernel
    ALTQ related functions disabled
    pf enabled
    Running command: /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/cordova/build --debug
    ANDROID_HOME=/Applications/android-sdk-macosx
    JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
    Running: /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/gradlew cdvBuildDebug -b /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/build.gradle -Dorg.gradle.daemon=true
    embedded
    WARNING [Project: :] Current NDK support is deprecated.  Alternative will be provided in the future.
    WARNING [Project: :] Current NDK support is deprecated.  Alternative will be provided in the future.
    WARNING [Project: :] Current NDK support is deprecated.  Alternative will be provided in the future.
    WARNING [Project: :] Current NDK support is deprecated.  Alternative will be provided in the future.
    org.xwalk:xwalk_core_library:14.43.343.25
    :preBuild
    :compileArmv7DebugNdk
    :preArmv7DebugBuild
    :checkArmv7DebugManifest
    :preX86DebugBuild
    :CordovaLib:compileLint
    :CordovaLib:copyDebugLint UP-TO-DATE
    :CordovaLib:mergeDebugProguardFiles
    :CordovaLib:preBuild
    :CordovaLib:preDebugBuild
    :CordovaLib:checkDebugManifest
    :CordovaLib:prepareDebugDependencies
    :CordovaLib:compileDebugAidl
    :CordovaLib:compileDebugRenderscript
    :CordovaLib:generateDebugBuildConfig
    :CordovaLib:generateDebugAssets UP-TO-DATE
    :CordovaLib:mergeDebugAssets
    :CordovaLib:generateDebugResValues
    :CordovaLib:generateDebugResources
    :CordovaLib:packageDebugResources
    :CordovaLib:processDebugManifest
    :CordovaLib:processDebugResources
    :CordovaLib:generateDebugSources
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    :CordovaLib:compileDebugJava
    :CordovaLib:processDebugJavaRes UP-TO-DATE
    :CordovaLib:packageDebugJar
    :CordovaLib:compileDebugNdk
    :CordovaLib:packageDebugJniLibs UP-TO-DATE
    :CordovaLib:packageDebugLocalJar UP-TO-DATE
    :CordovaLib:packageDebugRenderscript UP-TO-DATE
    :CordovaLib:bundleDebug
    :prepareAndroidCordovaLibUnspecifiedDebugLibrary
    :preArmv7ReleaseBuild
    :preX86ReleaseBuild
    :CordovaLib:copyReleaseLint UP-TO-DATE
    :CordovaLib:mergeReleaseProguardFiles
    :CordovaLib:preReleaseBuild
    :CordovaLib:checkReleaseManifest
    :CordovaLib:prepareReleaseDependencies
    :CordovaLib:compileReleaseAidl
    :CordovaLib:compileReleaseRenderscript
    :CordovaLib:generateReleaseBuildConfig
    :CordovaLib:generateReleaseAssets UP-TO-DATE
    :CordovaLib:mergeReleaseAssets
    :CordovaLib:generateReleaseResValues
    :CordovaLib:generateReleaseResources
    :CordovaLib:packageReleaseResources
    :CordovaLib:processReleaseManifest
    :CordovaLib:processReleaseResources
    :CordovaLib:generateReleaseSources
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    :CordovaLib:compileReleaseJava
    :CordovaLib:processReleaseJavaRes UP-TO-DATE
    :CordovaLib:packageReleaseJar
    :CordovaLib:compileReleaseNdk
    :CordovaLib:packageReleaseJniLibs UP-TO-DATE
    :CordovaLib:packageReleaseLocalJar UP-TO-DATE
    :CordovaLib:packageReleaseRenderscript UP-TO-DATE
    :CordovaLib:bundleRelease
    :prepareOrgXwalkXwalk_core_library144334325Library
    :prepareArmv7DebugDependencies
    :compileArmv7DebugAidl
    :compileArmv7DebugRenderscript
    :generateArmv7DebugBuildConfig
    :generateArmv7DebugAssets UP-TO-DATE
    :mergeArmv7DebugAssets
    :createXwalkCommandLineFileArmv7Debug
    :generateArmv7DebugResValues
    :generateArmv7DebugResources
    ERROR: 9-patch image /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/res/drawable-port-xhdpi/screen.9.png malformed.
           Must have one-pixel frame that is either transparent or white.
    :mergeArmv7DebugResources
    Error: Failed to run command:
        /Applications/android-sdk-macosx/build-tools/23.0.1/aapt s -i /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/res/drawable-port-xhdpi/screen.9.png -o /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/build/intermediates/res/armv7/debug/drawable-port-xhdpi-v4/screen.9.png
    Error Code:
        42
    Output:
        ERROR: 9-patch image /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/res/drawable-port-xhdpi/screen.9.png malformed.
               Must have one-pixel frame that is either transparent or white.
    
    :mergeArmv7DebugResources FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task &apos;:mergeArmv7DebugResources&apos;.
    &gt; Error: Failed to run command:
        /Applications/android-sdk-macosx/build-tools/23.0.1/aapt s -i /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/res/drawable-port-xhdpi/screen.9.png -o /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/build/intermediates/res/armv7/debug/drawable-port-xhdpi-v4/screen.9.png
      Error Code:
        42
      Output:
        ERROR: 9-patch image /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/res/drawable-port-xhdpi/screen.9.png malformed.
               Must have one-pixel frame that is either transparent or white.
    
    
    * 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: 5.967 secs
    
    /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/cordova/node_modules/q/q.js:126
                        throw e;
                              ^
    Error code 1 for command: /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/gradlew with args: cdvBuildDebug,-b,/private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/build.gradle,-Dorg.gradle.daemon=true
    ERROR building one of the platforms: Error: /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/cordova/build: Command failed with exit code 8
    You may not have the required environment or OS to build this project
    Error: /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/cordova/build: Command failed with exit code 8
        at ChildProcess.whenDone (/data/monaca_build_module/5.2/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
        at ChildProcess.emit (events.js:98:17)
        at maybeClose (child_process.js:755:16)
        at Process.ChildProcess._handle.onexit (child_process.js:822:5)
    Build error: Error building project source code
    
[/code]


CC BY-SA 3.0
2015-11-30T08:30:02.960
19470
2015-11-30T10:47:37.733
10156
question
android monaca cordova
MonacaでCordova5.2にアップデートしたらAndroidビルドに失敗してしまいます


Errorが書いてある場所はここですね

[code]

    ERROR: 9-patch image /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/res/drawable-port-xhdpi/screen.9.png malformed.
           Must have one-pixel frame that is either transparent or white.
    :mergeArmv7DebugResources
    Error: Failed to run command:
        /Applications/android-sdk-macosx/build-tools/23.0.1/aapt s -i /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/res/drawable-port-xhdpi/screen.9.png -o /private/tmp/monaca/565bfce4fd1734416071b4f9/android/skeleton/platforms/android/build/intermediates/res/armv7/debug/drawable-port-xhdpi-v4/screen.9.png
    
[/code]

`drawable-port-xhdpi`のスプラッシュ画像が原因ですかね？  
`9-patch`の画像を`9-patch`だと認識できていないみたいなので、  
真黒の黒塗りで良いのでpngの仮画像をアップロードしてビルドしてみてください。  
もしビルドできるようであれば、アイコン・スプラッシュ画像が原因です。

その場合、もう一度上げなおす必要がありそうですね。


CC BY-SA 3.0
2015-11-30T10:47:37.733
19474
2015-11-30T10:47:37.733
7676
19470
answer