수요일, 9월 29, 2010

[Android] My Tip; Android ant release error (-dex: apply)

[Android] My Tip; Android ant release error (-dex: apply)


// ----------------------------------
// :: Preset
// ----------------------------------
 - Source Path
    C:/Program Files/MyAPKTest
 - Android SDK Path
    C:/android/android-sdk-windows
 - Using Android SDK Version: 2.1
    C:/android/android-sdk-windows/platforms/android-6/

// ----------------------------------
// :: Problem
//
// - Caused by this into dx.bat
//    if "%params%"=="" goto endArgs
//
// - e.g.,
//    set params = "--dex C:/Program Files/MyAPKTest/bin/classes.dex" "..." "..." "..."
//    if "%params%" == ""
// - DOS Batch Interpreter does not parse duplicated double-quotation.
// ----------------------------------
C:/Program Files/MyAPKTest> ant clean [OK]
C:/Program Files/MyAPKTest> ant compile [OK]
C:/Program Files/MyAPKTest> ant release
...
-dex:
     [echo] Converting compiled files and external libraries into C:/Program Files/MyAPKTest/bin/classes.dex...
     [echo]
    [apply] =C:/Files""은(는) 예상되지 않았습니다. (Korean)
    or
    [apply] =C:/Files"" was unexpected at this time. (English)
C:/Program Files/My APK Test>



// ----------------------------------
// :: Solution
// - Condition: Does not needs options
// ----------------------------------

// ----------------------------------
// 1. Open a dx.bat
// ----------------------------------
C:/android/android-sdk-windows/platforms/android-6/tools/dx.bat

// ----------------------------------
// 2. and Adds this in the above the ":nextArg"
// ----------------------------------
...
echo ***** SKIP check the parameter *****
set args=%params%
goto endArgs

:nextArg
if "%params%"=="" goto endArgs
...

// ----------------------------------
// 3. That's it, so now run clean & compile & release
// ----------------------------------
C:/Program Files/MyAPKTest> ant clean && ant compile && ant release
...
BUILD SUCCESSFUL
Total time: x seconds
C:/Program Files/MyAPKTest>



-----
Cheers,
June

댓글 없음:

댓글 쓰기