2016-01-22 62 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