我测试了下,如果aar中没有AndroidManifest.xml,在代码的时候会报错:
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Java\jdk1.8.0_191\bin\java.exe -classpath "C:\Program Files\Unity Hub\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.6.4.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"
stderr[
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':unityLibrary:javaPreCompileDebug'.
> Could not resolve all files for configuration ':unityLibrary:debugCompileClasspath'.
> Failed to transform artifact 'opsdk-debug.aar (:opsdk-debug:)' to match attributes {
artifactType=android-classes, org.gradle.usage=java-api}.
> Execution failed for AarToClassTransform: E:\OGL5\op_xlua\Temp\gradleOut\unityLibrary\libs\opsdk-debug.aar.
> entry
* 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 1s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8