Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/225.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 安装\解析\失败\清单\格式错误_Android - Fatal编程技术网

Android 安装\解析\失败\清单\格式错误

Android 安装\解析\失败\清单\格式错误,android,Android,我尝试了一切,重命名了软件包,更改了权限等等,但我仍然看到在我的控制台上出现了错误INSTALL\u PARSE\u FAILED\u MANIFEST\u格式错误 我尝试从logcat登录,结果显示installPackageLI和android.content.pm.PackageParser$PackageParserException:/data/app/vmdl170122893.tmp/base.apk在二进制XML文件第33行:没有有效的android:名称,atlast说调试器不

我尝试了一切,重命名了软件包,更改了权限等等,但我仍然看到在我的控制台上出现了错误INSTALL\u PARSE\u FAILED\u MANIFEST\u格式错误

我尝试从logcat登录,结果显示installPackageLI和android.content.pm.PackageParser$PackageParserException:/data/app/vmdl170122893.tmp/base.apk在二进制XML文件第33行:没有有效的android:名称,atlast说调试器不再活动

我试着在em21 ie棒棒糖SDK上运行这个

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="Ca.Rushabh.Mobileproject"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="21" />

<uses-feature
    android:glEsVersion="0x00020000"
    android:required="true" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<permission
    android:name="com.example.mymapsv2.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />

<uses-permission android:name="com.example.mymapsv2.permission.MAPS_RECEIVE" />

<application
    android:allowBackup="true"
    android:icon="@drawable/blue_droid"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name="Ca.Rushabh.Mobileproject.MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="Ca.Rushabh.Mobileproject.About"
        android:label="@string/title_activity_about"
        android:theme="@android:style/Theme.Dialog" >
    </activity>
    <activity
        android:name="Ca.Rushabh.Mobileproject.ToDoList"
        android:label="abcd" />
    <activity
        android:name="Ca.Rushabh.Mobileproject.ToDoDetailActivity"
        android:windowSoftInputMode="stateVisible|adjustResize" />

    <provider
        android:name="Ca.Rushabh.Mobileproject.MyToDoContentProvider"
        android:exported="false"
        android:authorities="com.example.mobileproject.todos.contentprovider" />

    <activity
        android:name="Ca.Rushabh.Mobileproject.ViewAnimationActivity"
        android:label="@string/title_animation" >
    </activity>
    <activity
        android:name="Ca.Rushabh.Mobileproject.ViewAnimation2"
        android:label="@string/title_animation" >
    </activity>
    <activity
        android:name="Ca.Rushabh.Mobileproject.ContactUs"
        android:label="@string/title_activity_contact_us"
        android:theme="@android:style/Theme.Dialog" >
    </activity>
    <activity
        android:name="Ca.Rushabh.Mobileproject.GoogleMapV2"
        android:label="@string/title_activity_google_map_v2" >
    </activity>
    <meta-data
        android:name="com.google.android.gms.version" />
    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
</application>

</manifest>

我发现有不止一个问题


将所有包名更改为小写 更新属性以使其具有有效值。 元数据的正确代码:

<meta-data
    android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />
资料来源:


您的包裹名称中有一个大写字母。尝试重构您的包,使所有字母都是小写的。为此,在项目面板中,确保您处于Android视图模式,然后单击视图指示器右侧的齿轮,然后确保取消选中压缩中间空包。接下来,右键单击包含大写字母的包,然后选择重构->重命名。将其更改为小写,再次检查您的AndroidManifest.xml是否为小写,如果不是,请手动编辑它。

如果您试图将.9.png文件添加到应用程序中,您需要在主活动元数据部分中将xml文件源定义为android资源,这解决了我的问题:

     <meta-data
               android:name="com.google.android.actions
       //add this line
               android:resource="@drawable/sample_button 
       //(here sample_button is the name of your xml file in the drawable folder)"
        />

如果有人在Android 12 Android S预览版上出现此错误。将所有依赖项更新为最新版本,并 请加上-

android:exported="true"

对于任何和。

建议的解决方案都不适合我,因此我发布了这个额外的答案,希望它能帮助其他人

对我来说,有效的方法是按照@karanatwal.github.io的建议为我的所有活动设置导出值,并更新我的所有依赖项,这些依赖项显然没有设置此值

我最初在尝试修复此问题时忽略了依赖项部分,因为在我的研究过程中,我在网上看到了非常具体的错误消息,说这确实是设置导出值的问题,并准确地指出了哪个依赖项不符合它。由于某种原因,我没有收到这个消息


请注意,如果依赖项的最新版本仍然不符合此规则,则此操作可能无效。

您可能希望使用适当的大小写,即包名使用小写字母。包名应始终使用小写字母,请参阅:我编辑以删除您的google map api密钥,发布此类数据之前请小心我已经使用小写字母,我看到很多关于同样的东西改名为大写的讨论,但仍然没有work@RolfSmit去吧,你确实搜索了一个引用,帮我把你所有的包名都改成小写。谢谢:哦!从事Kotlin多平台项目的人花了很多时间寻找解决方案。服务在较低的API中无法工作。只需将包名改为小写即可。非常感谢。还是不为你工作me@or_dvir你是在安卓12手机或模拟器上试用吗?不适合我,在模拟器上使用它。。。还有外部libs的清单文件呢?他们可能没有使用导出,这会影响我的应用程序吗?使用模拟器@tronku发现,除了设置exported=true之外,这也是我的问题所在。我更新了我所有的依赖项,并修复了它。但我想,如果依赖项仍然不符合这一新规则,那么这将不起作用。还请注意,我没有得到其他人得到的具体错误消息,告诉我问题的确切位置is@or_dvir我尝试更新外部LIB的缓存清单,并检查了导出问题的合并清单,但未发现任何结果。。仍然无法在emulator上安装应用程序