首先映入眼帘的是这个错误提示
然并卵,根据提示查看控制台,一共报了4个错
一个一个来看
> Task :launcher:preBuild UP-TO-DATE
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :launcher:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE
> Task :launcher:generateReleaseBuildConfig UP-TO-DATE
> Task :launcher:compileReleaseAidl NO-SOURCE
> Task :unityLibrary:mergeReleaseNativeLibs UP-TO-DATE
> Task :launcher:javaPreCompileRelease UP-TO-DATE
> Task :launcher:writeReleaseApplicationId UP-TO-DATE
> Task :unityLibrary:stripReleaseDebugSymbols UP-TO-DATE
> Task :launcher:analyticsRecordingRelease
> Task :launcher:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:copyReleaseJniLibsProjectAndLocalJars UP-TO-DATE
> Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
> Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
> Task :launcher:extractDeepLinksRelease UP-TO-DATE
> Task :launcher:extractProguardFiles UP-TO-DATE
> Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
> Task :launcher:mergeReleaseJniLibFolders UP-TO-DATE
> Task :unityLibrary:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:packageReleaseResources UP-TO-DATE
> Task :unityLibrary:parseReleaseLocalResources UP-TO-DATE
> Task :launcher:checkReleaseDuplicateClasses UP-TO-DATE
> Task :launcher:processReleaseJavaRes NO-SOURCE
> Task :launcher:mergeReleaseShaders UP-TO-DATE
> Task :launcher:compileReleaseShaders NO-SOURCE
> Task :launcher:generateReleaseAssets UP-TO-DATE
> Task :launcher:collectReleaseDependencies UP-TO-DATE
> Task :launcher:sdkReleaseDependencyData UP-TO-DATE
> Task :launcher:validateSigningRelease UP-TO-DATE
> Task :launcher:writeReleaseAppMetadata UP-TO-DATE
> Task :unityLibrary:javaPreCompileRelease UP-TO-DATE
> Task :launcher:writeReleaseSigningConfigVersions UP-TO-DATE
> Task :unityLibrary:mergeReleaseShaders UP-TO-DATE
> Task :unityLibrary:compileReleaseShaders NO-SOURCE
> Task :unityLibrary:generateReleaseAssets UP-TO-DATE
> Task :unityLibrary:packageReleaseAssets UP-TO-DATE
> Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE
> Task :unityLibrary:prepareReleaseArtProfile UP-TO-DATE
> Task :launcher:mergeReleaseAssets UP-TO-DATE
> Task :launcher:compileReleaseRenderscript NO-SOURCE
> Task :launcher:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:processReleaseJavaRes UP-TO-DATE
> Task :launcher:mergeReleaseResources UP-TO-DATE
> Task :unityLibrary:mergeReleaseJavaResource UP-TO-DATE
> Task :launcher:mergeReleaseArtProfile UP-TO-DATE
> Task :unityLibrary:processReleaseManifest FAILED
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
> Task :unityLibrary:writeReleaseAarMetadata UP-TO-DATE
> Task :unityLibrary:extractDeepLinksRelease UP-TO-DATE
> Task :launcher:compressReleaseAssets UP-TO-DATE
> Task :unityLibrary:compileReleaseLibraryResources UP-TO-DATE
> Task :launcher:checkReleaseAarMetadata UP-TO-DATE
> Task :unityLibrary:bundleLibResRelease UP-TO-DATE
> Task :unityLibrary:writeReleaseLintModelMetadata UP-TO-DATE
> Task :unityLibrary:copyReleaseJniLibsProjectOnly UP-TO-DATE
> Task :launcher:mergeReleaseJavaResource UP-TO-DATE
44 actionable tasks: 2 executed, 42 up-to-date
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
没有任何明确的错误信息,直接忽略
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
C:\Unity\Elevator\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\AndroidManifest.xml:17:5-21:15 Error:
android:exported needs to be explicitly specified for element <service#com.dpvr.aw.vrsdk.VrListener>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':unityLibrary:processReleaseManifest'.
> A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction
> Manifest merger failed : android:exported needs to be explicitly specified for element <service#com.dpvr.aw.vrsdk.VrListener>. Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
* 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
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
这里就可以看到明确的错误信息了,里面指出AndroidManifest.xml:17:5-21:15 Error: android:exported needs to be explicitly specified for element <service#com.dpvr.aw.vrsdk.VrListener>
意思是在VrListener这个服务下需要明确指定exported属性
尝试把它添加上再次编译打包
发现可以成功打包了