Skip to content

LinkApplicationSharedLibraries task fails when project defines support for multiple ABIs #3175

Closed

Description

@pjcollins

Steps to Reproduce

  1. msbuild /t:SignAndroidPackage /p:Configuration=Release AnimationDemo\AnimationsDemo.csproj

Expected Behavior

Projects which explicitly define multiple <AndroidSupportedAbis/>'s should build.

Actual Behavior

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2930,3): error : Unsupported Android target architecture ABI: armeabi-v7a;x86 [/Users/xamarinqa/agent/_work/r1/a/md/AnimationDemo/AnimationsDemo.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2930,3): error :   at Xamarin.Android.Tasks.LinkApplicationSharedLibraries+<GetLinkerConfigs>d__22.MoveNext () [0x0021f] in <83310c6c409a4204aa3f7021aa6ea332>:0  [/Users/xamarinqa/agent/_work/r1/a/md/AnimationDemo/AnimationsDemo.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2930,3): error :   at System.Collections.Concurrent.Partitioner+DynamicPartitionerForIEnumerable`1+InternalPartitionEnumerable[TSource].GrabChunk_Buffered (System.Collections.Generic.KeyValuePair`2[System.Int64,TSource][] destArray, System.Int32 requestedChunkSize, System.Int32& actualNumElementsGrabbed) [0x001c7] in <fdc27973b6a24bbabd806e118f049148>:0  [/Users/xamarinqa/agent/_work/r1/a/md/AnimationDemo/AnimationsDemo.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2930,3): error :   at System.Collections.Concurrent.Partitioner+DynamicPartitionerForIEnumerable`1+InternalPartitionEnumerable[TSource].GrabChunk (System.Collections.Generic.KeyValuePair`2[System.Int64,TSource][] destArray, System.Int32 requestedChunkSize, System.Int32& actualNumElementsGrabbed) [0x00026] in <fdc27973b6a24bbabd806e118f049148>:0  [/Users/xamarinqa/agent/_work/r1/a/md/AnimationDemo/AnimationsDemo.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2930,3): error :   at System.Collections.Concurrent.Partitioner+DynamicPartitionerForIEnumerable`1+InternalPartitionEnumerator[TSource].GrabNextChunk (System.Int32 requestedChunkSize) [0x00023] in <fdc27973b6a24bbabd806e118f049148>:0  [/Users/xamarinqa/agent/_work/r1/a/md/AnimationDemo/AnimationsDemo.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2930,3): error :   at System.Collections.Concurrent.Partitioner+DynamicPartitionEnumerator_Abstract`2[TSource,TSourceReader].MoveNext () [0x000ba] in <fdc27973b6a24bbabd806e118f049148>:0  [/Users/xamarinqa/agent/_work/r1/a/md/AnimationDemo/AnimationsDemo.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2930,3): error :   at System.Threading.Tasks.Parallel+<>c__DisplayClass44_0`2[TSource,TLocal].<PartitionerForEachWorker>b__1 (System.Collections.IEnumerator& partitionState, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x0019f] in <fdc27973b6a24bbabd806e118f049148>:0  [/Users/xamarinqa/agent/_work/r1/a/md/AnimationDemo/AnimationsDemo.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2930,3): error : --- End of stack trace from previous location where exception was thrown --- [/Users/xamarinqa/agent/_work/r1/a/md/AnimationDemo/AnimationsDemo.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2930,3): error :  [/Users/xamarinqa/agent/_work/r1/a/md/AnimationDemo/AnimationsDemo.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2930,3): error :   at System.Threading.Tasks.Parallel+<>c__DisplayClass44_0`2[TSource,TLocal].<PartitionerForEachWorker>b__1 (System.Collections.IEnumerator& partitionState, System.Int32 timeout, System.Boolean& replicationDelegateYieldedBeforeCompletion) [0x0026e] in <fdc27973b6a24bbabd806e118f049148>:0  [/Users/xamarinqa/agent/_work/r1/a/md/AnimationDemo/AnimationsDemo.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2930,3): error :   at System.Threading.Tasks.TaskReplicator+Replica`1[TState].ExecuteAction (System.Boolean& yieldedBeforeCompletion) [0x00000] in <fdc27973b6a24bbabd806e118f049148>:0  [/Users/xamarinqa/agent/_work/r1/a/md/AnimationDemo/AnimationsDemo.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2930,3): error :   at System.Threading.Tasks.TaskReplicator+Replica.Execute () [0x00023] in <fdc27973b6a24bbabd806e118f049148>:0  [/Users/xamarinqa/agent/_work/r1/a/md/AnimationDemo/AnimationsDemo.csproj]
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(2930,3): error XA3001: Unable to link `libxamarin-app.so`: One or more errors occurred. (One or more errors occurred. (Unsupported Android target architecture ABI: armeabi-v7a;x86)) [/Users/xamarinqa/agent/_work/r1/a/md/AnimationDemo/AnimationsDemo.csproj]

Version Information

bce1291

Log File

binlog

Activity

  1. added
    Area: App+Library Build
    on Jun 6, 2019
  2. added this to the d16-2 milestone on Jun 6, 2019
  3. kvpt commented on Jun 6, 2019

    @kvpt

    Since I use the 2019 version I remarked that I have to change the separator that is now ';' whereas before it was ',' in my csproj and worked fine.
    But yours is '%3b' is it supposed to support unicode hexa form too ?

  4. pjcollins commented on Jun 6, 2019

    @pjcollins
    MemberAuthor

    All three separator types mentioned above should continue to work (if defined in the .csproj file itself) as far as I know. You will need to tweak things when passing separated lists directly to the command line however.

  5. grendello commented on Jun 6, 2019

    @grendello
    Contributor

    The splitting is done by MSBuild here https://github.com/xamarin/xamarin-android/blob/master/src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets#L2931-L2941 and for some reason it appears to fail:

    Task "CreateProperty" (TaskId:98)
      Task Parameter:Value=armeabi-v7a;x86 (TaskId:98)
      Output Property: _BuildTargetAbis=armeabi-v7a%3bx86 (TaskId:98)
    Done executing task "CreateProperty". (TaskId:98)
    
    Target "_PrepareApplicationSharedLibraryItems: (TargetId:163)" in file "C:\Program Files (x86)\Microsoft Visual Studio\2019\IntPreview\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets" from project "C:\Users\peter\source\monodroid-samples\AnimationDemo\AnimationsDemo.csproj" (target "_CreateApplicationSharedLibraries" depends on it):
    Added Item(s): _XARuntimeArchitecture=armeabi-v7a;x86
    Added Item(s): 
        _ApplicationSharedLibrary=
            obj\Release\44\app_shared_libraries\armeabi-v7a;x86\libxamarin-app.so
                    abi=armeabi-v7a;x86
    Done building target "_PrepareApplicationSharedLibraryItems" in project "AnimationsDemo.csproj".: (TargetId:163)
    
    

    In fact, it works with master:

    Task "CreateProperty" (TaskId:94)
      Task Parameter:
          Value=
              armeabi-v7a
              x86 (TaskId:94)
      Output Property: _BuildTargetAbis=armeabi-v7a;x86 (TaskId:94)
    
    Target "_PrepareApplicationSharedLibraryItems: (TargetId:153)" in file "/home/grendel/vc/xamarin/xamarin-android/bin/Debug/lib/xamarin.android/xbuild/Xamarin/Android/Xamarin.Android.Common.targets" from project "/home/grendel/Projects/xamarin/httpconnectiontest/httpconnectiontest.csproj" (target "_CreateApplicationSharedLibraries" depends on it):
    Added Item(s): 
        _XARuntimeArchitecture=
            armeabi-v7a
            x86
    Added Item(s): 
        _ApplicationSharedLibrary=
            obj/Debug/app_shared_libraries/armeabi-v7a/libxamarin-app.so
                    abi=armeabi-v7a
    Added Item(s): 
        _ApplicationSharedLibrary=
            obj/Debug/app_shared_libraries/x86/libxamarin-app.so
                    abi=x86
    Done building target "_PrepareApplicationSharedLibraryItems" in project "httpconnectiontest.csproj".: (TargetId:153)
    

    So the difference is, indeed, the %3b URL-encoded value in the log from OP when creating the _BuildTargetAbis property. MSBuild version difference?

  6. jonathanpeppers commented on Jun 7, 2019

    @jonathanpeppers
    Member

    @pjcollins is this broken in 16.1 stable?

    MSBuild only supports ; for a property like this,

    <Foo>a;b;c</Foo>

    Then if you called an MSBuild task:

    <MyTask Input="$(Foo)" />

    It can come through as a string[]:

    public string[] Input { get; set; }

    So we have lots of code like this everywhere to support comma:
    https://github.com/xamarin/xamarin-android/blob/84e67c74a51f16f378f5ba2a4ffe134d662b3c3a/src/Xamarin.Android.Build.Tasks/Tasks/BuildApk.cs#L218

    Would it be reasonable to drop support for ,? If it had a good error message?

    Or do we need to support all three options for all time?

    NOTE: I'll need to test %3b and see what MSBuild does with it natively

  7. jonathanpeppers commented on Jun 7, 2019

    @jonathanpeppers
    Member

    Actually it looks like 16.1 works and 16.2 is broken. That is when the native assembly changes went in:

    Unsupported Android target architecture ABI: armeabi-v7a;x86
     at Xamarin.Android.Tasks.LinkApplicationSharedLibraries.<GetLinkerConfigs>d__22.MoveNext()
    
  8. ghost locked as resolved and limited conversation to collaborators on Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Area: App+Library Build

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions