Unity报错‘Exception: Field SDK_INT or type signature not found’的原因与修复
问题:Unity启动时出现"Exception: Field SDK_INT or type signature not found"错误
启动Unity项目时触发如下错误:
Exception: Field SDK_INT or type signature not found
完整报错日志:
Exception: Field SDK_INT or type signature not found UnityEngine._AndroidJNIHelper.GetFieldID (System.IntPtr jclass, System.String fieldName, System.String signature, System.Boolean isStatic) (at <25cc22fd49c34daaa956e67f0a66ab9d>:0) UnityEngine.AndroidJNIHelper.GetFieldID (System.IntPtr javaClass, System.String fieldName, System.String signature, System.Boolean isStatic) (at <25cc22fd49c34daaa956e67f0a66ab9d>:0) UnityEngine._AndroidJNIHelper.GetFieldID[ReturnType] (System.IntPtr jclass, System.String fieldName, System.Boolean isStatic) (at <25cc22fd49c34daaa956e67f0a66ab9d>:0) UnityEngine.AndroidJNIHelper.GetFieldID[FieldType] (System.IntPtr jclass, System.String fieldName, System.Boolean isStatic) (at <25cc22fd49c34daaa956e67f0a66ab9d>:0) UnityEngine.AndroidJavaObject._GetStatic[FieldType] (System.String fieldName) (at <25cc22fd49c34daaa956e67f0a66ab9d>:0) UnityEngine.AndroidJavaObject.GetStatic[FieldType] (System.String fieldName) (at <25cc22fd49c34daaa956e67f0a66ab9d>:0) UnityEngine.AdaptivePerformance.Google.Android.GoogleAndroidAdaptivePerformanceSubsystem+GoogleAndroidAdaptivePerformanceSubsystemProvider+NativeApi.GetApiLevel () (at ./Library/PackageCache/com.unity.adaptiveperformance.google.android@4fcdb811ad90/Runtime/Provider/GoogleAndroidAdaptivePerformanceSubsystem.cs:392) UnityEngine.AdaptivePerformance.Google.Android.GoogleAndroidAdaptivePerformanceSubsystem+GoogleAndroidAdaptivePerformanceSubsystemProvider+NativeApi.IsAvailable () (at ./Library/PackageCache/com.unity.adaptiveperformance.google.android@4fcdb811ad90/Runtime/Provider/GoogleAndroidAdaptivePerformanceSubsystem.cs:401) UnityEngine.AdaptivePerformance.Google.Android.GoogleAndroidAdaptivePerformanceSubsystem.RegisterDescriptor () (at ./Library/PackageCache/com.unity.adaptiveperformance.google.android@4fcdb811ad90/Runtime/Provider/GoogleAndroidAdaptivePerformanceSubsystem.cs:35)
环境信息
- Unity版本:6000.0.41f1
- Android SDK版本:34.0.0
- Android NDK版本:27.2.12479018
已确认SDK安装完整且路径正确,提供了Player Settings和External Tools截图,Plane.cs与PlaneGeneratorScript.cs脚本与问题无关。
原因分析
该错误由Unity的com.unity.adaptiveperformance.google.android包通过JNI访问Android系统Build.VERSION.SDK_INT字段失败导致,核心诱因包括:
- Adaptive Performance包版本与Unity 6.x不兼容
- Android SDK对应API等级的Platform组件未正确安装
- Player Settings中API等级配置与已安装SDK不匹配
- 包内部JNI调用的类型签名存在兼容性问题
修复方法
- 适配Adaptive Performance包版本:
打开Package Manager,找到com.unity.adaptiveperformance.google.android包,更新至官方适配Unity 6.x的版本,或回退到经测试兼容的稳定版本。 - 检查SDK Platform组件:
打开Android Studio的SDK Manager,确认已安装与项目目标API等级一致的Platform组件(如目标API为34则需安装Android 14 Platform)。 - 调整Player Settings配置:
进入Edit > Project Settings > Player > Android,将Minimum API Level、Target API Level设置为已安装的SDK版本,同时确认JDK、SDK、NDK路径指向正确目录。 - 清理项目缓存:
删除项目根目录下的Library、Temp、obj文件夹,重启Unity后等待资源重新导入。 - 临时禁用Adaptive Performance包:
若无需该功能,可在Package Manager中移除com.unity.adaptiveperformance.google.android包,验证项目是否能正常启动,确认问题来源。
内容的提问来源于stack exchange,提问作者Вадим Ткаченко
相关产品推荐
相关产品推荐

