2016-04-15 29 views
2

我的應用程序完美運行在Android模擬器,但是當我嘗試調試配置部署失敗,並告訴我:的Android Xamarin C#應用程序運行在模擬器,但在實際的設備得到錯誤:[INSTALL_PARSE_FAILED_BAD_MANIFEST]

3>:Deployment failed 
3>Mono.AndroidTools.InstallFailedException: Unexpected install output: pkg: /data/local/tmp/Mono.Android.DebugRuntime-debug.apk 
3>Failure [INSTALL_PARSE_FAILED_BAD_MANIFEST] 
3> 
3> at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) 
3> at Mono.AndroidTools.AndroidDevice.<InstallPackage>c__AnonStoreyD.<>m__0(Task`1 t) 
3> at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke() 
3> at System.Threading.Tasks.Task.Execute() 
3>Deployment failed because of an internal error: Unexpected install output: pkg: /data/local/tmp/Mono.Android.DebugRuntime-debug.apk 
3>Failure [INSTALL_PARSE_FAILED_BAD_MANIFEST] 

我似乎無法確定這個錯誤的真正含義,除了它與Android清單有關嗎?

這是我的清單:

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

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="scout.app" android:versionCode="1" 
      android:versionName="0.0.0" android:installLocation="auto"> 
    <uses-feature android:name="android.hardware.usb.accessory" /> 
    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" /> 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.RESTART_PACKAGES" /> 
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.READ_SMS" /> 
    <uses-permission android:name="android.permission.RECEIVE_SMS" /> 
    <uses-permission android:name="android.permission.READ_PHONE_STATE" /> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
    <application android:label="Scout" android:debuggable="true"></application> 
</manifest> 

編輯:

所以,當我嘗試部署有時這種錯誤,而不是彈出:

2>:Deployment failed 
2>Mono.AndroidTools.InstallFailedException: Unexpected install output: pkg: /data/local/tmp/Mono.Android.DebugRuntime-debug.apk 
2>Failure [INSTALL_PARSE_FAILED_NOT_APK] 
2> 
2> at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) 
2> at Mono.AndroidTools.AndroidDevice.<InstallPackage>c__AnonStoreyD.<>m__0(Task`1 t) 
2> at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke() 
2> at System.Threading.Tasks.Task.Execute() 
2>Deployment failed because of an internal error: Unexpected install output: pkg: /data/local/tmp/Mono.Android.DebugRuntime-debug.apk 
2>Failure [INSTALL_PARSE_FAILED_NOT_APK] 

編輯2:

有時這個錯誤彈出,而且即使我沒有改變任何東西..

1>:Deployment failed 
1>Mono.AndroidTools.InstallFailedException: The package was not properly signed (NO_CERTIFICATES). 
1> at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) 
1> at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass89_0.<InstallPackage>b__0(Task`1 t) 
1> at System.Threading.Tasks.ContinuationTaskFromResultTask`1.InnerInvoke() 
1> at System.Threading.Tasks.Task.Execute() 
1>Deployment failed because of an internal error: The package was not properly signed (NO_CERTIFICATES). 

編輯3:

這是從應用程序/ OBJ /調試/ Android的清單/ AndroidManifest.xml中

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="scout.app" android:versionCode="1" android:versionName="0.0.0" android:installLocation="auto"> 
    <uses-feature android:name="android.hardware.usb.accessory" /> 
    <uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" /> 
    <uses-permission android:name="android.permission.INTERNET" /> 
    <uses-permission android:name="android.permission.RESTART_PACKAGES" /> 
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 
    <uses-permission android:name="android.permission.READ_SMS" /> 
    <uses-permission android:name="android.permission.RECEIVE_SMS" /> 
    <uses-permission android:name="android.permission.READ_PHONE_STATE" /> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
    <application android:label="Scout" android:debuggable="true" android:name="mono.android.app.Application" android:allowBackup="true" android:icon="@drawable/icon"> 
    <receiver android:enabled="true" android:label="InstructionReciever" android:name="md5f8bfa05656068c3725933b788fa9610f.SmsReciever" /> 
    <activity android:icon="@drawable/icon" android:label="Scout" android:name="md5657830f1484ab57cd89db0f9549d303a.MainActivity"> 
     <intent-filter> 
     <action android:name="android.intent.action.MAIN" /> 
     <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <receiver android:enabled="true" android:label="UsbListener" android:name="md5787c3ec38a313bacb6190da23f10b0af.UsbConnectReciever"> 
     <intent-filter> 
     <action android:name="android.hardware.usb.action.USB_ACCESSORY_ATTACHED" /> 
     </intent-filter> 
    </receiver> 
    <receiver android:enabled="true" android:label="UsbListener" android:name="md5787c3ec38a313bacb6190da23f10b0af.UsbDisconnectReciever"> 
     <intent-filter> 
     <action android:name="android.hardware.usb.action.USB_ACCESSORY_DETACHED" /> 
     </intent-filter> 
    </receiver> 
    <provider android:name="mono.MonoRuntimeProvider" android:exported="false" android:initOrder="2147483647" android:authorities="scout.app.mono.MonoRuntimeProvider.__mono_init__" /> 
    <!--suppress ExportedReceiver--> 
    <receiver android:name="mono.android.Seppuku"> 
     <intent-filter> 
     <action android:name="mono.android.intent.action.SEPPUKU" /> 
     <category android:name="mono.android.intent.category.SEPPUKU.scout.app" /> 
     </intent-filter> 
    </receiver> 
    </application> 
</manifest> 
+0

是scout.app您的完整名稱空間? –

+0

Manifest對我來說看起來不錯,而MFractor中的靜態分析器顯示沒有問題。也許運行它通過一個XML格式化工整理它,徹底卸載應用程序,然後再試一次? – matthewrdev

+0

@LibinJoseph是的,這是全名空間。 – wootank

回答

2

我有錯誤的類似種種嘗試調試時可能發生安裝發行版後。

修復方法是先通過設備上的應用程序管理器手動卸載應用程序。

有時它僅在名稱空間下的應用程序管理器中顯示,而不是應用程序名稱。

相關問題