<manifest>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.VIBRATE" />
</manifest>
<application>
<meta-data android:name="android.max_aspect" android:value="2.2" /><!--O/V-->
<meta-data android:name="notch.config" android:value="portrait|landscape"/><!--小米-->
<meta-data android:name="android.notch_support" android:value="true"/><!--华为-->
</application>
在 Unity Editor 中勾选
Project Settings
> Android Settings
> Render outside reader safe
在gradle.properties 中添加:
android.injected.testOnly=false
https://developer.android.com/distribute/best-practices/develop/64-bit?hl=zh-cn
[Unity] Preferences
> External Tools
> Android SDK / NDK
https://docs.unity3d.com/2020.3/Documentation/Manual/ClassIDReference.html
https://docs.unity3d.com/2020.3/Documentation/ScriptReference/UnityEngine.AIModule.html
然后将对应的 Assembly 和 Class 添加到 Assets/link.xml
文件中
在build.gradle 中添加
dependencies {
implementation 'com.android.support:appcompat-v7:28.0.0'
}
在AndroidManifest.xml配置文件的标签中直接插入
android:usesCleartextTraffic="true"
解决方案:使用阿里云。
在 build.gradle 的 buildscript.repositories 以及 allprojects.repositories 中移除 mavenCentral(), google() 等,改为
repositories {
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
}
类似报错信息
Error while executing: am start -n "com.example.test/com.example.modules.log
Error type 3
Error:......does not exist.
解决方案:
File
-> Invalidate Caches
-> 勾选 Clear file system cache and Local History
-> 点击 Invalidate and Restart
重启完 Android Studio 即可。