Search Unity

Question Unable to lookup library path for 'advapi32' in Android

Discussion in 'Android' started by Tnxah, Jun 2, 2021.

  1. Tnxah

    Tnxah

    Joined:
    Sep 10, 2020
    Posts:
    3
    This error appears in logcat when i trying to make a connection to MySql database with MySql.Data.MySqlClient.MySqlConnection. Everything goes well in the editor, connection is created and requests are sent correctly. But after creating a build for android, nothing works. I opened adb logcat to see what was going on and found this error.

    Code with connection provided below.
    Code (CSharp):
    1. private string ConnectionString;
    2. private string dbName = "***";
    3. private string dbUsername = "***";
    4. private string dbPassword = "***";
    5. private string dbServer = "185.253.217.35";
    6. private string dbPort = "***";
    7. public TextMeshProUGUI debug;
    8. Account account;
    9. MySqlConnection conn;
    10. MySqlDataReader reader;
    11. private void Awake()
    12. {
    13.      ConnectionString = string.Format("server={0};port={1};uid={2};pwd={3};database={4}",
    14.          dbServer,
    15.          dbPort,
    16.          dbUsername,
    17.          dbPassword,
    18.          dbName
    19.          );
    20. }
    21. void Start()
    22. {
    23.      conn = new MySqlConnection();  
    24.      print("START--------------------------------");
    25.          conn.ConnectionString = ConnectionString;
    26.          conn.Open();
    27. }
    Player settings:
    View attachment 864781

    Please help me.
    Thank you.
     
  2. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,920
    advapi32 is a Windows dll, maybe MySqlClient assembly was meant for Windows platform only? Where did you get it?