Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Practicing building native Android Application in Unity (need some guidance, with some librarires)

Discussion in 'Editor & General Support' started by UnityIco, Nov 22, 2022.

  1. UnityIco

    UnityIco

    Joined:
    Jan 5, 2017
    Posts:
    18
    Hello, I am trying to make an android application in Unity for practice with native Android code.
    I am using Jar libraries created in Android studio.
    This app is supposed to send an SMS message directly from my Unity application.
    The code is tested as it works in the android studio build. But when I call it from unity I got a problem, this is the error :
    2022/11/22 12:00:25.043 19878 19907 Error Unity java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/core/app/ActivityCompat;

    And this is where the error occurs: ActivityCompat.requestPermissions(unityActivity,new String[]{Manifest.permission.SEND_SMS},1);

    I tried placing jar libraries: appcompat-resources-1.4.1, support-v4-28.0.0, core-ktx-1.9.0 in my android/plugins/folder but the error is still there.

    Does anyone have experience with asking for permissions that are outside of Unity-s documentation?