“此应用与您的手机不兼容”Android 7.0

时间:2017-08-19 03:46:16

标签: android xamarin xamarin.android

我有一个基本的网络应用程序,它是一个启动页面活动,然后是一个Web视图操作。我正试图在我的三星s7手机上安装它。我们使用带有Xamarin的Visual Studio 2014构建了应用程序,并且能够构建和部署包。 我们使用Genymotion三星s7模拟器测试了应用程序,它在那里工作。当我尝试将应用程序加载到实际手机时,我收到的错误是“应用程序未安装。此应用程序与您的手机不兼容”。 我需要两种帮助。如何获取错误日志以确定我的实际问题是什么,或者我在哪里验证我的设置以确保其与我的手机兼容?

这是清单

<?xml version="1.0" encoding="utf-8"?>
<manifest 
 xmlns:android="http://schemas.android.com/apk/res/android" 
 android:versionCode="1" 
 android:versionName="1.0" 
 package="Application.Webview" 
 android:installLocation="auto">

    <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="25" />
    <uses-permission android:name="android.permission.INTERNET" />

    <application 
         android:label="HomeDown" 
         android:icon="@drawable/Icon">
     </application>
</manifest>

这是我找到的日志文件

 08-18 19:26:58.364: D/InputReader(1578): Input event(6): value=0 
 when=12676335778000
 08-18 19:26:58.364: D/InputReader(1578): Input event(6): value=0 
 when=12676335778000
 08-18 19:26:58.364: I/InputReader(1578): Touch event's action is 0x1 
 (deviceType=0) [pCnt=1, s=] when=12676335778000
 08-18 19:26:58.365: I/InputDispatcher(1578): Delivering touch to 
 (26207): action: 0x1, toolType: 1
 08-18 19:26:58.365: D/ViewRootImpl@eece518InstallAppProgress: 
 ViewPostImeInputStage processPointer 1
 08-18 19:26:58.365: I/InstallAppProgress(26207): Finished installing 
 HomeDown.HomeDown
 08-18 19:26:58.367: W/MultiScreenManagerService(1578): 
 moveTaskBackToDisplayIfNeeded(): The task has more than one activity
 08-18 19:26:58.368: D/ActivityManager(1578): moveToFront() : 
 reason=finishActivity adjustFocus setFocusedActivity isAttached=true
 TaskRecord{e3392e7d0 #15169 A=com.sec.android.app.myfiles U=0 
 StackId=1 sz=2}
 08-18 19:26:58.372: D/InputDispatcher(1578): Focused application set 
 to: xxxx
 08-18 19:26:58.373: D/ActivityTrigger(1578): ActivityTrigger
 activityPauseTrigger
 08-18 19:26:58.373: D/GameManagerService(1578): sem_perfomance_mode: 0
08-18 19:26:58.380: D/ActivityManager(1578): 
resumeTopActivityInnerLocked() : #1 prevTask=TaskRecord{e3392e7d0 #15169
A=com.sec.android.app.myfiles U=0 StackId=1 sz=2} 
next=ActivityRecord{168f10bd0 u0 
com.sec.android.app.myfiles/.common.MainActivity
t15169} mFocusedStack=ActivityStack{4015b39d0 stackId=1, 2 tasks}

1 个答案:

答案 0 :(得分:3)

假设您的APK 使用正确的ABI构建

您的Samsung S7有一个Snapdragon 820(public static class XmlKeyValueListHelper { const string RootLocalName = "Root"; public static XElement [] SerializeToXElements<T>(this IEnumerable<KeyValuePair<string, T>> dictionary, XNamespace ns) { if (dictionary == null) return null; ns = ns ?? ""; var serializer = XmlSerializerFactory.Create(typeof(T), RootLocalName, ns.NamespaceName); var array = dictionary .Select(p => new { p.Key, Value = p.Value.SerializeToXElement(serializer, true) }) // Fix name and remove redundant xmlns= attributes. XmlWriter will add them back if needed. .Select(p => new XElement(ns + p.Key, p.Value.Attributes().Where(a => !a.IsNamespaceDeclaration), p.Value.Elements())) .ToArray(); return array; } public static IEnumerable<KeyValuePair<string, T>> DeserializeFromXElements<T>(this IEnumerable<XElement> elements) { if (elements == null) yield break; XmlSerializer serializer = null; XNamespace ns = null; foreach (var element in elements) { if (serializer == null || element.Name.Namespace != ns) { ns = element.Name.Namespace; serializer = XmlSerializerFactory.Create(typeof(T), RootLocalName, ns.NamespaceName); } var elementToDeserialize = new XElement(ns + RootLocalName, element.Attributes(), element.Elements()); yield return new KeyValuePair<string, T>(element.Name.LocalName, elementToDeserialize.Deserialize<T>(serializer)); } } public static XmlSerializerNamespaces NoStandardXmlNamespaces() { var ns = new XmlSerializerNamespaces(); ns.Add("", ""); // Disable the xmlns:xsi and xmlns:xsd lines. return ns; } public static XElement SerializeToXElement<T>(this T obj) { return obj.SerializeToXElement(null, NoStandardXmlNamespaces()); } public static XElement SerializeToXElement<T>(this T obj, XmlSerializerNamespaces ns) { return obj.SerializeToXElement(null, ns); } public static XElement SerializeToXElement<T>(this T obj, XmlSerializer serializer, bool omitStandardNamespaces) { return obj.SerializeToXElement(serializer, (omitStandardNamespaces ? NoStandardXmlNamespaces() : null)); } public static XElement SerializeToXElement<T>(this T obj, XmlSerializer serializer, XmlSerializerNamespaces ns) { var doc = new XDocument(); using (var writer = doc.CreateWriter()) (serializer ?? new XmlSerializer(obj.GetType())).Serialize(writer, obj, ns); var element = doc.Root; if (element != null) element.Remove(); return element; } public static T Deserialize<T>(this XContainer element, XmlSerializer serializer) { using (var reader = element.CreateReader()) { object result = (serializer ?? new XmlSerializer(typeof(T))).Deserialize(reader); return (T)result; } } } public static class XmlSerializerFactory { // To avoid a memory leak the serializer must be cached. // https://stackoverflow.com/questions/23897145/memory-leak-using-streamreader-and-xmlserializer // This factory taken from // https://stackoverflow.com/questions/34128757/wrap-properties-with-cdata-section-xml-serialization-c-sharp/34138648#34138648 readonly static Dictionary<Tuple<Type, string, string>, XmlSerializer> cache; readonly static object padlock; static XmlSerializerFactory() { padlock = new object(); cache = new Dictionary<Tuple<Type, string, string>, XmlSerializer>(); } public static XmlSerializer Create(Type serializedType, string rootName, string rootNamespace) { if (serializedType == null) throw new ArgumentNullException(); if (rootName == null && rootNamespace == null) return new XmlSerializer(serializedType); lock (padlock) { XmlSerializer serializer; var key = Tuple.Create(serializedType, rootName, rootNamespace); if (!cache.TryGetValue(key, out serializer)) cache[key] = serializer = new XmlSerializer(serializedType, new XmlRootAttribute { ElementName = rootName, Namespace = rootNamespace }); return serializer; } } } 一个Exynos 8890(ABI = ARMv8-A = ABI)SoC,具体取决于您购买的世界它

因此,您需要至少使用ARMv7构建的APK才能在全球所有三星S7上运行,GenyMotion模拟器将使用ARMABI-V7A ABI。

最简单的解决方法是将所有ABI打包到您的APK中,在Xamarin Android&#34; Advanced&#34;构建设置你会在那里找到ABI选项(对于调试和发布版本,它们可以不同,所以如果需要,可以在两种配置中更改它们)。

enter image description here