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

Unable to initialize tonlib object in Android project #71

Open
Good-rgb opened this issue Oct 28, 2024 · 3 comments
Open

Unable to initialize tonlib object in Android project #71

Good-rgb opened this issue Oct 28, 2024 · 3 comments

Comments

@Good-rgb
Copy link

1、I added JSON
val configStr = Utils.streamToString(openJson)
val build = Tonlib.builder().testnet(true).originalGlobalConfigStr(configStr).build()

2、error log
Error creating tonlib instance: Attempt to invoke virtual method 'org.ton.java.tonlib.types.globalconfig.LiteServers[] org.ton.java.tonlib.types.globalconfig.TonGlobalConfig.getLiteservers()' on a null object reference

@neodix42
Copy link
Owner

could you please show the value of configStr just before feeding to the Tonlib builder?

@Good-rgb
Copy link
Author

Good-rgb commented Nov 9, 2024

Yes, the value of configStr that I printed out has JSON and server node configuration, but initializing Tonlib will result in an error
1、Full Code
val open = assets.open("testnet-global-config.json")
val configStr = Utils.streamToString(open)
val build = Tonlib.builder().testnet(true).originalGlobalConfigStr(configStr).build()

2、This is the path and content of the JSON file
image

image

@neodix42
Copy link
Owner

Thanks for the details. I will try to reproduce the problem an be back to you.

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

2 participants