Since I want to add Firebase to my Android Game I want to include Google Auth. But I have the following Problem. I need to add some Code to the build.gradle File but I cant find it in my Unity Project.
Here is the manual I found from Firebase : https://firebase.google.com/docs/auth/android/google-signin
I searched on all my Drives for build.gradle but found nothing.
Can you tell me where I find it or what do I have to do to implement the Code from the Link?
To use Gradle in Unity.
1.Go to <UnityInstallationDirecory>\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\GradleTemplates, then copy mainTemplate.gradle file to your <ProjectName>Assets\Plugins\Android folder.
2.You can then modify mainTemplate.gradle to be whatever you want it to be. Now, to make sure the build uses the gradle file, change the Build System to "Gradle (New)".
From Unity v2018.3 onwards, you can add your own custom Gradle build file by simply enabling the Custom Gradle Template property on the Player window
(which can be accessed by File > Build Settings > Player Settings > Publishing settings).
This generates a default mainTemplate.gradle file for you, which you can edit.
It will be in the location: Assets/Plugins/Android/mainTemplate.gradle
Source: https://docs.unity3d.com/Manual/android-gradle-overview.html
Related
I've been stuck for a while now on the issue that whenever I try to upload my project (.aab file) in the Play Store, I get the 'The Android App Bundle was not signed.' error.
These are the file properties:
I also got this error and I don't know what to do with it:
And lastly, these are my build settings:
Any help would be greatly appreciated!
EDIT: Here is the key of the project
As the error says, you need to sign your .aab/apk, to achieve that you need to generate a Keystore and upload it to your Unity project, you can find the Keystore Manger under Project Settings > Player > Publishing Settings.
More info about how to sign an apk for android: https://developer.android.com/studio/publish/app-signing
And for information about Unity Publishing Settings: https://docs.unity3d.com/Manual/class-PlayerSettingsAndroid.html#Publishing
Code: https://github.com/ToadallyAwesome2/ComettTest
So I am using Maui/Comet. I just want to run a sample project, but I get this error:
DEP0700: Registration of the app failed. [0x80073CF6]
AppxManifest.xml(33,27): error 0x80070003: Cannot install or update
package BF12F2F8-C129-4401-821A-69268F23ED72_9zz4h110yvjzm because the
splash screen image [appiconfgSplashScreen.png] cannot be located.
Verify that the package contains an image that can be used as a splash
screen for the application, and that the package manifest points to
the correct location in the package where this splash screen image can
be found.
Anyone knows what I can do? I tried making an assets folder with that png, but it didnt work.
UPDATE
Did what Gerard Versluis recommended and got the following error:
DEP0700: Registration of the app failed. [0x80080204] error 0xC00CE020:
App manifest validation error: The app manifest must be valid as per
schema: Line 26, Column 8, Reason: Het vereiste kenmerk
Square150x150Logo ontbreekt. CometApp1
translation: The required attribute Square150x150Logo is missing.
I notice that it keeps asking for the Square150x150Logo
This happens because of change in one of the previews. Long story short; we used to have an Assets folder for the Windows app, but not anymore. Since it's all in preview there wasn't a concern for backwards compatibility, but now this could occur.
It happens because you probably started a project earlier, with older templates, and are now trying to build against new preview bits. So in the templates the Assets folder is still mentioned, but is no long there.
The steps to take are also described in the preview 13 migration guide.
Go into the Platforms\Windows folder and open the Package.appxmanifest file. Right-click > Open With... and choose the XML editor
Remove all references to Assets\
Double-check your App.xaml file to see if there is a windows:Application.ImageDirectory attribute on the Application node. If so, remove it. For example:
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:windows="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;assembly=Microsoft.Maui.Controls"
windows:Application.ImageDirectory="Assets"
x:Class="WeatherTwentyOne.App">
should now be
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="WeatherTwentyOne.App">
After that, it should work again!
To make sure it doesn't happen again, make sure that you have the latest templates by running dotnet new -i Microsoft.Maui.Templates which should get you the latest templates that do not reference Assets anymore.
this was the only solution than worked for me:
https://developercommunity.visualstudio.com/t/mauiapp-cannot-run-on-windows/1670999
Pasted below:
Upgrading the maui templates using
dotnet new --install Microsoft.Maui.Templates::6.0.200-preview.13.2865
solves this issue when creating a new MAUI App.
It would be nice, if the process of upgrading VS could include updating the MAUI templates or maybe warn about the need to manually update 😃
In case of an existing MAUI App project - these changes worked for me:
remove all references to the ‘Assets\’ subfolder from the Platforms\Windows\Package.appxmanifest file
add a line about raw assets to the .csproj file in the ItemGroup that contains the MauiIcon, MauiSplashScreen, MauiImage, MauiFont tags:
<ItemGroup>
...
<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
delete your .vs/obj/bin/.csproj/.sln, and then dotnet new maui --force right inside that same folder. that fixed this issue for me, and this randomly happened to, but i think it was due to me updating some workloads. im also sure my project template was still on preview 9 lol. its always best to be on the latest template for each preview.
EDIT: if you modified your App.xaml/App.xaml.cs and/or MainPage.xaml/MainPage.xaml.cs, youre gonna need to save those so you can put them back. dotnet new maui will need to overwrite some things. unless you delete them, but theyre just things generated by the template. anything generated that you have modified, will need to be saved and updated.
I had some unusual errors on a relatively small Unity project with six c# scripts written in Visual Studio. It was all working fine, and I came back to it after the weekend. Upon opening, there were 18 new errors which were preventing the code from compiling and I spent several hours trying to figure out what was going on.
The main errors were saying things like Type or namespace name 'GUIColorOverride' could not be found and associated script cannot be loaded, assign a valid script, even though they were linked and I could see the scripts had no errors in Visual Studio. I even did a full Unity uninstall and rebooted, then a clean install. This didn't fix it.
I tried a number of other things such as backing up the scripts from the assets folder and then deleting them. Opening the project and pasting them back in as 'clean' new scripts. This didn't work. I am using Unity's Cloud Collab so was even able to use this to go back to earlier pushes of the project (which had all worked). Nope.
Solved it! The issue was that the local Projects folder I had been using was connected to Google Backup and Sync. This messed with some of the files in some of the folders in PackageCache in Particular in the MyProject > Library > PackageCache > com.unity.timeline#1.2.13 > Editor > directory.
[FIX] To fix and prevent this from happening in future, I turned off Google Backup and Sync for my Unity Project(s), and am now exclusively using Unity Collab and Git. Using the specific errors that were showing in the Unity console, I located the exact path of the Unity-created files that were causing these errors in my broken project, and replaced them with the same files from a working project. This fixed all of the errors. There must have been some corrupted or partially synced files in these folders which caused Unity to have a tantrum. Hope that helps someone!
You should exclude these from the Backup!
Basically you can exclude anything that would also be excluded from git via e.g. this "official" .gitignore file for Unity projects.
Any file and folder listed here will be regenerated by Unity automatically and should not appear in any version control / Backup.
The entire Library folder in particular is part of it since its content changes quite rapidly and is recompiled every time you change a script, install/remove a package etc.
Checkout Unity Manual - Behind the Scenes for more information in detail
When backing up a project, or adding a project to a Version Control Repository, you should include the main Unity project folder, containing both the Assets
and ProjectSettings folders. All the information in these folders is crucial to the way Unity works. You should omit the Library and Temp folders for backup purposes.
To solve an already present issue with the Library folder you can most of the times fix it by simply closing Unity, deleting the entire Library folder via your file browser and opnening Unity again → Unity will rebuild the Library
when i start the sampleNFT -an already made example from ARToolkit- in unity Editor -pressing play button- it worked greatly
BUT when i build my android app it removes my NFT marker which is in this case "gilbratar"
and i made the player setting and Android manifest as good as it supposed to be !
BTW i'm using Unity 5.3.0f4 and ARToolkit 5.3.1
why i have this problem ?!
check this image for more info
You're posting Unity editor logs, but saying you're building to Android. Do you mean you're trying to hit the "Play" button while your build target is set to Android?
If that is the case, I would recommend continuing on the editor set to your desktop platform for debugging purposes, and only switching over to your build target for building.
Also, make sure that the AndroidManifest.xml in your Assets/Plugins/Android folder has it's package name changed from "com.Artoolkit.demo" to whatever you chose as your Bundle Identifier under build settings for Android.
I have a WP8 app that I need to build in 3 configurations (release, release(prepro), release(fake)). Each configuration point to a different server and has different app icons. I need to be able to have all the 3 build in the phone at the same time so my solution is that I have created 3 different WMAppManifest.xml files (with different guids and icon paths) and I copy the right one in a pre-build step. This works fine (Based on this article http://www.tonicodes.net/blog/using-different-wmappmanifest-files-for-release-and-debug-builds/).
I upgraded the app to WP81 Silverlight. There is an additional Package.appxmanifest file. So I created 3 different Package.appxmanifest files, setting the PhoneProductId attribute to the right guid and added a pre-build step to do the copying also for this file.
When I try to run the app in release(prepro) or release(fake), meaning different WMAppManifest.xml an Package.appxmanifest are copied to the project first, I get
Installation of the application failed. XAP package signature is not valid or the WP manifest file is invalid. Re-sign with valid signature and fix the manifest file.
Is there something other than PhoneProductId that I need to changed in the new Package.appxmanifest files to make work?
I had the same issue, and maybe i can help you out. this xap signature is not valid happens a lot when some of the "pictures" in the appxmanifest file are not actually in the project. i have deleted my splashscreen picture that caused this error, deleting it from the appxmanifest file solved it. Beside that for each package you have a new package id wich if you want to publish the app you get in the dev center after you register your alias.
And there is the publisher ID wich you will also get after reverving an app name, its in this format "CN=************".
And the most important, and that i think what you search for, you can not install the same app twice on one phone. i tried it and somehow it just dont work. I have an app from store, and i can not install the same from visual studio before i dont delete the one from store. That happened never before on 8.0
I found a really easy workaround. Just add "DEBUG" to the end of the current Package name in the Package.appxmanifest designer.
Then you can have the debug version deployed: just be sure to remove the "DEBUG" from the Package name before you submit to the Store.
Also, if you still have the WMAppManifest.xml file, likewise append "DEBUG" to the Display Name so that on your phone you can easily differentiate which is which.
Cheers.
I found I needed to:
Make the Package.appxmanifest Package > Identity > Name unique (as per #kjo4jc's answer)
Change the Package.appxmanifest mp:PhoneIdentity > PhoneProductId GUID to differ from the value used in the store.
The changed GUID also needed to be changed in wmappmanifest.xml Deployment > App > ProductID to match.
I've found this happens if you try to debug an app on a phone that already has a version of the app downloaded from the store.
The easiest way to fix is to unistall the app from your phone first.