beeware / briefcase-android-gradle-template

A template for generating Android Gradle projects with Briefcase
MIT License
18 stars 19 forks source link

(app-name) keeps stopping #24

Closed ilyapaliy closed 2 years ago

ilyapaliy commented 3 years ago

Describe the bug I created the apk-file, but when I run it on my device he says " (app-name) keeps stopping"

To Reproduce according to https://docs.beeware.org/en/latest/tutorial/tutorial-0.html I did the following:

C:...>md beeware-tutorial C:...>cd beeware-tutorial C:...>py -m venv beeware-venv C:...>beeware-venv\Scripts\activate.bat

(beeware-venv)C:...>python -m pip install briefcase (beeware-venv) C:...>briefcase new

IDKwhat I entereb, but here my pyproject.toml file ( [tool.briefcase] project_name = "beeware-tutor" bundle = "com.tutor" version = "0.0.1" url = "https://tutor.com/tutor" license = "Other" author = 'ilyapaliy' author_email = "ilyapaliy@mail.ru"

[tool.briefcase.app.tutor] formal_name = "beeware-tutor" description = "My first application" icon = "src/tutor/resources/tutor" sources = ['src/tutor'] requires = []

[tool.briefcase.app.tutor.macOS] requires = [ 'toga-cocoa>=0.3.0.dev20', ]

[tool.briefcase.app.tutor.linux] requires = [ 'toga-gtk>=0.3.0.dev20', ] system_requires = [ 'libgirepository1.0-dev', 'libcairo2-dev', 'libpango1.0-dev', 'libwebkitgtk-3.0-0', 'gir1.2-webkit-3.0', ]

[tool.briefcase.app.tutor.windows] requires = [ 'toga-winforms>=0.3.0.dev20', ]

Mobile deployments

[tool.briefcase.app.tutor.iOS] requires = [ 'toga-iOS>=0.3.0.dev20', ]

[tool.briefcase.app.tutor.android] requires = [ 'toga-android>=0.3.0.dev20', ] )

(beeware-venv) C:...>cd tutor (beeware-venv) C:...>briefcase dev (beeware-venv) C:...>briefcase dev

(beeware-venv) C:...>briefcase create (beeware-venv) C:...>briefcase build (beeware-venv) C:...>briefcase run (beeware-venv) C:...>briefcase package

(Everything was cool: msi file installed the app, app worked, I was happy until I tried make apk by the following link https://docs.beeware.org/en/latest/tutorial/tutorial-5/android.html)

(beeware-venv) C:...>briefcase create android (beeware-venv) C:...>briefcase build android (beeware-venv) C:...>briefcase run android

cmd started to install emulator, but I don't need this, I have my own phone, hm ok. After that I was offered 3 options:

1) BV9500Plus (BV9500Plus0019640) 2) @Pixel_2_API_24 (emulator) 3) Create a new Android emulator

2

In future, you can specify this device by running:

briefcase run android -d @Pixel_2_API_24

Starting emulator Pixel_2_API_24...

Waiting for emulator to start..... Android emulator was unable to start!

Try starting the emulator manually by running:

C:\Users\User\.briefcase\tools\android_sdk\emulator\emulator.exe @Pixel_2_API_24 -dns-server 8.8.8.8

Resolve any problems you discover, then try running your app again. You may find this page helpful in diagnosing emulator problems.

https://developer.android.com/studio/run/emulator-acceleration#accel-vm

Trying manually > C:\Users\ilyapaliy.briefcase\tools\android_sdk\emulator\emulator.exe @Pixel_2_API_24 -dns-server 8.8.8.8 PANIC: Cannot find AVD system path. Please define ANDROID_SDK_ROOT (Does not matter, emulators lag on my pc, I wanted to run it on my phone)

1

In future, you can specify this device by running:

briefcase run android -d BV9500Plus0019640

[tutor] Starting app on BV9500Plus (BV9500Plus0019640) (device ID BV9500Plus0019640)

[tutor] Stopping old versions of the app...

[tutor] Installing app...

[tutor] Launching app...

А white screen appears for a moment and then a message "beeware-tutor has stopped" or "beeware-tutor keeps stopping". Exactly same popup style: https://www.google.com/search?q=app+has+stopped&sxsrf=ALeKk02neonS5a46uaykaMm8YrJjAx-5Pg:1606675274987&source=lnms&tbm=isch&sa=X&ved=2ahUKEwiIrKPos6jtAhXvwosKHTW6AKEQ_AUoAXoECAcQAw&biw=1920&bih=947#imgrc=CEUEvwPbJOwqzM

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environment: OS Name: Microsoft Windows 10 Education OS Build: 10.0.19042 N/A Build 19042.630 OS Version: 20H2 System Type: x64-based PC Python 3.8.5 pip 20.2.4

Additional context after briefcase build android once I saw this: Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details but BUILD was SUCCESSFUL

and this 1 executed task every time: BUILD SUCCESSFUL in 7s 28 actionable tasks: 1 executed, 27 up-to-date

[tutor] Built android\beeware-tutor\app\build\outputs\apk\debug\app-debug.apk

I tried create project with pyside2, but beeware don't support modern versions of this package. It ask me install pyside2==5.13.0

freakboy3742 commented 2 years ago

Apologies for the delay in responding. The error you've reported indicates that the app was failing to start. Given the age of the ticket, this is almost certainly due to the state of the Android backend for Toga at the time. Recent versions of Briefcase also make it significantly easier to see the logs of the app as it runs, which will aid diagnosis.

Closing on the basis that there's not much more we can do at this point. If you're still having issues, it's likely an issue with Toga, so reporting the issue there (with the console log) is the way forward.