locked
Crash when TaskAffinity is a non-empty string RRS feed

  • Question

  • User158425 posted

    Version Information

    • Visual Studio 2015
    • Xamarin 4.0.1.96
    • Xamarin.Android 6.0.1.10
    • Xamarin.iOS 9.4.1.24

    Devices Reproduced On

    • Nexus 4 Lollipop image on Xamarin Player
    • HTC Desire 320

    Expected

    The application starts and displays the main activity layout.

    Actual

    The application crashes at startup.

    Build Log

    1>------ Build started: Project: TaskAffinityBug, Configuration: Debug Any CPU ------ 1> Processing: obj\Debug\res\layout\main.xml 1> Processing: obj\Debug\res\values\strings.xml 1> TaskAffinityBug -> c:\xxx\TaskAffinityBug\TaskAffinityBug\bin\Debug\TaskAffinityBug.dll 1> Processing: obj\Debug\res\layout\main.xml 1> Processing: obj\Debug\res\values\strings.xml 1> Processing: obj\Debug\res\layout\main.xml 1> Processing: obj\Debug\res\values\strings.xml 2>Starting deploy htc Desire 320 ... 2>Deploying htc Desire 320 ... 2>Build started. 2>C:\Program Files (x86)\MSBuild\14.0\bin\csc.exe /noconfig /nowarn:1701,1702,2008 /nostdlib+ /errorreport:prompt /warn:4 /define:DEBUG;TRACE;__XAMARIN_ANDROID_v1_0__;__MOBILE__;__ANDROID__;__ANDROID_1__;__ANDROID_2__;__ANDROID_3__;__ANDROID_4__;__ANDROID_5__;__ANDROID_6__;__ANDROID_7__;__ANDROID_8__;__ANDROID_9__;__ANDROID_10__;__ANDROID_11__;__ANDROID_12__;__ANDROID_13__;__ANDROID_14__;__ANDROID_15__;__ANDROID_16__;__ANDROID_17__;__ANDROID_18__;__ANDROID_19__;__ANDROID_20__;__ANDROID_21__;__ANDROID_22__;__ANDROID_23__ /errorendlocation /preferreduilang:en-US /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v6.0\Mono.Android.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\mscorlib.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\MonoAndroid\v1.0\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\TaskAffinityBug.dll /ruleset:"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Team Tools\Static Analysis Tools\\Rule Sets\MinimumRecommendedRules.ruleset" /target:library /utf8output MainActivity.cs Resources\Resource.Designer.cs Properties\AssemblyInfo.cs "c:\xxx\AppData\Local\Temp\MonoAndroid,Version=v6.0.AssemblyAttributes.cs" obj\Debug\\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs obj\Debug\\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs obj\Debug\\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs 2>TaskAffinityBug -> c:\xxx\TaskAffinityBug\TaskAffinityBug\bin\Debug\TaskAffinityBug.dll 2> Processing: obj\Debug\res\layout\main.xml 2> Processing: obj\Debug\res\values\strings.xml 2>C:\Program Files (x86)\Java\jdk1.7.0_71\\bin\keytool.exe -list -alias androiddebugkey -storepass android -keypass android -keystore "c:\xxx\AppData\Local\Xamarin\Mono for Android\debug.keystore" 2>C:\Program Files (x86)\Java\jdk1.7.0_71\\bin\jarsigner.exe -keystore "c:\xxx\AppData\Local\Xamarin\Mono for Android\debug.keystore" -storepass android -keypass android -digestalg SHA1 -sigalg md5withRSA -signedjar bin\Debug\\TaskAffinityBug.TaskAffinityBug-Signed-Unaligned.apk "c:\xxx\TaskAffinityBug\TaskAffinityBug\obj\Debug\android\bin\TaskAffinityBug.TaskAffinityBug.apk" androiddebugkey 2>No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2045-09-03) or after any future revocation date. 2>c:\xxx\AppData\Local\Android\android-sdk\build-tools\23.0.1\zipalign.exe 4 "c:\xxx\TaskAffinityBug\TaskAffinityBug\bin\Debug\TaskAffinityBug.TaskAffinityBug-Signed-Unaligned.apk" "bin\Debug\\TaskAffinityBug.TaskAffinityBug-Signed.apk" 2>:Deployment failed 2>Mono.AndroidTools.InstallFailedException: Unexpected install output: pkg: /data/local/tmp/TaskAffinityBug.TaskAffinityBug-Signed.apk 2>Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED] 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/TaskAffinityBug.TaskAffinityBug-Signed.apk 2>Failure [INSTALL_PARSE_FAILED_MANIFEST_MALFORMED] 2> 2>InternalError 2>Build succeeded. 2>Deploy successfully on htc Desire 320 ========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ========== ========== Deploy: 1 succeeded, 0 failed, 0 skipped ==========

    Test Project

    See attachment.

    Tuesday, February 23, 2016 4:05 AM

All replies

  • User66025 posted

    @EricBrisco,

    It's problem with your TaskAffinity

    Try :

    [Activity(Label = "TaskAffinityBug", MainLauncher = true, Icon = "@drawable/icon", TaskAffinity = "")]
    

    Refer : http://inthecheesefactory.com/blog/understand-android-activity-launchmode/en

    Tuesday, February 23, 2016 6:49 AM
  • User158425 posted

    The point of this report is that there is a crash and malformed Manifest when TaskAffinity is non-empty.

    • https://developer.android.com/guide/components/tasks-and-back-stack.html#Affinities
    • https://developer.android.com/guide/topics/manifest/activity-element.html#aff
    Tuesday, February 23, 2016 4:39 PM
  • User148830 posted

    This is a huge problem. Has anyone from Xamarin acknowledged this bug?

    Thursday, January 5, 2017 4:50 PM
  • User25824 posted

    Is there an update regarding this problem?

    Thursday, March 23, 2017 11:27 AM