Android本身问题集锦:
Call requires permission which may be rejected by user:
if (mContext.checkSelfPermission(Manifest.permission.CALL_PHONE) == PackageManager.PERMISSION_GRANTED)
Android Studio 与 Nox 联调:
nox_adb.exe connect 127.0.0.1:62001
Unity Android
Failed to register native method com.unity3d.player.UnityPlayer.nativeUnitySendMessage:
原因:Unity 使用的 java 依赖库版本不一致 解决:将
%UNITY_HOME%/Data/PlaybackEngines/AndroidPlayer/Variations/[Mono|il2cpp]/**/Classes/classes.jar
替换项目中的unity-classes.jar
。
Android Studio连Nox模拟器调试
-
Android Studio设置离线Gradle: 设置gradle的目录类似:
d:/gradle/gradle-*.zip
. 在Android项目的gradle.properties设置为file:///d\:/gradle/gradle-*.zip
- 先将Unity工程导出给AssetStudio
- 运行Nox安装目录下的
nox_adb.exe connect 127.0.0.1:62001
- 在Android Studio项目,按下
Shift+F10
,打开模拟器列表 - 选择对应模拟器即可。
Android 开发中国源设置:
- gradle 腾讯云镜像:
https://mirrors.cloud.tencent.com/gradle/
- maven 阿里云镜像:
maven.aliyun.com
.配置方式:allprojects { repositories { maven { url 'https://maven.aliyun.com/repository/public/' } mavenLocal() mavenCentral() } }