Not compatible with Unity 6
Opening the examples with Unity Version 6000.0.10f1 causes an error when attempting to create any textures. User is met with pink error textures.
Failed to create texture because of invalid parameters.
From UnityTile.cs Line 294
if (_rasterData == null)
{
_rasterData = new Texture2D(0, 0, TextureFormat.RGB24, useMipMap);
_rasterData.wrapMode = TextureWrapMode.Clamp;
}
However, this issue is not present in 2022.3
I had some additional problems in my own project, but I was able to resolve this issue by instantiating the Texture2D with a width and height of 1, since apparently the API was updated to disallow widths and heights of 0.
Cannot be sure if this is a reasonable fix for release, but give it a try
_rasterData = new Texture2D(1, 1, TextureFormat.RGB24, useMipMap);
Thank you, @tomCarnevale, your solution worked for me!
worked for me! Unity 6 and MapBox its ready!
Brilliant. This fix worked for me as well. Thank you.
@AndresG123 did u manage to build that on Unity6? i get a "Building Library\Bee\artifacts\Android\d8kzr\libil2cpp.so failed with output: ld.lld: error: undefined symbol: GetBlendShapesInfo" and can't get the end of it
@VisnevschiV Yes, im using unity 6 and mapbox function perfect, although im working for IOS build not for Android at this moment
@AndresG123 would you mind to share with me the versions of ARCore/ARFoundation/ARKit/Unity/MapBox you are using? i expect the problem to be with one of them
That fix in UnityTiles.cs solved my errors, and it's now working, but my maps are still rendering pink (only the map, the buildings are ok). I'm trying to upgrade my app from 2022.3, and tried the render pipeline converter, but I guess that doesn't work on the maps as they are loaded later??
@davide1a if you use the Map prefab, go AbstractMap(Script) > General > Others > TileMaterial . tehre is a Terrain Material, select that and change it to unlit, or lit, whateer works best for ur needs, it should fix the problem
Thank you! I was searching for ages trying to find the material it used, but it wasn't showing up in the project window.
@davide1a Np, now welcome to the "how do i get a build out of that" team
@davide1a Np, now welcome to the "how do i get a build out of that" team
That's why I had to upgrade it to Unity 6! Got it all working on my phones, and went to try and load it onto Google Playstore to find out I have to use API level 34 now. So hopefully not too much more headache now...
@VisnevschiV I take that back!!! If you have any ideas on - this thread I'd appreciate it.
OK boys, i managed to make it work on unity6. Please note that i also did some random stuff before getting to my solutions, and i am not sure if any of that worked, but here is what i have on Unity6.0.33f1:
- First ensure your Android building stuff is not ReadOnly. Not sure if it's important but i lost some time on it and it might be part of the solution (u can try to skip that)
- I updated all the packages to last, but do not use just the AR Package, as magicLeap was getting in the way. (u can try to skip that too, idk if it's important)
- I entered Assets>Mapbox>Core>plugins>Android and deleted all .aar files.
Settings Notes: i have minimum API to 29 and target to 33. I use ARM64 . I also use all the reccomented JDK SDK ,NDK and Graddle. Hope it Helps anyone
Original issue with texture sizes was a good catch and thanks to @tomCarnevale for that but Api level and libraries are a different issue.
I entered Assets>Mapbox>Core>plugins>Android and deleted all .aar files.
this might be against the Mapbox Term of Service and I advice against that. I understand SDK not supporting newer versions of the Android api but that's a problem we are looking to solve and removing Mapbox libraries isn't a good option.
I suggest checking talks at the end of this ticket; https://github.com/mapbox/mapbox-unity-sdk/issues/1912
I'll close this ticket just not to mislead anyone.