This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

Hello!
I have made my first little app with Godot. This program just move an object towards mouse coordinates. But when I try start it in Leapdroid emulator, it shows me that "Unfortunately myapp has stopped". What's wrong with my code? It is only a few lines and hopefully error free:

extends KinematicBody2D

var kovx: int=position.x
var kovy: int=position.y

var betukeszlet = Control.new().get_font("font")

Called every frame. 'delta' is the elapsed time since the previous frame.

func physicsprocess(delta):
if getviewport().getmouseposition().x<position.x:
kovx=position.x-4
elif get
viewport().getmouseposition().x>position.x:
kovx=position.x+4
else:
kovx=position.x

if get_viewport().get_mouse_position().y<position.y:
    kovy=position.y-4
elif get_viewport().get_mouse_position().y>position.y:
    kovy=position.y+4
else:
    kovy=position.y

position.x=kovx
position.y=kovy

#draw_string(betukeszlet, Vector2(4, 4), "JatX: ")

Maybe I configured Android settings badly? But in this case how can it build an .APK?

Godot version 3.3 Stable Official Win64
in Engine by (52 points)

Now I tried to run my app in Android Studio, but I got the following error message:
"The application could not be installed: INSTALLPARSEFAILEDINCONSISTENTCERTIFICATES"
What is means?

1 Answer

0 votes

Function getmouseposition() does not work on Android even in the emulator.
Refer to this to see how to achieve the results you are looking for: https://godotengine.org/qa/28543/godot-3-0-2-get-global-position-from-touchscreen

by (2,018 points)

Hello magicalogic and thank you for your answer! I didn't know that there are Android specific commands in Godot.
I tried my app without any code, but the situation is the same: Godot can export .APK, but it stopped in Leapdroid. :-(

Have you tried running it in a real Android device?

No, because I have only an LG K8 smartphone with quite few free space.
But maybe did I a mistake when set things in Android Studio? In Android SDK Settings I choose an obsolete NDK instead of NDK (Side by side). Can this cause the error? Should I reinstall this?

Everything is OK now! Just I must check the x86 architecture too when I exporting the APK!

These small mistakes are the worst.

Yes, and I found out by accident. But now I'm happy Godot works properly and I can deal with game making. If all is true, this will be my first Android game.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.