Android build failing, tried everything

Hey, I am trying to build an Apk from my “game”. But the build is failing every single time with the error below. I have searched everywhere but i unfortunately found no solution to my problem. One thing that i tried was reinstalling unity and downgrading my gradle to 6.9.4 from 7.2, but this only gave me more errors (also below).
Does someone maybe know what i am doing wrong? Thanks!

stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
C:\Users\-\Desktop\code\Pocket-Dealership\Pocket Dealership\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:164: error: cannot find symbol
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
                                                        ^
  symbol:   variable TIRAMISU
  location: class VERSION_CODES
C:\Users\-\Desktop\code\Pocket-Dealership\Pocket Dealership\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:165: error: cannot find symbol
            permissionGranted = mContext.checkCallingOrSelfPermission(Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED;
                                                                                         ^
  symbol:   variable POST_NOTIFICATIONS
  location: class permission
Note: C:\Users\-\Desktop\code\Pocket-Dealership\Pocket Dealership\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':unityLibrary:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Android resource linking failed
     ERROR:C:\Users\-\Desktop\code\Pocket-Dealership\Pocket Dealership\Library\Bee\Android\Prj\Mono2x\Gradle\launcher\build\intermediates\packaged_manifests\release\AndroidManifest.xml:61: AAPT: error: attribute android:export not found.
        

* 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 7s
]
stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\-\Desktop\code\Pocket-Dealership\Pocket Dealership\Library\Bee\Android\Prj\Mono2x\Gradle\launcher\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':launcher'.
> Failed to apply plugin 'com.android.internal.version-check'.
   > Minimum supported Gradle version is 7.2. Current version is 6.9.4. If using the gradle wrapper, try editing the distributionUrl in C:\Users\-\Desktop\code\Pocket-Dealership\Pocket Dealership\Library\Bee\Android\Prj\Mono2x\Gradle\gradle\wrapper\gradle-wrapper.properties to gradle-7.2-all.zip

* 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

I actually says you’re using too gradle version, why did you downgrade? Which Unity version are you using?

I think you’re targeting too low Target API level, it should be at least 33 if I recall correctly.

(FIxed) Thanks for the response, i actualy downgraded gradle because that was one of the many fixes listed, but it didn’t work for me. If i upgrade gradle again the same error occurs minus the gradle version error. I have this unity version: 2022.3.5f1 (lts) as the target api version i have: “Automatic (highest installed)” But making it 33 and the target 33 fixed the issue! Thanks! Does this mean that my app can only run on android 13?

No, you’re mixing Min API level with Target API level. Target API level only means against which API level you’re compiling your files. The devices on which your app can run is controlled by Min API Level and Max API Level (Unity doesn’t expose Max API Level)

Thanks!