Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Wrong dll for Android #5

Closed
Merichbier opened this issue Aug 14, 2019 · 6 comments
Closed

Wrong dll for Android #5

Merichbier opened this issue Aug 14, 2019 · 6 comments
Labels
bug:aot Troubles with Ahead Of Time compilation bug Something isn't working

Comments

@Merichbier
Copy link

Source/destination types

    [Serializable]
    public class Config
    {
        public string Location;
        public PointOfInterest[] PointsOfInterest;

        public override string ToString()
        {
            return JsonConvert.SerializeObject(this);
        }
    }

Expected behavior

Installing the package through UI, building for Android and working Serialization/Deseralization

Seems the package include the wrong dll :
It include the same dll as for the standalone
image

Actual behavior

Just installed your package, building for Android and I have a PlatformNotSupportedException : Operation is not supported on this platform. at Newtonsoft.Json.Utilities.DynamicReflectionDelegateFactory.CreateDynamicMethod

Steps to reproduce

Create a new Unity Project in 2019.2.0f1, import the package through UI, using this class, we cannot deserealize the json

    [Serializable]
    public class Config
    {
        public string Location;
        public PointOfInterest[] PointsOfInterest;

        public override string ToString()
        {
            return JsonConvert.SerializeObject(this);
        }
    }
@Merichbier
Copy link
Author

My bad I cried too quickly.. Fixed when setting API compatibility to 4.x

@applejag
Copy link
Owner

Missed this due to semester. But glad you found a solution! I'll add it as requirement in the installation guide.

Should be compatible with NET Standard 2.0 comparability setting though. (Well both actually...) I'll investigate.

For future reference, what package version were you using?

@Merichbier
Copy link
Author

Hej I was using 12.0.1.
It was for a project on iOS and Android, unfortunately we had a DLL not found error when compiling on iOS. Since it was my colleague who handle the mac build (don't have a mac myself..) I can't tell more about the bug, but it would be interessting just to look if reproducible with Unity 2019.2.1f on Mac with pretty much default settings (.net was set to 2.0 but even with 4.x didn't wanted to compile)
Thanks for the interest =)

@applejag
Copy link
Owner

Right! So I think this is related to #3, with the fix being you have to update to 12.0.1-patch-001 in the manifest.json manually.

If you get any updates about the iOS build troubles then is it possible to forward them so I can implement them here as well? Neither I have access to Mac

Thank you for helping!

@applejag
Copy link
Owner

A temporary solution is to copy the folder /Library/PackageCache/jillejr.newtonsoft.json-for-unity.* folder into /Package/ (where the manifest.json lies), then remove it from the list in the manifest.json.

Doing so you can then edit the files in the package as they are no longer considered readonly

@applejag applejag reopened this Aug 20, 2019
@applejag applejag added the bug Something isn't working label Sep 24, 2019
@applejag
Copy link
Owner

applejag commented Oct 6, 2019

Did this resolve? @Merichbier ?

Will close soon for inactivity.

@applejag applejag added the bug:aot Troubles with Ahead Of Time compilation label Oct 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug:aot Troubles with Ahead Of Time compilation bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants