Eclipse安装失败,原因是无效的APK文件?原因、文件、Eclipse、APK

2023-09-04 23:10:15 作者:大萌比。

我使用的Eclipse开发Android应用程序,但是,当运行项目,出现此错误:

I use Eclipse for develop android apps, but when run projects see this error:

安装由于无效的APK文件失败!

Installation failed due to invalid APK file!

推荐答案

一,我们看到的最常见的原因无效的APK文件错误是由于在不经意间改变了的Andr​​oidManifest.xml 配置,这会导致你的设备上安装复制的APK文件。

One of the most common reasons we see "Invalid APK file" error is due to inadvertently changed AndroidManifest.xml configuration, which results in installing duplicated APK files on your device.

Posibility 1:版本的问题请您的最低和目标SDK版本更高,然后重试

Posibility 1: version problem. Make your minimum and target sdk version higher and try again.

Posibility 2:包mistmatching在的Andr​​oidManifest.xml 不与你的活动与相关的实际包匹配包名称

Posibility 2: package mistmatching. Package name in AndroidManifest.xml does not match with the actual package that your activity is associated with.

三个步骤来解决这个问题:

Three steps to solve this problem:

步骤1.检查你的头文件从你的的Andr​​oidManifest.xml

Step 1. Check your header file from your AndroidManifest.xml.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.yourdomain.yourapp"
    android:versionCode="1"
    android:versionName="1.0" >

第2步:确认您的src文件夹中的包名称是完全一样的,你在步骤1中验证了的。

Step 2. Confirm that your package name in your src folder is exactly the same as the one you verified in Step 1.

例如。 com.yourdomain.yourapp

e.g. com.yourdomain.yourapp

第三步:检查你的包inclustion语句从你的发射活动(如 MainActivity.java ):

Step 3. Check your package inclustion statement from your launcher activity (e.g. MainActivity.java):

package com.yourdomain.yourapp;

如果上述解决方案都不能正常工作,请发表您的logcat为进一步协助。

If the aforementioned solutions are not working, please post your Logcat for further assist.

 
精彩推荐
图片推荐