2016-01-22 64 views
0

嘗試使用毫米構建apk時出現以下錯誤。編譯android rom中的應用程序時出錯。 (APK空)

Reading program jar [/Volumes/untitled/WORKING_DIRECTORY/out/target/common/obj/APPS/HelloWorld_intermediates/classes.jar] 
Reading library jar [/Volumes/untitled/WORKING_DIRECTORY/out/target/common/obj/JAVA_LIBRARIES/core-junit_intermediates/classes.jar] 
Reading library jar [/Volumes/untitled/WORKING_DIRECTORY/out/target/common/obj/JAVA_LIBRARIES/core-libart_intermediates/classes.jar] 
Reading library jar [/Volumes/untitled/WORKING_DIRECTORY/out/target/common/obj/JAVA_LIBRARIES/ext_intermediates/classes.jar] 
Reading library jar [/Volumes/untitled/WORKING_DIRECTORY/out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes.jar] 
Error: The output jar is empty. Did you specify the proper '-keep' options? 
make: *** [out/target/common/obj/APPS/HelloWorld_intermediates/proguard.classes.jar] Error 1 

#### make failed to build some targets (20 seconds) #### 

這些都是我make文件的內容Android.mk

LOCAL_PATH:= $(call my-dir) 
include $(CLEAR_VARS) 

LOCAL_MODULE_TAGS := optional 

LOCAL_SRC_FILES := $(call all-subdir-java-files) 

LOCAL_PACKAGE_NAME := HelloWorld 

include $(BUILD_PACKAGE) 

include $(call all-makefiles-under,$(LOCAL_PATH)) 

這是我AndroidManifest.xml中

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.android.helloworld" > 

    <application 
     android:allowBackup="true" 
     android:icon="@mipmap/ic_launcher" 
     android:label="@string/app_name" 
     android:theme="@style/AppTheme" > 
     <activity 
      android:name=".HelloWorld" 
      android:label="@string/app_name" 
      android:windowSoftInputMode="stateAlwaysHidden"> 
      <intent-filter> 
       <action android:name="android.intent.action.MAIN" /> 
       <category android:name="android.intent.category.LAUNCHER" /> 
       <category android:name="android.intent.category.APP_HELLOWORLD" /> 
      </intent-filter> 
     </activity> 
    </application> 
</manifest> 

該應用程序在上面正常編譯android studio。要在我用來編譯Rom的相同環境中進行編譯,我必須刪除預編譯的R文件。任何可以幫助編譯這個應用程序的建議?

+1

嘿人!我可以得到一些幫助嗎? – fahad

回答

0

好吧,我錯了,這個問題是不是progard.flags文件,我試圖彙編寫在搖籃一個應用程序,其中作爲安卓ROM編譯環境支持ANT。

0

我有這個問題。將LOCAL_PROGUARD_FLAG_FILES := proguard.flags添加到Android.mk並創建標誌文件。

-keep class com.yourpackage.* { 
    *; 
} 
+0

確定添加標誌文件肯定讓我擺脫了這個問題,但現在還有其他幾個。你能編譯應用程序嗎?如果是,那麼我可以問你幾個簡單的問題嗎? – fahad