2012-04-02 31 views
3

我一直在構建Adroid應用程序一段時間,但一直使用ANT命令行模型構建發行版本。Eclipse下的Android Build/Progard日誌

我已決定使用eclispe EXPORT模型開始構建我的android發行版APK,它似乎正在工作。

儘管如此,我並沒有在任何地方看到構建日誌,所以我不確定構建的PROGUARD部分是否真正起作用。這個APK已經創建好了,並且它看起來有簽名,但是我能夠更真實地看到構建輸出,尤其是在使用ANT構建時,通常會成爲控制檯輸出的一部分的構建輸出。

我在Eclipse中打開一個控制檯窗口,當我選擇導出並沒有看到任何內容,並且當我嘗試使用Android查找有關Eclipse的構建日誌記錄的信息時,我同樣沒有發現任何內容。

寫入導出命令的sysout/build日誌在哪裏?

+0

我不認爲PROGUARD工作正常,我故意弄亂了proguard.cfg,並在控制檯中看到輸出。但是,如果我確定沒有錯誤,則會發生構建,但由-printmapping分配的文件永遠不會在任何地方創建。 – user282172 2012-04-02 17:48:15

回答

1

通過使用普通的Ant配置對話框,然後運行(Clean,Debug)的正常目標,我在eclipse控制檯選項卡中看到了正確的DX輸出......您將擁有與target = release相同的一般體驗,在該進程中的ProGuard一步..

  1. 的Eclipse /外部工具配置
  2. 標籤=目標 - 選擇要包含目標(清潔,調試)
  3. 驗證目標執行順序
  4. 運行Ant和看看控制檯....

如果您運行發佈目標,您將看到proguard,其中dx如下所示。

Eclipse控制檯:

 [dx] associated EnclosingMethod attribute. This class was probably produced by a 
     [dx] compiler that did not target the modern .class file format. The recommended 
     [dx] solution is to recompile the class from source, using an up-to-date compiler 
     [dx] and without specifying any "-target" type options. The consequence of ignoring 
     [dx] this warning is that reflective operations on this class will incorrectly 
     [dx] indicate that it is *not* an inner class. 
     [dx] warning: Ignoring InnerClasses attribute for an anonymous inner class 
     [dx] (org.apache.commons.logging.LogFactory$6) that doesn't come with an 
     [dx] associated EnclosingMethod attribute. This class was probably produced by a 
     [dx] compiler that did not target the modern .class file format. The recommended 
     [dx] solution is to recompile the class from source, using an up-to-date compiler 
     [dx] and without specifying any "-target" type options. The consequence of ignoring 
     [dx] this warning is that reflective operations on this class will incorrectly 
     [dx] indicate that it is *not* an inner class. 
     [dx] 2 warnings 
-crunch: 
    [crunch] Crunching PNG Files in source dir: C:\cygwin\home\rob\src\gpsclipper\res 
    [crunch] To destination dir: C:\cygwin\home\rob\src\gpsclipper\bin\res 
    [crunch] Crunched 0 PNG files to update cache 
-package-resources: 
    [aapt] Current build type is different than previous build: forced aapt run. 
    [aapt] Creating full resource package... 
-package: 
    [echo] --apk outfldr:C:\cygwin\home\rob\src\gpsclipper\bin resourcefile: gpsclipper.ap_ 
    [echo]    apkfilepath: C:\cygwin\home\rob\src\gpsclipper\bin\gpsclipper-debug-unaligned.apk verbose: false 
    [echo]    Dxpath: C:\cygwin\home\rob\src\gpsclipper\bin\classes.dex 
    [echo]    srcFldrPth: C:\cygwin\home\rob\src\gpsclipper\src jarRFID: ${project.libraries.jars} 
    [echo]    nativeFldr: ${project.libraries.libs} 
[apkbuilder] Current build type is different than previous build: forced apkbuilder run. 
[apkbuilder] Creating gpsclipper-debug-unaligned.apk and signing it with a debug key... 
-post-package: 
-do-debug: 
[zipalign] Running zip align on final apk... 
    [echo] Debug Package: C:\cygwin\home\rob\src\gpsclipper\bin\gpsclipper-debug.apk 
[propertyfile] Updating property file: C:\cygwin\home\rob\src\gpsclipper\bin\build.prop 
[propertyfile] Updating property file: C:\cygwin\home\rob\src\gpsclipper\bin\build.prop 
[propertyfile] Updating property file: C:\cygwin\home\rob\src\gpsclipper\bin\build.prop 
[propertyfile] Updating property file: C:\cygwin\home\rob\src\gpsclipper\bin\build.prop 
-post-build: 
debug: 
-pre-clean: 
clean: 
    [delete] Deleting directory C:\cygwin\home\rob\src\gpsclipper\bin 
    [delete] Deleting directory C:\cygwin\home\rob\src\gpsclipper\gen 
BUILD SUCCESSFUL 
Total time: 54 seconds 
+0

Robert,謝謝你的回答,但我試圖不定義我自己的顯式ANT調用,只是看到內置的導出執行生成的輸出。當我導航到run-> external_tools-> external tools config時,ANT沒有可見的配置。我真的不想明確地定義ant命令,只是看到輸出android正在執行的輸出。 – user282172 2012-04-02 16:12:18

+0

嗯,我仍然沒有找到明確的日誌,但看到MAPPINGS文件正在生成,所以我想我只會依賴它作爲probuard正常運行的證據。 – user282172 2012-04-03 20:00:34

+0

@ user282172我一直沒有能夠看到Proguard日誌,直到我配置我的項目使用ant構建。對我來說,這是查看控制檯中的proguard日誌的唯一方法。 – 2014-02-19 15:37:38

0

持有該項目的信息,你會發現一個名爲Proguard的目錄在工作區中,該目錄包含所有構建日誌和映射,這將使你的信息,以什麼做結果如何?