program story

설치 오류 : INSTALL_PARSE_FAILED_MANIFEST_MALFORMED?

inputbox 2020. 9. 20. 09:47
반응형

설치 오류 : INSTALL_PARSE_FAILED_MANIFEST_MALFORMED?


나는 안드로이드 장치에 존재 / 설치된 모든 응용 프로그램을 나열하는 작은 응용 프로그램을 개발 중입니다. 하지만 코드를 실행하는 동안 아래 오류가 발생합니다.

설치 오류 : INSTALL_PARSE_FAILED_MANIFEST_MALFORMED

누구든지이 오류를 해결하는 데 도움을 줄 수 있습니다.


활동 이름은 "."로 시작해야합니다. 매니페스트 파일에서.


이 오류에 대한 또 다른 이유가있을 수 있습니다. 속성

android:taskAffinity="string" 

다음과 같이 항상 점으로 시작해야합니다.

android:taskAffinity=".string" 

이 오류는 패키지 이름에 대문자가 있었기 때문에 발생했습니다.

Com.Example.packagename

내가 그것을 다음과 같이 바꾼 후

com.example.packagename

해결되었다


INSTALL_PARSE_FAILED_MANIFEST_MALFORMED 오류 코드는 manifest.xml 파일에서 많은 수의 오류를 감지하면 PackageParser.java에 의해 리턴됩니다.

오류를 분리하려면 logcat을 확인하십시오 ( 'adb install foo.apk'명령을 수행 할 때). 내가 만난 문제에서 logcat에는 다음이 포함되었습니다.

W/ActivityManager(  360): No content provider found for permission revoke: file:///data/local/tmp/foo.apk
D/Finsky  (32707): [1] PackageVerificationReceiver.onReceive: Verification requested, id = 6
D/Finsky  (32707): [1] WorkerTask.onPreExecute: Verification Requested for id = 6,   data=file:///data/local/tmp/foo.apk flags=112 fromVerificationActivity=false
W/PackageParser(32707): /data/local/tmp/foo.apk (at Binary XML file line #214): <provider> does not include authorities attribute
D/Finsky  (32707): [716] PackageVerificationService.getPackageInfo: Cannot read archive for file:///data/local/tmp/foo.apk in request id=6
D/Finsky  (32707): [1] PackageVerificationReceiver.onReceive: Verification requested, id = 6
W/ActivityManager(  360): No content provider found for permission revoke: file:///data/local/tmp/foo.apk
I/PackageManager(  360): Copying native libraries to /data/app-lib/vmdl1205566381
W/PackageParser(  360): /data/app/vmdl1205566381.tmp (at Binary XML file line #214): <provider> does not include authorities attribute

위의 네 번째 행에서 PackageParser가 manifest.xml 파일 "<provider>에 권한 속성이 포함되지 않음" 의 # 214 행에 불만을 표시하는 것을 볼 수 있습니다 . 해당 오류 코드를 반환하는 PackageParser의 모든 사례는 아래 목록을 참조하십시오. (PackageParser는 PackageManager.INSTALL_PARSE_FAILED_MANIFEST_MALFORMED 오류 코드를 생성하는 유일한 클래스입니다)

필자의 경우 "<provider> does not include authority attribute"메시지는 parseApplication에 의해 호출 된 parseProvider 함수에서 PackagerParser.java의 2490 행에 의해 생성됩니다.


4.1.1 버전의 frameworks / base / core / java / android / content / pm / PackageParser.java에서 PackageManager.INSTALL_PARSE_FAILED_MANIFEST_MALFORMED는 이러한 메서드의 이러한 행에서 참조됩니다. 소스 코드 행 번호 다음에 logcat에 인쇄 된 메시지 인 따옴표로 묶인 문자열이 오는 경우. 행 번호 뒤에 해당 오류 코드를 리턴 한 코드 인 Java 표현식이 오는 경우 해당 함수를 조사하여 오류 메시지가 리턴 된 원인을 확인해야합니다. 몇 가지 경우에 오류 원인을 하나의 특정 메서드 호출로 격리 할 수 ​​없었습니다.

in parsePackage:
  536:  (only used in 'core apps' with no 'pkg')
  973:  "<manifest> has more than one <application>"
  1275: "Bad element under <manifest>: "      --if RIGID_PARSER

in parsePermissionGroup:
  1464: !parsePackageItemInfo(owner, perm.info, outError,
    "<permission-group>", sa,
    com.android.internal.R.styleable.AndroidManifestPermissionGroup_name,
    com.android.internal.R.styleable.AndroidManifestPermissionGroup_label,
    com.android.internal.R.styleable.AndroidManifestPermissionGroup_icon,
    com.android.internal.R.styleable.AndroidManifestPermissionGroup_logo)
  1482: !parseAllMetaData(res, parser, attrs, "<permission-group>", perm,
    outError)

in parsePermission:
  1506: !parsePackageItemInfo(owner, perm.info, outError,
    "<permission>", sa,
    com.android.internal.R.styleable.AndroidManifestPermission_name,
    com.android.internal.R.styleable.AndroidManifestPermission_label,
    com.android.internal.R.styleable.AndroidManifestPermission_icon,
    com.android.internal.R.styleable.AndroidManifestPermission_logo)
  1530: "<permission> does not specify protectionLevel"
  1541: "<permission>  protectionLevel specifies a flag but is not based on signature type"
  1548: !parseAllMetaData(res, parser, attrs, "<permission>", perm, outError)

in parsePersmissionTree:
  1572: !parsePackageItemInfo(owner, perm.info, outError,
    "<permission-tree>", sa,
    com.android.internal.R.styleable.AndroidManifestPermissionTree_name,
    com.android.internal.R.styleable.AndroidManifestPermissionTree_label,
    com.android.internal.R.styleable.AndroidManifestPermissionTree_icon,
    com.android.internal.R.styleable.AndroidManifestPermissionTree_logo)
  1585: "<permission-tree> name has less than three segments: "+perm.info.name
  1595: !parseAllMetaData(res, parser, attrs, "<permission-tree>", perm, outError)

in parseInstrumentation:
  1625: new Instrumentation(mParseInstrumentationArgs, new InstrumentationInfo())
  1648: "<instrumentation> does not specify targetPackage"
  1654: !parseAllMetaData(res, parser, attrs, "<instrumentation>", a, outError)

in parseApplication:
  1678: buildClassName(pkgName, name, outError) == null
  1851: (Set by various other functions)
  1869: parseActivity(owner, res, parser, attrs, flags, outError, false, hardwareAccelerated) == null
  1878: parseActivity(owner, res, parser, attrs, flags, outError, true, false) == null
  1887: parseService(owner, res, parser, attrs, flags, outError) == null
  1896: parseProvider(owner, res, parser, attrs, flags, outError) == null
    2484: "Heavy-weight applications can not have providers in main process"
    2890: "<provider> does not incude authorities attribute"
  1905: parseActivityAlias(owner, res, parser, attrs, flags, outError) == null
  1917: parseMetaData(res, parser, attrs, owner.mAppMetaData, outError) == null
  1969: "Bad element under <application>: "+tagName

문제의 원인을 파악하기 위해 logcat과 소스를 살펴보아야하는 것은 유감입니다.


매니페스트 파일에서 활동 이름 확인

또는 주요 활동 / 클래스의 패키지 이름

<activity android:name="MainActivity"></activity>

I have the same issue but when i call process like this:

<service
    android:name="com.dexode.tama.AppService"
    android:process="screen" >
</service>

When i change to:

<service
    android:name="com.dexode.tama.AppService"
    android:process=":screen" >
</service>

Everything starts working.


I ran into the same problem time ago, in the android docs they said that if you don't use ":" as prefix in android:process you should use a lower case letter, but they never said that, then it should be a package like process name, like com.company.app.services.MyService


Any name such as android:name, android:process should be in form of package name: starts with a..z, combines with others with ., do not end with ....


My issue was that I had written (Notice the - vs. the _):

<meta_data ... /> 
<!-- instead of -->
<meta-data ... />

under an activity. This might be the cause of your issue as well.


Got the same error! had empty permission tag and that was causing the problem!


I run into the same problem after adding localizations

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="my.package"
    android:versionCode="10"
    android:versionName="@string/version_name" >

The string @string/version_name accidentally passed into one of new added localized string-file (it appeared only in the new files). After checking all the localizations and removing @string/version_name from every file except eng locale everything worked again


Read your Android device logs to diagnose this error. Expect a "W/PackageParser" line explaining the problem.


<activity/>

must be defined BEFORE

<activity-alias/>

I had this error because the code below

<intent-filter>
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <data android:mimeType="*" android:host="*" android:scheme="content" />
            </intent-filter>

When I changed android:mimeType="*" to android:mimeType="*/*" fixed this error.


If you are using multidex in manifest then it should be added with value or resource. Like..

<meta-data android:name="android.support.multidex.MultiDexApplication"
android:value="@string/yourValue" />

OR

<meta-data android:name="android.support.multidex.MultiDexApplication"
android:resource="@string/yourValue" />

then clean the project and reinstall the app.


<activity-alias> target <activity> needs to be specified before the alias.


In my case I was referring to an icon using an attribute like this:

<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="?attr/ic_notify" />

instead of the drawable:

<meta-data android:name="com.google.firebase.messaging.default_notification_icon" android:resource="@drawable/ic_notify" />

I am using this attribute in several places but it seems it does not work in manifest.


activity created name folder must be small letters, Dont use capital letters for activity folder name.... its always better to use small letters.


There could be other files that are malformed but aren't highlighted in the IDE, for example the res/values/strings which the manifest may reference for things like labels.


In my case the cause was absence of android:name attribute in < activity-alias >. It is obligatory for < activity-alias > although it must not name an existing class. Funny thing is - the project compiles without problems.


My problem was as follows:

I was specifying my permissions in the following way and it was not working.

<permission android:name="android.permission.INTERNET">
    <meta-data />
</permission>
<permission android:name="android.permission.ACCESS_NETWORK_STATE">
    <meta-data />
</permission>

It was working fine when I changed it to be as follows:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

I was having this error because i had the line below.

android:protectionLevel="developer"

After I've changed it to

android:protectionLevel="signature"

issue was solved


After struggling with this issue i found out that all values which are used as a string resource value (aka @string/) in the manifests (of the libraries you are using too), are not allowed to be part of strings.xml of localizations. Example: if your manifests file using @string/app_name, the definition of string/app_name is allowed only in your default values/strings.xml and not in the alternate string.xml file which you provide for localizations. I hope that helps..


I had the very same error. i didn't have uppercase character in my package/application name and clean the project and other solutions also didn't help me out. after all i created new project and copy my stuff to the new one step by step and check if the problem pops up. after all i had a nice and error free project without any redundancy. sometimes it is hard to find source of this error so it is easier to take another approach.

i hope this helps somebody!


I faced this error when I put Application class in a wrong package!


You probably have not followed the syntax rules of a tag. for example:

<meta-data
      android:name="preloaded_fonts"/>

This tag is incomplete and causes this error.

App Manifest Overview


Use android:resource in <meta-data> instead of android:src and android:srcCompat


I know it's late to answer here but i do strange mistake so post my answer if it help someone,In my case by mistake I Added Main launcher activity as alias

   <activity-alias
        android:name=".activities.SplashActivity"
        android:targetActivity=".activities.SplashActivity">

        <intent-filter>
            <action android:name="android.intent.action.MAIN"/>
            <category android:name="android.intent.category.LAUNCHER"/>
        </intent-filter>
    </activity-alias>

So When I try to run my app getting error

Error while Installing APK

Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED]

I just remove "-alias" word from activity registration and my app launch successfully.


I create a new application and target it to Android Pie. Everything was working well and good then lately I found that my application don't installs to Android Naught and below version of Android OS.

While installing, I see failure message

Installation failed with message INSTALL_PARSE_FAILED_MANIFEST_MALFORMED.

So what fixes which I made are as follow and they all need to be done in AndroidManifest.xml file only.

For activity, service, receiver and all

Instead of:
    android:name=".service.MyService"

Used: 
    android:name="com.complete.appicationID.service.MyService"

For Manifest permissions

Instead of: 
     <uses-permission android:name="{applicationId}.permission.MAPS_RECEIVE" />
     <permission
         android:name="{applicationId}.permission.MAPS_RECEIVE"
         android:protectionLevel="signature" />

Used:
     <uses-permission android:name="com.complete.appicationID.permission.MAPS_RECEIVE" />
     <permission
         android:name="com.complete.appicationID.permission.MAPS_RECEIVE"
         android:protectionLevel="signature" />

That were all changes which I had to perform to make it work for lower version devices as well.

참고URL : https://stackoverflow.com/questions/6056564/installation-error-install-parse-failed-manifest-malformed

반응형