본문 바로가기

Leave a note/ANDROID

[ANDROID] unknown element meta-data found , 에러해결방법

반응형
SMALL

[ANDROID] unknown element meta-data found 

- 에러해결방법 


안드로이드 3.0 으로 올라가면서, 여러가지 문제가 발생하더군요.

이전에는 매니페스트 파일 구조에 대해 어느정도 무시하였던 부분을 고치고 가도록 패치가 되었네요


Behavior changes when using AAPT2


To improve incremental resource processing, Android plugin 3.0.0 enables AAPT2 by default. Although AAPT2 should immediately work with older projects, this section describes some behavior changes that you should be aware of.

Element hierarchies in the Android manifest

In previous versions of AAPT, elements nested in incorrect nodes in the Android manifest are either ignored or result in a warning. For example, consider the following sample:


아래와 같은 매니페스트 구조를 참고하여, 올바른 매니페스트 구조로 사용하시길 바랍니다.

<?xml version="1.0" encoding="utf-8"?>

<manifest>

   
<uses-permission />
   
<permission />
   
<permission-tree />
   
<permission-group />
   
<instrumentation />
   
<uses-sdk />
   
<uses-configuration />  
   
<uses-feature />  
   
<supports-screens />  
   
<compatible-screens />  
   
<supports-gl-texture />  

   
<application>

       
<activity>
           
<intent-filter>
               
<action />
               
<category />
               
<data />
           
</intent-filter>
           
<meta-data />
       
</activity>

       
<activity-alias>
           
<intent-filter> . . . </intent-filter>
           
<meta-data />
       
</activity-alias>

       
<service>
           
<intent-filter> . . . </intent-filter>
           
<meta-data/>
       
</service>

       
<receiver>
           
<intent-filter> . . . </intent-filter>
           
<meta-data />
       
</receiver>

       
<provider>
           
<grant-uri-permission />
           
<meta-data />
           
<path-permission />
       
</provider>

       
<uses-library />

   
</application>

</manifest>
<?xml version="1.0" encoding="utf-8"?>

<manifest>

   
<uses-permission />
   
<permission />
   
<permission-tree />
   
<permission-group />
   
<instrumentation />
   
<uses-sdk />
   
<uses-configuration />  
   
<uses-feature />  
   
<supports-screens />  
   
<compatible-screens />  
   
<supports-gl-texture />  

   
<application>

       
<activity>
           
<intent-filter>
               
<action />
               
<category />
               
<data />
           
</intent-filter>
           
<meta-data />
       
</activity>

       
<activity-alias>
           
<intent-filter> . . . </intent-filter>
           
<meta-data />
       
</activity-alias>

       
<service>
           
<intent-filter> . . . </intent-filter>
           
<meta-data/>
       
</service>

       
<receiver>
           
<intent-filter> . . . </intent-filter>
           
<meta-data />
       
</receiver>

       
<provider>
           
<grant-uri-permission />
           
<meta-data />
           
<path-permission />
       
</provider>

       
<uses-library />

   
</application>

</manifest>
<?xml version="1.0" encoding="utf-8"?>

<manifest>

   
<uses-permission />
   
<permission />
   
<permission-tree />
   
<permission-group />
   
<instrumentation />
   
<uses-sdk />
   
<uses-configuration />  
   
<uses-feature />  
   
<supports-screens />  
   
<compatible-screens />  
   
<supports-gl-texture />  

   
<application>

       
<activity>
           
<intent-filter>
               
<action />
               
<category />
               
<data />
           
</intent-filter>
           
<meta-data />
       
</activity>

       
<activity-alias>
           
<intent-filter> . . . </intent-filter>
           
<meta-data />
       
</activity-alias>

       
<service>
           
<intent-filter> . . . </intent-filter>
           
<meta-data/>
       
</service>

       
<receiver>
           
<intent-filter> . . . </intent-filter>
           
<meta-data />
       
</receiver>

       
<provider>
           
<grant-uri-permission />
           
<meta-data />
           
<path-permission />
       
</provider>

       
<uses-library />

   
</application>

</manifest>
<?xml version="1.0" encoding="utf-8"?>

<manifest>

   
<uses-permission />
   
<permission />
   
<permission-tree />
   
<permission-group />
   
<instrumentation />
   
<uses-sdk />
   
<uses-configuration />  
   
<uses-feature />  
   
<supports-screens />  
   
<compatible-screens />  
   
<supports-gl-texture />  

   
<application>

       
<activity>
           
<intent-filter>
               
<action />
               
<category />
               
<data />
           
</intent-filter>
           
<meta-data />
       
</activity>

       
<activity-alias>
           
<intent-filter> . . . </intent-filter>
           
<meta-data />
       
</activity-alias>

       
<service>
           
<intent-filter> . . . </intent-filter>
           
<meta-data/>
       
</service>

       
<receiver>
           
<intent-filter> . . . </intent-filter>
           
<meta-data />
       
</receiver>

       
<provider>
           
<grant-uri-permission />
           
<meta-data />
           
<path-permission />
       
</provider>

       
<uses-library />

   
</application>

</manifest>
<?xml version="1.0" encoding="utf-8"?>

<manifest>

   
<uses-permission />
   
<permission />
   
<permission-tree />
   
<permission-group />
   
<instrumentation />
   
<uses-sdk />
   
<uses-configuration />  
   
<uses-feature />  
   
<supports-screens />  
   
<compatible-screens />  
   
<supports-gl-texture />  

   
<application>

       
<activity>
           
<intent-filter>
               
<action />
               
<category />
               
<data />
           
</intent-filter>
           
<meta-data />
       
</activity>

       
<activity-alias>
           
<intent-filter> . . . </intent-filter>
           
<meta-data />
       
</activity-alias>

       
<service>
           
<intent-filter> . . . </intent-filter>
           
<meta-data/>
       
</service>

       
<receiver>
           
<intent-filter> . . . </intent-filter>
           
<meta-data />
       
</receiver>

       
<provider>
           
<grant-uri-permission />
           
<meta-data />
           
<path-permission />
       
</provider>

       
<uses-library />

   
</application>

</manifest>


참조 URL : https://developer.android.com/guide/topics/manifest/manifest-intro#filestruct

반응형
LIST