TextMesh Pro: Invalid AssetDatabase path (...) Use path relative to the project folder.

Building an Android version of our game, using TMP 1.5.1 and Unity 2018.4.23f1, causes TMPro.EditorUtilities.FontAssetPostProcessor to output various warnings during the build.

Here are the relevant lines from the editor.log file:

Refreshing native plugins compatible for Editor in 1.08 ms, found 3 plugins.
Invalid AssetDatabase path: D:/tools/Unity2018.4.23f1/Editor/Data/UnityExtensions/Unity/VR/iOS/libaudiopluginresonanceaudio.a. Use path relative to the project folder.
UnityEditor.AssetDatabase:GetMainAssetTypeAtPath(String)
TMPro.EditorUtilities.FontAssetPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Library\PackageCache\com.unity.textmeshpro@1.5.1\Scripts\Editor\TMPro_TexturePostProcessor.cs:31)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[]) (at C:\buildslave\unity\build\Editor\Mono\AssetPostprocessor.cs:141)

[C:\buildslave\unity\build\artifacts/generated/bindings_old/common/Editor/AssetDatabaseBindings.gen.cpp line 29]
(Filename: Library/PackageCache/com.unity.textmeshpro@1.5.1/Scripts/Editor/TMPro_TexturePostProcessor.cs Line: 31)

Invalid AssetDatabase path: D:/tools/Unity2018.4.23f1/Editor/Data/UnityExtensions/Unity/VR/Android/gvr.aar. Use path relative to the project folder.
UnityEditor.AssetDatabase:GetMainAssetTypeAtPath(String)
TMPro.EditorUtilities.FontAssetPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Library\PackageCache\com.unity.textmeshpro@1.5.1\Scripts\Editor\TMPro_TexturePostProcessor.cs:31)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[]) (at C:\buildslave\unity\build\Editor\Mono\AssetPostprocessor.cs:141)

[C:\buildslave\unity\build\artifacts/generated/bindings_old/common/Editor/AssetDatabaseBindings.gen.cpp line 29]
(Filename: Library/PackageCache/com.unity.textmeshpro@1.5.1/Scripts/Editor/TMPro_TexturePostProcessor.cs Line: 31)

Invalid AssetDatabase path: D:/tools/Unity2018.4.23f1/Editor/Data/UnityExtensions/Unity/VR/android_arm/libaudiopluginresonanceaudio.so. Use path relative to the project folder.
UnityEditor.AssetDatabase:GetMainAssetTypeAtPath(String)
TMPro.EditorUtilities.FontAssetPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Library\PackageCache\com.unity.textmeshpro@1.5.1\Scripts\Editor\TMPro_TexturePostProcessor.cs:31)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[]) (at C:\buildslave\unity\build\Editor\Mono\AssetPostprocessor.cs:141)

[C:\buildslave\unity\build\artifacts/generated/bindings_old/common/Editor/AssetDatabaseBindings.gen.cpp line 29]
(Filename: Library/PackageCache/com.unity.textmeshpro@1.5.1/Scripts/Editor/TMPro_TexturePostProcessor.cs Line: 31)

Invalid AssetDatabase path: D:/tools/Unity2018.4.23f1/Editor/Data/UnityExtensions/Unity/VR/Android/unitygvr.aar. Use path relative to the project folder.
UnityEditor.AssetDatabase:GetMainAssetTypeAtPath(String)
TMPro.EditorUtilities.FontAssetPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Library\PackageCache\com.unity.textmeshpro@1.5.1\Scripts\Editor\TMPro_TexturePostProcessor.cs:31)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[]) (at C:\buildslave\unity\build\Editor\Mono\AssetPostprocessor.cs:141)

[C:\buildslave\unity\build\artifacts/generated/bindings_old/common/Editor/AssetDatabaseBindings.gen.cpp line 29]
(Filename: Library/PackageCache/com.unity.textmeshpro@1.5.1/Scripts/Editor/TMPro_TexturePostProcessor.cs Line: 31)

Invalid AssetDatabase path: D:/tools/Unity2018.4.23f1/Editor/Data/UnityExtensions/Unity/VR/Linux64/libaudiopluginresonanceaudio.so. Use path relative to the project folder.
UnityEditor.AssetDatabase:GetMainAssetTypeAtPath(String)
TMPro.EditorUtilities.FontAssetPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Library\PackageCache\com.unity.textmeshpro@1.5.1\Scripts\Editor\TMPro_TexturePostProcessor.cs:31)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[]) (at C:\buildslave\unity\build\Editor\Mono\AssetPostprocessor.cs:141)

[C:\buildslave\unity\build\artifacts/generated/bindings_old/common/Editor/AssetDatabaseBindings.gen.cpp line 29]
(Filename: Library/PackageCache/com.unity.textmeshpro@1.5.1/Scripts/Editor/TMPro_TexturePostProcessor.cs Line: 31)

Invalid AssetDatabase path: D:/tools/Unity2018.4.23f1/Editor/Data/UnityExtensions/Unity/VR/OSXIntel64/audiopluginresonanceaudio.bundle. Use path relative to the project folder.
UnityEditor.AssetDatabase:GetMainAssetTypeAtPath(String)
TMPro.EditorUtilities.FontAssetPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Library\PackageCache\com.unity.textmeshpro@1.5.1\Scripts\Editor\TMPro_TexturePostProcessor.cs:31)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[]) (at C:\buildslave\unity\build\Editor\Mono\AssetPostprocessor.cs:141)

[C:\buildslave\unity\build\artifacts/generated/bindings_old/common/Editor/AssetDatabaseBindings.gen.cpp line 29]
(Filename: Library/PackageCache/com.unity.textmeshpro@1.5.1/Scripts/Editor/TMPro_TexturePostProcessor.cs Line: 31)

Invalid AssetDatabase path: D:/tools/Unity2018.4.23f1/Editor/Data/UnityExtensions/Unity/VR/android_arm64/libaudiopluginresonanceaudio.so. Use path relative to the project folder.
UnityEditor.AssetDatabase:GetMainAssetTypeAtPath(String)
TMPro.EditorUtilities.FontAssetPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Library\PackageCache\com.unity.textmeshpro@1.5.1\Scripts\Editor\TMPro_TexturePostProcessor.cs:31)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[]) (at C:\buildslave\unity\build\Editor\Mono\AssetPostprocessor.cs:141)

[C:\buildslave\unity\build\artifacts/generated/bindings_old/common/Editor/AssetDatabaseBindings.gen.cpp line 29]
(Filename: Library/PackageCache/com.unity.textmeshpro@1.5.1/Scripts/Editor/TMPro_TexturePostProcessor.cs Line: 31)

Invalid AssetDatabase path: D:/tools/Unity2018.4.23f1/Editor/Data/UnityExtensions/Unity/VR/Android/libprotobuf-java-nano.jar. Use path relative to the project folder.
UnityEditor.AssetDatabase:GetMainAssetTypeAtPath(String)
TMPro.EditorUtilities.FontAssetPostProcessor:OnPostprocessAllAssets(String[], String[], String[], String[]) (at Library\PackageCache\com.unity.textmeshpro@1.5.1\Scripts\Editor\TMPro_TexturePostProcessor.cs:31)
System.Reflection.MonoMethod:InternalInvoke(Object, Object[], Exception&)
System.Reflection.MonoMethod:Invoke(Object, BindingFlags, Binder, Object[], CultureInfo)
System.Reflection.MethodBase:Invoke(Object, Object[])
UnityEditor.AssetPostprocessingInternal:PostprocessAllAssets(String[], String[], String[], String[], String[]) (at C:\buildslave\unity\build\Editor\Mono\AssetPostprocessor.cs:141)

[C:\buildslave\unity\build\artifacts/generated/bindings_old/common/Editor/AssetDatabaseBindings.gen.cpp line 29]
(Filename: Library/PackageCache/com.unity.textmeshpro@1.5.1/Scripts/Editor/TMPro_TexturePostProcessor.cs Line: 31)

Any chance you can fix this issue? I’m aiming for zero warnings during a build.

I just ran into this a few days ago. Not sure what causes some assets to get imported from outside the project.

The following should resolve that issue

Can you please change it to IgnoreCase? We’re using lower-case everywhere, including “assets”, “projectsettings”, etc.

In my case it was GetMainAssetTypeAtPath that would generate the warning, see log above. So your change should be moved outside the if statement.

See revised post above … :wink:

I think OrdinalIgnoreCase would be a better fit for that case, see highlighted text:
6229470--685467--upload_2020-8-21_15-43-58.png

Otherwise I don’t know if you really want to “return”? I assume you would just skip the current loop-iteration via “continue” if the asset is outside of “Assets/”.

I made the change the suggested change. The return indeed should have been continue.

1 Like

Yep, this looks good to me :slight_smile: Thanks for the quick fix!