将unity安装目录下Editor - Data - PlaybackEngines - AndroidPlayer - Variations - mono - Release - Class.jar拷贝到安卓Project目录下的自己创建的库中的libs文件夹下,并且右键add as library到模块中
安卓目录下,AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sikiedu.testlibrary"> <application android:allowBackup="true" android:supportsRtl="true"> <activity android:name=".MainActivity" android:label="UnityAndroidTest" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <meta-data android:name="unityplayer.UnityActivity" android:value="true" /> </activity> </application> </manifest>