1. please check your APP ID correct and Version available
检查Bugly产品项目中的产品类型, 安卓和IOS
2. 最后一句一定要加上,不然就会遇到 Cleartext HTTP traffic to android.bugly.qq.com not permitted
<application android:icon="@mipmap/app_icon" android:label="@string/app_name" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:debuggable="true" android:isGame="false" android:usesCleartextTraffic="true" >
3. 记得加上名字和版本号
BuglyAgent.ConfigDefault ("XXXX", Application.version, null, 0);
4. IOS 使用XUPoter的时候,Unityframework 丢失头文件引用,引起编译错误, 最简单的方式,手动添加几个文件夹的引用, 但是如果介入了CI流程,就需要做一些修改了
PBXBuildPhase.cs 中添加 PBXHeadersBuildPhase 类型
然后在按照其他几个Phase的代码,都复制黏贴一份。
这个XUPoter 的设计思路还是挺好玩的,不认识的就不序列化了,也不管你有用没用(精彩)。
5. IOS 使用XUPorter的时候,生成的项目运行时报 Class BuglyAgent is implemented in both... 类似的错误, 大概的意思就是你引用了同一个framework两次。
在 XCProject.AddFile 做一些修改, 让主项目不要去引用Bugly.framework了
case "PBXFrameworksBuildPhase": foreach( KeyValuePair<string, PBXFrameworksBuildPhase> currentObject in frameworkBuildPhases ) { // 新增这个if判断 if(filePath.Contains("Bugly/Bugly.framework") && !jumpMainProject) { jumpMainProject = true; continue; } Debug.Log($"Adding Framework links {filePath}"); BuildAddFile(fileReference,currentObject,weak); } if ( !string.IsNullOrEmpty( absPath ) && ( tree.CompareTo( "SOURCE_ROOT" ) == 0 )) { string libraryPath = Path.Combine( "$(SRCROOT)", Path.GetDirectoryName( filePath ) ); if (File.Exists(absPath)) { this.AddLibrarySearchPaths( new PBXList( libraryPath ) ); } else { this.AddFrameworkSearchPaths( new PBXList( libraryPath ) ); } } break;