2017-03-08 2 views
0

groovy를 사용하여 빌드 구성 파일의 앱 링크에 대한 인 텐트 필터 선언이 포함 된 부분 매니페스트를 생성합니다. apk에서 발견 된 병합 된 매니페스트는 예상대로 보이지만 한 가지 문제가 있습니다. android:debuggable 속성이 build.gradle에 설정되어 있음에도 불구하고 드롭되고 있습니다. 부분 매니페스트를 제거하고 apk를 다시 작성하면 android:debuggable="true"이 예상대로 설정됩니다.안드로이드 매니페스트 병합 드롭 속성

내 주요 매니페스트 보이는 같은 :

<manifest package="com.app.myapp" 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:tools="http://schemas.android.com/tools" 
     android:installLocation="auto"> 

     <application 
     android:name="MyApp" 
     tools:replace="android:theme, android:label, android:allowBackup"> 

     </application> 
</manifest> 

내 생성 부분 매니페스트는 다음과 같습니다

<?xml version="1.0" encoding="utf-8"?> 
<manifest package="com.app.myapp" xmlns:android="http://schemas.android.com/apk/res/android"> 
     <application 
       android:name="MyApp"> 
       <activity android:name=".activity.MyActivity"> 
         <intent-filter android:autoVerify="true"> 
           <action android:name="android.intent.action.VIEW"/> 
           <category android:name="android.intent.category.BROWSABLE"/> 
           <category android:name="android.intent.category.DEFAULT"/> 

         </intent-filter> 
       </activity> 
     </application> 
</manifest> 

debuggable true 파일 build.gradle에서이 설정됩니다.

apk에있는 병합 된 매니페스트에서 속성 android:debuggable이 (가) 삭제되는 중입니다. 부분 매니페스트에 추가하지 않고 올바르게 설정되도록하려면 어떻게해야합니까? (내가 gradle 동기화 시간에 알지 못합니다. 스크립트가 실행되고 실제로이를 하드 코딩하고 싶지 않은 경우)?

답변

0

부분적인 매니페스트 파일의 application 노드에서 android:name 특성을 제거한 후에 병합이 올바르게 수행됩니다.

<?xml version="1.0" encoding="utf-8"?> 
<manifest package="com.app.myapp" xmlns:android="http://schemas.android.com/apk/res/android"> 
     <application> 
       <activity android:name=".activity.MyActivity"> 
         <intent-filter android:autoVerify="true"> 
           <action android:name="android.intent.action.VIEW"/> 
           <category android:name="android.intent.category.BROWSABLE"/> 
           <category android:name="android.intent.category.DEFAULT"/> 

         </intent-filter> 
       </activity> 
     </application> 
</manifest> 
을 : 작동

부분 매니페스트

관련 문제