Search Unity

NatShare - Free Sharing API

Discussion in 'Assets and Asset Store' started by Lanre, Apr 17, 2018.

  1. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    I'll reopen the issue and keep searching for fixes.
     
  2. AlexeySeverin

    AlexeySeverin

    Joined:
    Oct 6, 2016
    Posts:
    12
    Could you maybe add the GetThumbnail() function back until NatReader is finalized? The description says "INCOMPLETE", demo scene gives errors and the documentation is basically nonexistent.
     
  3. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    The top level README is empty but not the package README. Also see the included example.
     
  4. AlexeySeverin

    AlexeySeverin

    Joined:
    Oct 6, 2016
    Posts:
    12
    Well, as I already wrote in the corresponding forum thread, the demo scene gives me an "EntryPointNotFoundException: NRCreateMP4FrameReader" error.
    Could you at least please explain (here or in NatReader thread) in a beginner-friendly way how to acheive a result similar to the old "NatShare.GetThumbnail()" function using NatReader? How do you get a single frame as a texture instead of displaying all frames in a sequence like the example is supposed to do? Thanks in advance.
     
  5. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    The Windows backend for NatReader isn't complete. NatReader currently only works on iOS, Android, and macOS. To get a single frame instead of all of them, simply break out of the loop.
     
  6. timbokoppers

    timbokoppers

    Joined:
    Nov 14, 2016
    Posts:
    71
    I have the same issue, happens on iOS 13. When cancelling an app (for example mail) in the native share dialog and then share through another app (whatsapp) it crashes. Only happen if you can and then share again,.

    Code (CSharp):
    1.  
    2. 2020-02-03 17:43:16.954810+0100 realmoji[44961:7191873] [LayoutConstraints] Unable to simultaneously satisfy constraints.
    3.     Probably at least one of the constraints in the following list is one you don't want.
    4.    Try this:
    5.        (1) look at each constraint and try to figure out which you don't expect;
    6.         (2) find the code that added the unwanted constraint or constraints and fix it.
    7. (
    8.     "<NSLayoutConstraint:0x28294b3e0 _UIActivityActionCellTitleLabel:0x129863460.height >= 22   (active)>",
    9.     "<NSLayoutConstraint:0x28294af30 V:|-(15)-[_UIActivityActionCellTitleLabel:0x129863460]   (active, names: '|':UIView:0x129863130 )>",
    10.     "<NSLayoutConstraint:0x28294af80 V:[_UIActivityActionCellTitleLabel:0x129863460]-(15)-|   (active, names: '|':UIView:0x129863130 )>",
    11.     "<NSLayoutConstraint:0x2829119f0 'UIView-Encapsulated-Layout-Height' UIView:0x129863130.height == 49.3333   (active)>"
    12. )
    13.  
    14. Will attempt to recover by breaking constraint
    15. <NSLayoutConstraint:0x28294b3e0 _UIActivityActionCellTitleLabel:0x129863460.height >= 22   (active)>
    16.  
    17. Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
    18. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
    19. 2020-02-03 17:43:16.989313+0100 realmoji[44961:7191873] [LayoutConstraints] Unable to simultaneously satisfy constraints.
    20.     Probably at least one of the constraints in the following list is one you don't want.
    21.    Try this:
    22.        (1) look at each constraint and try to figure out which you don't expect;
    23.         (2) find the code that added the unwanted constraint or constraints and fix it.
    24. (
    25.     "<NSLayoutConstraint:0x28294e350 _UIActivityActionCellTitleLabel:0x11e8c4420.height >= 22   (active)>",
    26.     "<NSLayoutConstraint:0x28294dea0 V:|-(15)-[_UIActivityActionCellTitleLabel:0x11e8c4420]   (active, names: '|':UIView:0x11e8c3cf0 )>",
    27.     "<NSLayoutConstraint:0x28294def0 V:[_UIActivityActionCellTitleLabel:0x11e8c4420]-(15)-|   (active, names: '|':UIView:0x11e8c3cf0 )>",
    28.     "<NSLayoutConstraint:0x282911630 'UIView-Encapsulated-Layout-Height' UIView:0x11e8c3cf0.height == 49.3333   (active)>"
    29. )
    30.  
    31. Will attempt to recover by breaking constraint
    32. <NSLayoutConstraint:0x28294e350 _UIActivityActionCellTitleLabel:0x11e8c4420.height >= 22   (active)>
    33.  
    34. Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
    35. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
    36. 2020-02-03 17:43:16.991182+0100 realmoji[44961:7191873] [LayoutConstraints] Unable to simultaneously satisfy constraints.
    37.     Probably at least one of the constraints in the following list is one you don't want.
    38.    Try this:
    39.        (1) look at each constraint and try to figure out which you don't expect;
    40.         (2) find the code that added the unwanted constraint or constraints and fix it.
    41. (
    42.     "<NSLayoutConstraint:0x282963020 _UIActivityActionCellTitleLabel:0x129871e50.height >= 22   (active)>",
    43.     "<NSLayoutConstraint:0x282962b70 V:|-(15)-[_UIActivityActionCellTitleLabel:0x129871e50]   (active, names: '|':UIView:0x129871b20 )>",
    44.     "<NSLayoutConstraint:0x282962bc0 V:[_UIActivityActionCellTitleLabel:0x129871e50]-(15)-|   (active, names: '|':UIView:0x129871b20 )>",
    45.     "<NSLayoutConstraint:0x282911db0 'UIView-Encapsulated-Layout-Height' UIView:0x129871b20.height == 49.3333   (active)>"
    46. )
    47.  
    48. Will attempt to recover by breaking constraint
    49. <NSLayoutConstraint:0x282963020 _UIActivityActionCellTitleLabel:0x129871e50.height >= 22   (active)>
    50.  
    51. Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
    52. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
    53. Successfully shared items: False
    54. FaceActing.<CaptureScreen>d__13:System.Collections.IEnumerator.get_Current()
    55. System.Threading.ContextCallback:Invoke(Object)
    56. System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)
    57. System.Runtime.CompilerServices.MoveNextRunner:Run()
    58. System.Action:Invoke()
    59. System.Threading.ContextCallback:Invoke(Object)
    60. System.Threading.Tasks.AwaitTaskContinuation:RunCallback(ContextCallback, Object, Task&)
    61. System.Threading.Tasks.Task:FinishContinuations()
    62. System.Threading.Tasks.Task`1:TrySetResult(TResult)
    63. System.Threading.Tasks.TaskCompletionSource`1:TrySetResult(TResult)
    64. System.Threading.Tasks.TaskCompletionSource`1:SetResult(TResult)
    65. NatShare.Internal.NativePayload:OnCompletion(IntPtr, Boolean)
    66. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    67.  
    68. 2020-02-03 17:43:40.263659+0100 realmoji[44961:7192450] [ShareSheet] connection invalidated
    69. libc++abi.dylib: terminating with uncaught exception of type Il2CppExceptionWrapper
    70. (lldb)
     
  7. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Add an exception breakpoint in Xcode and share a screenshot of the stack trace. The Il2CppExceptionWrapper means that the exception is coming from C#, not from Objective-C.
     
  8. HankHongChen

    HankHongChen

    Joined:
    Jan 19, 2016
    Posts:
    4
    Hi, thanks for making NatShare FREE!
    I get some problem with share multiple items at once. Hope you can help.

    Here are my codes.

    Texture2D texture = ScreenCapture.CaptureScreenshotAsTexture();
    using (var payload = new SharePayload())
    {
    payload.AddText("Share test");
    payload.AddImage(texture);
    //payload.Dispose();
    }

    I ran the test on iOS 13.
    Thing is that, when I share it on whatsapp, I can only saw the test, and when I share it on wechat, I can only saw the Picture. If I share it on Messages, I can saw them all.

    Is this a bug or not cause currently I will need a share function that can share Images and text at once?
    Thanks.
     
  9. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    This is not a bug. The receiving app decides what to take and what to leave.
     
  10. lordzeon

    lordzeon

    Joined:
    Jun 1, 2018
    Posts:
    44
    Hi, im trying to make natcorder work with shareSDK, im having a problem when i try to share to instagram, "History" don´t open IG app and "feed" open IG but nothing happen, but there is no error log, for facebook, the same works normally, maybe the path to share should be different for instagram sharing? im trying this in android phone and it is very important for my app to record and share in instagram, do you know how to solve this?
     
    jessmzp and AlexeySeverin like this.
  11. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    The receiving app is responsible for taking what it wants from the share payload. I don't know that there is any way to force Instagram to take whatever you add to the payload.
     
  12. lordzeon

    lordzeon

    Joined:
    Jun 1, 2018
    Posts:
    44
    Thanks for answering, the weir thing is that if i go to file explorer or any other app in the device, i could make the same with the saved video and instagram take the video without problem, that is why i think that maybe there is one extra step or url formatting other apps are doing differently.
     
  13. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    If your goal is to only share video, then you might be able to get it to work by hard-coding the MIME type to "video/mp4". You can clone or fork NatShare and test out any modifications you make.
     
  14. jose_pedro_didimo

    jose_pedro_didimo

    Joined:
    May 2, 2018
    Posts:
    15
    I am also having issues with iOS 13.3. I upgraded to the latest NatShare version but it did not solve the issue.

    Code (CSharp):
    1. Presenting view controllers on detached view controllers is discouraged <UnityPortraitOnlyViewController: 0x14fe62640>.
    2. [LayoutConstraints] Unable to simultaneously satisfy constraints.
    3. Probably at least one of the constraints in the following list is one you don't want.
    4. Try this:
    5. (1) look at each constraint and try to figure out which you don't expect;
    6. (2) find the code that added the unwanted constraint or constraints and fix it.
    7. (
    8.  
    9.     "<NSLayoutConstraint:0x28365def0 LPLinkView:0x151e3db30.leading == UILayoutGuide:0x282f988c0'UIViewLayoutMarginsGuide'.leading   (active)>",
    10.  
    11.     "<NSLayoutConstraint:0x28365dd10 H:[LPLinkView:0x151e3db30]-(59)-|   (active, names: '|':_UIActivityContentTitleView:0x151e3e4a0 )>",
    12.  
    13.     "<NSLayoutConstraint:0x283667bb0 H:|-(0)-[_UIActivityContentTitleView:0x151e3e4a0]   (active, names: '|':_UINavigationBarContentView:0x151e47f90 )>",
    14.  
    15.     "<NSLayoutConstraint:0x283667c00 _UIActivityContentTitleView:0x151e3e4a0.trailing == _UINavigationBarContentView:0x151e47f90.trailing   (active)>",
    16.  
    17.     "<NSLayoutConstraint:0x28364f160 'UIView-Encapsulated-Layout-Width' _UINavigationBarContentView:0x151e47f90.width == 0   (active)>",
    18.  
    19.     "<NSLayoutConstraint:0x28365d310 'UIView-leftMargin-guide-constraint' H:|-(16)-[UILayoutGuide:0x282f988c0'UIViewLayoutMarginsGuide'](LTR)   (active, names: '|':_UIActivityContentTitleView:0x151e3e4a0 )>"
    20. )
    21.  
    22. Will attempt to recover by breaking constraint
    23. <NSLayoutConstraint:0x28365def0 LPLinkView:0x151e3db30.leading == UILayoutGuide:0x282f988c0'UIViewLayoutMarginsGuide'.leading   (active)>
    24. Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
    25.  
    26. The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
     
  15. Zed67

    Zed67

    Joined:
    Jun 1, 2018
    Posts:
    2
    Sorry posted this on the NatCorder thread by mistake,does anyone know how I would be able to add Instagram stories to the share list on the native popup? I see the standard Instagram wall option only but I'm trying to mimic say Spotify or TikTok which allows you to distinguish between the 2. Thanks!
     
  16. lordzeon

    lordzeon

    Joined:
    Jun 1, 2018
    Posts:
    44
    that must be!, im very rusty with java development, i don´t even have a IDE installed, there is any chance you could expose the MIME type to the Asset? i bought NatCorder because i thought it will integrate perfectly with NatShare, i know is not a bug, just a small feature that could be good for both assets.... aaaandd i will owe you a beer :)
     
  17. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    We still haven't found a fix for this. It seems to be some incompatibility between the share sheet and the Unity view controller.
     
  18. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    I can't expose the MIME to the front-end API because it is an Android-specific detail. This is a modification you'd make yourself for your specific use case.
     
  19. Meneghetti

    Meneghetti

    Joined:
    Aug 26, 2014
    Posts:
    3
    Hello!

    (EDIT Below!)
    I'm using NatShare with NatCorder, but I'm unable to share .mp4 files...

    Here's what I got (lastRecPath is the path to the file with the extension):

    Code (CSharp):
    1. using (var payload = new SharePayload(
    2.                 completionHandler: () => {
    3.                     Debug.Log("User shared video!" + lastRecPath);
    4.                 }))
    5.                 payload.AddMedia(lastRecPath);
    The app shows the sharing option, but when I try to share with someone (be it Messenger, Whatsapp, or any other app), I receive an alert saying that "The file format is not supported".

    I get no errors when sharing an Image with "AddImage()".

    Thanks and keep up the great work!


    EDIT:

    So, I found that the problem is the Path. Is there a way to customize the path of a video or to get the last saved file name?

    Thanks!
     
    Last edited: Feb 17, 2020
  20. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    You can't modify the path where NatCorder saves. You can save the path in a variable somewhere and refer back to it when you need it.
     
  21. Meneghetti

    Meneghetti

    Joined:
    Aug 26, 2014
    Posts:
    3
    Ok! Thanks! I've made it work, but it would be nice to be able to customize the file name ^^

    Cheers!
     
    Lanre likes this.
  22. Zed67

    Zed67

    Joined:
    Jun 1, 2018
    Posts:
    2
    I take it this isn't easy or possible with Natshare without a lot of custom work?
     
  23. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    I wouldn't even know where to start with this, as I am completely unfamiliar with sharing directly to Instagram.
     
    Zed67 likes this.
  24. arapps3d

    arapps3d

    Joined:
    Jan 13, 2015
    Posts:
    19
    Hi , I want to save / share recorded mp4 videos from Natcorder on iOS(13.3.1). Unity Version 2019.2.1f1.
    The only option that works is to save the video to a folder.
    "Save Video" freezes my app. Gmail / dropbox /IG sharing does not work. Dropbox says it can't upload the video.
    Gmail simply has no attachment. Instagram always tells me video must be longer than 3sec, even when it is longer than that.
    Does anybody know what could be the problem? I have set the two keys for permissons in info.plist.
    Any help would be fantastic! Thanks.
    https://ibb.co/m9yk3XF
     
    Last edited: Mar 10, 2020
  25. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Can you share the full logs from logcat, and the video itself? Can you share your recording code?
     
  26. arapps3d

    arapps3d

    Joined:
    Jan 13, 2015
    Posts:
    19
    Hi, so what did the trick was to remove the prefix:

    wrong code:
    Code (CSharp):
    1. payload.AddMedia($"{prefix}{path}"); // wrong!
    correct:
    Code (CSharp):
    1.   payload.AddMedia($"{path}"); //correct
    Thanks, Lanre !!
     
    Lanre likes this.
  27. ulissescad

    ulissescad

    Joined:
    Oct 31, 2015
    Posts:
    14
    Hi!

    I tryed use this to share a image, but i can't find any examples. The git page has this example:


    Texture2D image = ...;
    var payload = new SharePayload()
    payload.AddImage(image);
    payload.Commit();

    But the commit method doens't exists. So, I try use the method Dispose() but aways return this error:

    upload_2020-3-24_9-13-44.png
    upload_2020-3-24_9-15-34.png
    Even when I put a 2d texture for test, not using screen capture. Can you help me?
     
  28. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Download NatShare 1.2.2 from the Asset Store. The update was published 4 days ago. You can also grab it from GitHub. Also it looks like your texture is null.
     
  29. Seginus

    Seginus

    Joined:
    Feb 1, 2018
    Posts:
    18
    I recently implemented Natcorder+Natshare, but was getting the sharing error on iOS that is addressed in 1.2.2. However, after updating and replacing relevant code I'm getting a compilation error when building to Android with an il2cpp backend, saying it can't find most of the NS functions:

    D:\...\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:32676: error: undefined reference to 'NSCreateSharePayload'
    D:\...\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:32695: error: undefined reference to 'NSCreateSavePayload'
    D:\...\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:32714: error: undefined reference to 'NSCreatePrintPayload'
    D:\...\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:32729: error: undefined reference to 'NSAddText'
    D:\...\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:32743: error: undefined reference to 'NSAddImage'
    D:\...\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:32757: error: undefined reference to 'NSAddMedia'
    D:\...\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:32771: error: undefined reference to 'NSCommit'
    D:\...\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:32729: error: undefined reference to 'NSAddText'
    D:\...\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:32743: error: undefined reference to 'NSAddImage'
    D:\...\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:32757: error: undefined reference to 'NSAddMedia'
    D:\...\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:32771: error: undefined reference to 'NSCommit'
    D:\...\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:32714: error: undefined reference to 'NSCreatePrintPayload'
    D:\...\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp.cpp:32676: error: undefined reference to 'NSCreateSharePayload'
    I didn't have any issues building to Android prior to upgrading (and fully uninstalled that last version of NatShare before updating to the latest version) so I'm unsure how it broke in the update.
     
  30. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Thanks for catching this. I've opened a PR with the fix.
     
  31. Seginus

    Seginus

    Joined:
    Feb 1, 2018
    Posts:
    18
    Hate to bother again, but the sharing function seems to be having trouble working correctly.

    On iOS, even with the recent update to 1.2.2, the share function doesn't seem to work. The code I used is pretty straightforward:

    Code (CSharp):
    1.         async void Share()
    2.         {
    3.             ISharePayload s = new SharePayload().AddMedia(_currentFile);
    4.             var success = await s.Commit();
    5.             Debug.Log($"Successfully shared items: {success}");
    6.         }
    The window does not appear on iOS, and I never get a return or print out from the console (it functions on Android).

    On that note, while I can at least view the Android sharing window, it never gets to the Debug statement if you tap outside of the sharing window to close it.
     
  32. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Can you print the value of "_currentFile"?
    This is a limitation of Android. It doesn't notify the app if the user doesn't complete the share.
     
  33. Seginus

    Seginus

    Joined:
    Feb 1, 2018
    Posts:
    18
    The path is built by using Application.persistentDataPath + "/UserData/" + filename (it gets moved here after recording with NatCorder). The app has no problem finding the file; I have a video playback in-app that works fine with this filepath.

    Should it still help, the output for _currentFile was:

    /var/mobile/Containers/Data/Application/.../Documents/UserData/Music Is Mine (3-28-2020 2:05:37 PM).mp4

    That's good to know, but doesn't that mean there's a thread still running? Does it timeout after a while or will I need to implement that myself?
     
  34. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Does the sharing dialog pop up if you don't move the video?
    There isn't any thread associated with this. Unity simply checks if the task has completed every frame, and in this case the task will never complete.
     
  35. Seginus

    Seginus

    Joined:
    Feb 1, 2018
    Posts:
    18
    Nope. Tried this:
    Code (CSharp):
    1. _videoPath = await _recorder.FinishWriting();
    2. ISharePayload s = new SharePayload().AddMedia(_videoPath);
    3. bool success = await s.Commit();
    And still no sharing dialog appears.

    EDIT: On further testing, it looks like saving to camera roll is also not working, on either platform. iOS is showing the same behavior as trying to share (i.e. never reaches the debug statement for success/failure). Android immediately returns a failure with no dialog appearing.

    I'm not sure if there's some steps I haven't taken to get the plugin setup properly? Android has been setup with WRITE_EXTERNAL in the manifest and I added both of the mentioned permissions to the info.plist for iOS. Could it be something else?
     
    Last edited: Mar 31, 2020
  36. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Can you share the full logs, from recording to sharing? And can you share your recording code? The video might be damaged.
     
  37. Seginus

    Seginus

    Joined:
    Feb 1, 2018
    Posts:
    18
    I'm pretty sure the video file isn't damaged. Part of the application is an in-app viewer of your recorded videos (this is the same view where the user can share the video), and all recordings are showing there and playing fine.

    The output from Xcode running the app has the following. The SonicBloom.Koreo messages are for timing of the music that's being recorded:
    Code (CSharp):
    1.  
    2. 2020-04-01 13:18:50.502412-0400 ARDancing[823:621008] NatCorder: Prepared MP4Recorder video encoder at resolution 1280x720@30.000000Hz with average bitrate 5909760 and keyframe interval 3s
    3. 2020-04-01 13:18:50.503269-0400 ARDancing[823:621008] NatCorder: Prepared MP4Recorder audio encoder for 2 channels at 24000Hz
    4. Animation speed set to: 0.9027777
    5. DanceAnimations:BeginTrack(KoreographyEvent)
    6. SonicBloom.Koreo.KoreographyEventCallback:Invoke(KoreographyEvent)
    7. SonicBloom.Koreo.EventObj:Trigger(KoreographyEvent, Int32, Int32, DeltaSlice)
    8. SonicBloom.Koreo.KoreographyEventCallbackWithTime:Invoke(KoreographyEvent, Int32, Int32, DeltaSlice)
    9. SonicBloom.Koreo.KoreographyTrackBase:CheckForEvents(Int32, Int32, DeltaSlice)
    10. SonicBloom.Koreo.Koreography:UpdateTrackTime(Int32, Int32, DeltaSlice)
    11. SonicBloom.Koreo.Koreographer:ProcessKoreography(String, Int32, Int32, DeltaSlice)
    12. SonicBloom.Koreo.Players.VisorBase:Update()
    13.  
    14. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    15.  
    16. 2020-04-01 13:19:43.589294-0400 ARDancing[823:621008] NatCorder: MP4Recorder finishing
    17.  
    18. Unloading 4 Unused Serialized files (Serialized files now loaded: 0)
    19. Destroyed ARKitPlacement
    20. (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
    21.  
    22. UnloadTime: 5.251042 ms
    23. System memory in use before: 149.2 MB.
    24. System memory in use after: 148.2 MB.
    25.  
    26. Unloading 130 unused Assets to reduce memory usage. Loaded Objects now: 3239.
    27. Total: 9.321458 ms (FindLiveObjects: 0.410042 ms CreateObjectMapping: 0.077042 ms MarkObjects: 8.009125 ms  DeleteObjects: 0.824708 ms)
    At that point I've transitioned over to the viewing scene where you can watch any recordings you made, and as mentioned previously, the Share() function never reaches its Debug statement since the await Commit() never returns a result, so there's no log for it.

    The recording script is as follows. It's timed around the Koreographer plugin; once the recorded song ends it calls EndRecording. I've only included the relevant functions:
    Code (CSharp):
    1.    
    2. public Button recordButton;
    3. IMediaRecorder _recorder;
    4. IClock _clock;
    5. CameraInput _camera;
    6. AudioInput _audio;
    7. string _videoPath;
    8.  
    9. public void ToggleRecording()
    10. {
    11.     if (_isRecording)
    12.     {
    13.         CancelSong(); //if we're already recording, stop it and discard the video
    14.     }
    15.     else
    16.     {
    17.         recordButton.GetComponentInChildren<TextMeshProUGUI>().text = "Cancel";
    18.         GetComponent<AudioSource>().volume = 0; //the volume gets adjusted as the song plays, but starts at 0
    19.         _clock = new RealtimeClock();
    20.         _recorder = new MP4Recorder(1280, 720, 30f, AudioSettings.outputSampleRate, (int)AudioSettings.speakerMode);
    21.         _camera = new CameraInput(_recorder, _clock, Camera.main);
    22.         _audio = new AudioInput(_recorder, _clock, Camera.main.GetComponent<AudioListener>());
    23.         _musicPlayer.Play();
    24.         _isRecording = true;
    25.     }
    26. }
    27.  
    28. public void EndRecording(KoreographyEvent e)
    29. {
    30.     recordButton.interactable = false;
    31.     recordButton.GetComponentInChildren<TextMeshProUGUI>().text = "Saving...";
    32.     FinishRecording(true);
    33. }
    34.  
    35. async void FinishRecording(bool keepRecording)
    36. {
    37.     if (keepRecording)
    38.     {
    39.         saving.OpenNotification();
    40.         FadeNotificationBG(true);
    41.     }
    42.     if (_recorder != null)
    43.     {
    44.         _camera.Dispose();
    45.         _audio.Dispose();
    46.         _videoPath = await _recorder.FinishWriting();
    47.     }
    48.     if (keepRecording)
    49.     {
    50.         bool success = DataManager.Instance.SaveVideo(_videoPath);
    51.         saving.CloseNotification();
    52.         await Task.Delay(250);
    53.         if (success) saveSuccess.OpenNotification();
    54.         else saveFailed.OpenNotification();
    55.     }
    56.     else
    57.         DeleteRecording();
    58.     _recorder = null;
    59.     _isRecording = false;
    60.     recordButton.interactable = true;
    61. }
    62.  
    63. public void DeleteRecording()
    64. {
    65.     if (!string.IsNullOrEmpty(_videoPath))
    66.     {
    67.        System.IO.File.Delete(_videoPath);
    68.         _videoPath = "";
    69.     }
    70. }
    71.  
     
  38. svenneve

    svenneve

    Joined:
    May 14, 2013
    Posts:
    80
    I'm having the same issue with NatShare not compiling with IL2CPP.
    I switched to 1.2.2 (and bridge fix) for the exact same reasons as the other poster, as I have a project that requires both an Android and iOS build, and sharing on iOS prior to 1.2.2 was not working.


    Failed running C:\Program Files\2019.3.5f1\Editor\Data\il2cpp/build/deploy/net471/il2cpp.exe --convert-to-cpp --emit-null-checks --enable-array-bounds-check --dotnetprofile="unityaot" --compile-cpp --libil2cpp-static --platform="Android" --architecture="ARM64" --configuration="Release" --outputpath="E:\Projects\Moco\Temp\StagingArea\assets\bin\Data\Native\arm64-v8a\libil2cpp.so" --cachedirectory="E:\Projects\Moco\Assets\..\Library\il2cpp_android_arm64-v8a/il2cpp_cache" --additional-include-directories="C:/Program Files/2019.3.5f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\bdwgc/include" --additional-include-directories="C:/Program Files/2019.3.5f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\libil2cpp/include" --tool-chain-path="C:/Program Files/2019.3.5f1/Editor/Data/PlaybackEngines/AndroidPlayer/NDK" --enable-debugger --profiler-report --map-file-parser="C:/Program Files/2019.3.5f1/Editor/Data/Tools/MapFileParser/MapFileParser.exe" --directory=E:/Projects/Moco/Temp/StagingArea/assets/bin/Data/Managed --generatedcppdir=E:/Projects/Moco/Temp/StagingArea/Il2Cpp/il2cppOutput

    stdout:
    Building libil2cpp.so with AndroidToolChain
    Output directory: E:\Projects\Moco\Temp\StagingArea\assets\bin\Data\Native\arm64-v8a
    Cache directory: E:\Projects\Moco\Library\il2cpp_android_arm64-v8a\il2cpp_cache
    ObjectFiles: 372 of which compiled: 252
    Time Compile: 46913 milliseconds Lump_libil2cpp_vm.cpp
    Time Compile: 27737 milliseconds Lump_libil2cpp_icalls.cpp
    Time Compile: 16436 milliseconds Il2CppInvokerTable.cpp
    Time Compile: 15184 milliseconds Lump_libil2cpp_os.cpp
    Time Compile: 14662 milliseconds Il2CppAttributes.cpp
    Time Compile: 14498 milliseconds debugger-agent.c
    Time Compile: 13211 milliseconds Assembly-CSharp1.cpp
    Time Compile: 11457 milliseconds GenericMethods2.cpp
    Time Compile: 11414 milliseconds Assembly-CSharp.cpp
    Time Compile: 11053 milliseconds Lump_libil2cpp_vm-utils.cpp
    Total compilation time: 168165 milliseconds.
    il2cpp.exe didn't catch exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files\2019.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\svenn\AppData\Local\Temp\tmp3491.tmp" -o "E:\Projects\Moco\Library\il2cpp_android_arm64-v8a\il2cpp_cache\linkresult_BA0442A3502B1962DBDBA354AE41C13A\libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id -stdlib=libc++ -static-libstdc++ -target aarch64-linux-android21 -Wl,--wrap,sigaction -llog -rdynamic -fuse-ld=bfd.exe

    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_CreateSharePayload_m46E5D3674438088CB245D704E4EA3C3BFE1D6003':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29294: undefined reference to `NSCreateSharePayload'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_CreateSavePayload_m07CEB7E4F6FAE3C5BA4867D095F32EC15DEA10AE':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29313: undefined reference to `NSCreateSavePayload'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_CreatePrintPayload_m83D50BA812F5195D0B66CD8A69BBC1C741D7265F':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29332: undefined reference to `NSCreatePrintPayload'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_AddText_mC6679260A2C5234BCEE220EAF1B6C9E082201EC2':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29347: undefined reference to `NSAddText'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_AddImage_m95546C7474CFCD352F150F45015A9CE974A9846F':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29361: undefined reference to `NSAddImage'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_AddMedia_m01741B3CD729AAD984279572A09DE076BA631EB6':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29375: undefined reference to `NSAddMedia'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_Commit_m7203E7223B836F964F239199CDD1B301F32A44F7':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29389: undefined reference to `NSCommit'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_AddText_mC6679260A2C5234BCEE220EAF1B6C9E082201EC2':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29347: undefined reference to `NSAddText'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_AddImage_m95546C7474CFCD352F150F45015A9CE974A9846F':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29361: undefined reference to `NSAddImage'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_AddMedia_m01741B3CD729AAD984279572A09DE076BA631EB6':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29375: undefined reference to `NSAddMedia'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_Commit_m7203E7223B836F964F239199CDD1B301F32A44F7':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29389: undefined reference to `NSCommit'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_CreatePrintPayload_m83D50BA812F5195D0B66CD8A69BBC1C741D7265F':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29332: undefined reference to `NSCreatePrintPayload'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_CreateSharePayload_m46E5D3674438088CB245D704E4EA3C3BFE1D6003':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29294: undefined reference to `NSCreateSharePayload'
    clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)


    at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
    at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
    at il2cpp.Program.Main(String[] args)
    stderr:

    Unhandled Exception: Unity.IL2CPP.Building.BuilderFailedException: C:\Program Files\2019.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++ @"C:\Users\svenn\AppData\Local\Temp\tmp3491.tmp" -o "E:\Projects\Moco\Library\il2cpp_android_arm64-v8a\il2cpp_cache\linkresult_BA0442A3502B1962DBDBA354AE41C13A\libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id -stdlib=libc++ -static-libstdc++ -target aarch64-linux-android21 -Wl,--wrap,sigaction -llog -rdynamic -fuse-ld=bfd.exe

    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_CreateSharePayload_m46E5D3674438088CB245D704E4EA3C3BFE1D6003':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29294: undefined reference to `NSCreateSharePayload'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_CreateSavePayload_m07CEB7E4F6FAE3C5BA4867D095F32EC15DEA10AE':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29313: undefined reference to `NSCreateSavePayload'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_CreatePrintPayload_m83D50BA812F5195D0B66CD8A69BBC1C741D7265F':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29332: undefined reference to `NSCreatePrintPayload'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_AddText_mC6679260A2C5234BCEE220EAF1B6C9E082201EC2':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29347: undefined reference to `NSAddText'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_AddImage_m95546C7474CFCD352F150F45015A9CE974A9846F':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29361: undefined reference to `NSAddImage'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_AddMedia_m01741B3CD729AAD984279572A09DE076BA631EB6':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29375: undefined reference to `NSAddMedia'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_Commit_m7203E7223B836F964F239199CDD1B301F32A44F7':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29389: undefined reference to `NSCommit'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_AddText_mC6679260A2C5234BCEE220EAF1B6C9E082201EC2':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29347: undefined reference to `NSAddText'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_AddImage_m95546C7474CFCD352F150F45015A9CE974A9846F':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29361: undefined reference to `NSAddImage'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_AddMedia_m01741B3CD729AAD984279572A09DE076BA631EB6':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29375: undefined reference to `NSAddMedia'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_Commit_m7203E7223B836F964F239199CDD1B301F32A44F7':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29389: undefined reference to `NSCommit'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_CreatePrintPayload_m83D50BA812F5195D0B66CD8A69BBC1C741D7265F':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29332: undefined reference to `NSCreatePrintPayload'
    E:/Projects/Moco/Library/il2cpp_android_arm64-v8a/il2cpp_cache/D0DC76E0EB9FD611AA4F23066FCF6518.o: In function `Bridge_CreateSharePayload_m46E5D3674438088CB245D704E4EA3C3BFE1D6003':
    E:\Projects\Moco\Temp\StagingArea\Il2Cpp\il2cppOutput/Assembly-CSharp3.cpp:29294: undefined reference to `NSCreateSharePayload'
    clang++.exe: error: linker command failed with exit code 1 (use -v to see invocation)


    at Unity.IL2CPP.Building.CppProgramBuilder.PostprocessObjectFiles(HashSet`1 objectFiles, CppToolChainContext toolChainContext)
    at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
    at il2cpp.Program.DoRun(String[] args, List`1 foundAssemblies)
    at il2cpp.Program.Run(String[] args, Boolean setInvariantCulture)
    at il2cpp.Program.Main(String[] args)

    UnityEngine.Debug:LogError(Object)
    UnityEditorInternal.Runner:RunProgram(Program, String, String, String, CompilerOutputParserBase)
    UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase, Action`1)
    UnityEditorInternal.IL2CPPBuilder:RunIl2CppWithArguments(List`1, Action`1, String)
    UnityEditorInternal.IL2CPPBuilder:ConvertPlayerDlltoCpp(Il2CppBuildPipelineData, String, String, Boolean)
    UnityEditorInternal.IL2CPPBuilder:Run()
    UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry)
    UnityEditor.EditorApplication:Internal_CallGlobalEventHandler()
     
  39. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    I recommend creating an issue on GitHub. I'll work on reproducing it.
     
  40. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    There's an open PR with the fix. Update coming soon.
     
  41. svenneve

    svenneve

    Joined:
    May 14, 2013
    Posts:
    80
    I'm also having an issue with the Share function on Android.
    When I share a payload with an image and text and then return to the host app without choosing any app to share with, the awaited task doesn't finish.

    This can be seen even in the included Test scene from the project git hub.
     
    Last edited: Apr 2, 2020
  42. svenneve

    svenneve

    Joined:
    May 14, 2013
    Posts:
    80
    And on another note, can I post a request to have a JPG file format option for the encoded image payload? As PNG is pretty heavy both in size and CPU power needed for encoding, and since most shared images are just social fluff I don't see the need for a lossless format.

    I tried to implement it my self, but am new to Android Studio and got stuck in dependency hell (and here I thought that was a thing of the past by now)
     
  43. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    I mentioned this above, but it is a limitation of the Android system. Android doesn't send the app a notification if the user doesn't select any sharing action.
    This is a good request. I recommend opening an issue on GitHub.
    NatShare doesn't have any external dependencies.
     
  44. svenneve

    svenneve

    Joined:
    May 14, 2013
    Posts:
    80
    I've worked around the share issue by reenabling my UI events before the share payload is committed, it's not like people can click on anything inside the app at that point anyway.

    Thanks for looking in to the JPG request.

    As for the dependencies, Yeah, I've been mixing a couple of tutorials on how to do a native plugin for Unity and I think I messed something up big time, I'm redoing my setup from scratch.
     
  45. ShuchiSingla

    ShuchiSingla

    Joined:
    Feb 9, 2019
    Posts:
    2
    Hi there,
    Is their any way to find if user actually share the past to someone by using this?
     
  46. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    The boolean returned by the `Commit` method tells you if sharing was successful. It doesn't tell you where the user shared to.
     
  47. mtalbott

    mtalbott

    Joined:
    Dec 21, 2011
    Posts:
    125
    @Lanre,
    Hope you are safe and healthy. I recently integrated OneSignal into my project which includes Google's PlayServicesResolver plugin. Unfortunately, I can no longer build my project with NatShare to Android.

    Stats:
    Unity: 2019.2.21f1
    Android SDK: All the defaults that install with Unity. I believe it's SDK Platform 28, Build Tools 28.0.3, NDK
    r16b, OpenJDK 1.8.0_152

    Error:
    Code (CSharp):
    1. FAILURE: Build failed with an exception.
    2.  
    3. * What went wrong:
    4. Execution failed for task ':processReleaseResources'.
    5. > Android resource linking failed
    6.   /Users/mike/Downloads/NatShare-API-bridge-fix/Temp/gradleOut/build/intermediates/merged_manifests/release/AndroidManifest.xml:40: AAPT: error: attribute android:requestLegacyExternalStorage not found.
    7. ...
    8.  
    Seems to be related to AndroidX and the core-1.0.0-rc02.aar in NatShare. Unfortunately, removing core-1.0.0-rc02.aar doesn't resolve this issue.

    Any thoughts on the cause/solution?
     
  48. Lanre

    Lanre

    Joined:
    Dec 26, 2013
    Posts:
    3,971
    Make sure you are using the latest build tools (29). The error you are facing stems from this fix.
     
  49. mtalbott

    mtalbott

    Joined:
    Dec 21, 2011
    Posts:
    125
    You're the best! That worked. I spend most of the day trying to figure this out. I kept trying to downgrade the build tools to 27 then 26, forgot to go the other direction.

    Thanks for the quick reply too. Have a good one.
     
    Lanre likes this.
  50. UniBitDeveloper

    UniBitDeveloper

    Joined:
    Jul 17, 2017
    Posts:
    19
    @Lanre i have crash on ios device when a want to share to facebook. Others seems fine