Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Itinero-Unity: MissingMethodException: ProtoBuf.Meta.RuntimeTypeModel ProtoBuf.Meta.TypeModel.Create() #365

Open
luzma9999 opened this issue Jul 13, 2023 · 1 comment

Comments

@luzma9999
Copy link

Hi,
I have just installed Itinero (v1 5.1) and Itinero.IO.Osm (v1 5. 1) on Unity.
The API Compatibility Level in this Unity version editor is NET Standard 2.0
The compilation in Unity works without errors, but when I try to execute the following code, the error message is:

MissingMethodException: ProtoBuf.Meta.RuntimeTypeModel ProtoBuf.Meta.TypeModel.Create()
OsmSharp.Streams.PBFOsmStreamSource.InitializePBFReader () (at <775beed0bba04915a5025f5b1bd63dfd>:0)

Where is the problem? Can someone help me? Should I install a higher Itinero and Itinero.IO.Osm version?

Thanks for advance.

Luzma.

The Unity C# code:

using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using Itinero;
using Itinero.IO.Osm;
using Itinero.Osm.Vehicles;

public class ReadOSMFile : MonoBehaviour
{
void Start()
{
// load some routing data and build a routing network.
var routerDb = new RouterDb();
using (var stream = new FileInfo(@"/path/to/some/osmfile.osm.pbf").OpenRead())
{
// create the network for cars only.
routerDb.LoadOsmData(stream, Vehicle.Bicycle);
//routerDb = RouterDb.Deserialize(stream);
}

}

}

@luzma9999
Copy link
Author

I have solved installing a higher version of Itinero and Itinero.IO.Osm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant