一、接入SDK過程:
1、新建一個空工程,設(shè)置包名為:com.ceshi.hewen,正常打包無報錯,導(dǎo)出unitypackage。
2、將unitypackage導(dǎo)入包名為:com.DefaultCompany.Myproject的另一個工程,打包報錯。
二、報錯如下:
F:\Work\Test\Temp\gradleOut\launcher\src\main\AndroidManifest.xml:28:83-136 Error:
Attribute provider#com.bytedance.sdk.openadsdk.multipro.TTMultiProvider@authorities value=(com.ceshi.hewen.TTMultiProvider) from [:com.pangle.cn.ads-sdk-pro-4.7.1.2:] AndroidManifest.xml:28:83-136
is also present at [:unityLibrary:CSJ.plugin] AndroidManifest.xml:62:13-67 value=(com.DefaultCompany.Myproject.TTMultiProvider).
Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:28:5-164 to override.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':launcher:processReleaseManifest'.
> Manifest merger failed : Attribute provider#com.bytedance.sdk.openadsdk.multipro.TTMultiProvider@authorities value=(com.ceshi.hewen.TTMultiProvider) from [:com.pangle.cn.ads-sdk-pro-4.7.1.2:] AndroidManifest.xml:28:83-136
is also present at [:unityLibrary:CSJ.plugin] AndroidManifest.xml:62:13-67 value=(com.DefaultCompany.Myproject.TTMultiProvider).
Suggestion: add 'tools:replace="android:authorities"' to <provider> element at AndroidManifest.xml:28:5-164 to override.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 3s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
UnityEngine.GUIUtility:ProcessEvent (int,intptr)
三、報錯原因:
兩個工程 Enable Android Auto-resolution 設(shè)置不一致。SDK工程設(shè)置為Enable,項目工程設(shè)置為Disable。(未測試SDK工程設(shè)置為Disable情況)
?四、解決方案如下:
1、打開設(shè)置
2、點擊Reset to Defaults 重置參數(shù),再點擊ok關(guān)閉設(shè)置窗口
?3、點擊工程默認彈出Enable Android Auto-resolution 設(shè)置選項,點擊Enable。
?4、修改包名回彈出Resolving Android Dependencies窗口。說明修改成功。
最后 將報名修改為項目的包名即可。文章來源:http://www.zghlxwxcb.cn/news/detail-524021.html
?文章來源地址http://www.zghlxwxcb.cn/news/detail-524021.html
到了這里,關(guān)于接入穿山甲SDK時,Unity打Android包報錯日志的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!