Search Unity

[MongoDB] MongoDB and mobile build problems

Discussion in 'Multiplayer' started by Elizeu159, Apr 8, 2020.

  1. Elizeu159

    Elizeu159

    Joined:
    Nov 25, 2016
    Posts:
    9
    I have a database on mongoDB and managed to fetch this data to unity, everything works just fine in the editor, but not on android or ios builds, here is my code:

    Code (CSharp):
    1. private const string MONGO_URI = "mongodb+srv://user:password@testing-obdcf.mongodb.net/test?retryWrites=true&w=majority";
    2.  
    3. void Start()
    4.     {
    5.         Debug.Log("TEST REACHED START");
    6.         client = new MongoClient(MONGO_URI);;
    7.         Debug.Log("TEST MDB CLIENT" + client);
    8.     }
    XCode console:

    TEST REACHED START

    NotSupportedException: ./External/il2cpp/il2cpp/libil2cpp/icalls/mscorlib/System.Reflection/Module.cpp(112) : Unsupported internal call for IL2CPP:Module::GetPEKind - "This icall is not supported by il2cpp."

    (Filename: currently not available on il2cpp Line: -1)

    Unity Android Console:

    AndroidPlayer(ADB@127.0.0.1:34999) NotSupportedException: /Applications/Unity/Hub/Editor/2019.3.3f1/Unity.app/Contents/il2cpp/libil2cpp/icalls/mscorlib/System.Reflection/Module.cpp(112) : Unsupported internal call for IL2CPP:Module::GetPEKind - "This icall is not supported by il2cpp."

    As you can see, it doesn't reach the second debug, i would really appreciate if someone could help me with this.

    EDIT:
    Found a thread in stack overflow from 7 months ago that says the following:

    • MongoDB C# Driver is currently (as of Unity 2019.1.13f1) not compatible with IL2CPP on Hololens because it tries to make an icall not supported by the latter (very specifically when trying to call new MongoClient()).
    I really hope that using mongoDB in mobile unity apps is possible today :(

    One more thing, i got the dll s from this repo:

    https://github.com/Julian23517/Unity-mongo-csharp-driver-dlls
     
    Last edited: Apr 8, 2020
    CrossV4 likes this.
  2. CrossV4

    CrossV4

    Joined:
    Dec 21, 2020
    Posts:
    13
    Hey yaa,
    did you find anything .?

    I tried mysql its same exception,
    now i'm trying mongo but again this exception.

    What we use database for mobile games i'm really confused. I think i'll not use unity anymore
     
  3. EmilGlz

    EmilGlz

    Joined:
    Nov 23, 2019
    Posts:
    2
    Hey, have you found any way to connect unity and mongodb with il2cpp scripting backend and publish to play store?
     
  4. akshaypro02

    akshaypro02

    Joined:
    Jan 14, 2020
    Posts:
    10