Android build problem when setting "android:exported="false""

I have a problem when building for android, and tried 12 h solving it, so its also my first thred :(:

  1. I have set android:exported = “true” in the AndroidManifest.xml and it built fine

  2. I have set android:exported = “false”

  3. After building, even after resetting exported=” true” or deleting/unchecking Custom Manifest I got these errors:

-If the image doesnt open:

Configure project :launcher
WARNING: The option ‘android.enableR8’ is deprecated and should not be used anymore.
It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.
–>and a list of Tasks

-(I have tested it on a new default project and the errors came only after doing these steps)
-Where should I change what?? Should I create a new project and simply copy/paste the Asset folder?
-Already thank you for you support :frowning:

Full Error:

Configure project :launcher
WARNING: The option ‘android.enableR8’ is deprecated and should not be used anymore.
It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.

Task :launcher:preBuild UP-TO-DATE
Task :unityLibrary:GooglePlayGamesManifest.plugin:preBuild UP-TO-DATE
Task :unityLibrary:preBuild UP-TO-DATE
Task :unityLibrary:preReleaseBuild UP-TO-DATE
Task :unityLibrary:GooglePlayGamesManifest.plugin:preReleaseBuild UP-TO-DATE
Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:GooglePlayGamesManifest.plugin:compileReleaseAidl NO-SOURCE
Task :unityLibrary:GooglePlayGamesManifest.plugin:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:generateReleaseBuildConfig
Task :launcher:extractProguardFiles
Task :launcher:preReleaseBuild
Task :unityLibrary:compileReleaseAidl NO-SOURCE
Task :unityLibrary:GooglePlayGamesManifest.plugin:compileReleaseRenderscript NO-SOURCE
Task :launcher:compileReleaseRenderscript NO-SOURCE
Task :launcher:compileReleaseAidl NO-SOURCE
Task :unityLibrary:GooglePlayGamesManifest.plugin:generateReleaseResValues
Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:GooglePlayGamesManifest.plugin:generateReleaseResources
Task :unityLibrary:generateReleaseResValues
Task :unityLibrary:generateReleaseResources
Task :launcher:generateReleaseBuildConfig
Task :unityLibrary:GooglePlayGamesManifest.plugin:packageReleaseResources
Task :launcher:mainApkListPersistenceRelease
Task :launcher:generateReleaseResValues
Task :launcher:generateReleaseResources
Task :launcher:createReleaseCompatibleScreenManifests
Task :unityLibrary:GooglePlayGamesManifest.plugin:parseReleaseLocalResources
Task :launcher:extractDeepLinksRelease
Task :unityLibrary:GooglePlayGamesManifest.plugin:generateReleaseBuildConfig
Task :unityLibrary:GooglePlayGamesManifest.plugin:processReleaseManifest
Task :unityLibrary:packageReleaseResources
Task :unityLibrary:parseReleaseLocalResources
Task :unityLibrary:GooglePlayGamesManifest.plugin:javaPreCompileRelease
Task :unityLibrary:extractDeepLinksRelease
Task :unityLibrary:GooglePlayGamesManifest.plugin:generateReleaseRFile
Task :unityLibrary:processReleaseManifest
Task :unityLibrary:GooglePlayGamesManifest.plugin:compileReleaseJavaWithJavac
Task :unityLibrary:GooglePlayGamesManifest.plugin:bundleLibCompileRelease
Task :unityLibrary:GooglePlayGamesManifest.plugin:extractDeepLinksRelease
Task :unityLibrary:GooglePlayGamesManifest.plugin:compileReleaseLibraryResources
Task :unityLibrary:generateReleaseRFile
Task :unityLibrary:compileReleaseLibraryResources
Task :unityLibrary:javaPreCompileRelease
Task :unityLibrary:GooglePlayGamesManifest.plugin:mergeReleaseGeneratedProguardFiles
Task :unityLibrary:GooglePlayGamesManifest.plugin:exportReleaseConsumerProguardFiles
Task :unityLibrary:GooglePlayGamesManifest.plugin:prepareLintJarForPublish
Task :unityLibrary:GooglePlayGamesManifest.plugin:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:GooglePlayGamesManifest.plugin:bundleLibResRelease
Task :unityLibrary:GooglePlayGamesManifest.plugin:mergeReleaseShaders
Task :unityLibrary:GooglePlayGamesManifest.plugin:compileReleaseShaders
Task :unityLibrary:GooglePlayGamesManifest.plugin:generateReleaseAssets
Task :unityLibrary:GooglePlayGamesManifest.plugin:packageReleaseAssets
Task :unityLibrary:GooglePlayGamesManifest.plugin:mergeReleaseJniLibFolders
Task :unityLibrary:GooglePlayGamesManifest.plugin:bundleLibRuntimeRelease
Task :unityLibrary:GooglePlayGamesManifest.plugin:mergeReleaseNativeLibs
Task :unityLibrary:GooglePlayGamesManifest.plugin:stripReleaseDebugSymbols
Task :unityLibrary:GooglePlayGamesManifest.plugin:copyReleaseJniLibsProjectOnly
Task :unityLibrary:compileReleaseJavaWithJavac FAILED
Task :launcher:mergeReleaseResources
40 actionable tasks: 40 executed
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

A more appropriate forum would be the Android forum.

I can move your post for you if you wish.

Android build not building:

Recently (circa July 2022) there have been reports of Unity’s installer failing to install the Android Tools.

If it’s not that, then here’s how to troubleshoot:

First, make a blank project with a single blank scene and prove that it builds successfully.

If it does NOT build, then go fix your Unity installation, or your other tools, such as Android SDK, NDK, JDK, etc.

Until you can build a blank project to the target platform, don’t fiddle with anything else.

Once you can build a blank project, now bisect the problem by bringing over parts of your current project and building it one subsystem at a time, perhaps stubbing things out that might trigger compiler errors.

Most often things that prevent building are third-party libraries such as Firebase.

Once you identify the subsystem, go to the documentation for it and make sure you are doing it correctly.

It may also be helpful to work through a tutorial or two for that subsystem.

Thanks for the reply, I did it that way already, and it builds fine, only when I changed that exported to false it doesnt(even if I reset it to true), so I think I will make a new project where I put my asstets in, since its only basic stuff like scenes perfabs etc… and dont have extra libraries or stuff like that

Woyld be nice thank you :slight_smile:

Moved. Sorry for the delay.