Quantcast
Channel: Active questions tagged crash - Stack Overflow
Viewing all 7144 articles
Browse latest View live

New iOS app rejected by Apple twice for crashing


XPC connection interrupted happening when the destination view controller call hide and show navigation bar

$
0
0

In my project, I don't using Main storboard. I'm just using the code to create root VC and add new view controller manually. In iOS 13 i have a problem when using pushViewController(searhVehicleVC, animated: false) and searhVehicleVC I'm hide navigation by navigationController?.setNavigationBarHidden(true, animated: true) in viewWillAppear. The issue will be happening and in the log show "XPC connection interrupted" after i call pushViewController and the screen is blocker and user can't not interactive to app.

I have tried pushViewController(searhVehicleVC, animated: true) it's working fine. But I think it's not root problem.

Do you have any recommendations for me?Thanks

How does the Linux kernel compile debuginfo and debuginfo-common packages in kernel-ml-4.19.1-1.el7.elrepo.x86_64

$
0
0

The production host has been restarted frequently recently, kdump has been started, vmcore has been obtained, and the root cause is ready to be analyzed by crash, but the debuginfo and debuginfo-common packages of the same kernel version should be installed.

But I did not find this version debuginfo package from http://debuginfo.centos.org/7/x86_64/

How to compile the debuginfo and debuginfo-common packages of the Linux kernel? Need to compile the kernel: kernel-ml-4.19.1-1.el7.elrepo.x86_64

The host kernel information and the installed rpm package, the debuginfo rpm package you see is abnormal

Here is what I did:

Get the kernel package from link https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.19.1.tar.xz

The package I searched for was compiled using make -j32 rpm-pkg, but after the compilation, there was no debuginfo rpm package.

I tried to remove #%debug_package{nil} in the scripts/package/mkspec see picture Remove debug_package{nil} locationand add find_debuginfo.sh xxxx to enable debug module refer build.log from link https://kojipkgs.fedoraproject.org//vol/fedora_koji_archive04/packages/kernel/4.19.2/300.fc29/data/logs/x86_64/build.logBut after I run the command make rpm-pkg again, I got the debuginfo rpm but it seems abnormal。 the size of the rpm is around 600k which is obviously not correct.abnormal size of debuginfo package

That is all, the debuginfo and debuginfo-common rpm package cannot be compiled. Do you have any suggestions to solve this problem, or provide it in kernel version kernel-ml-4.19.1-1.el7.elrepo.x86_64, or provide me kernel-ml source package link address etc. it would be greatly appreciated.

Linux write() crashes application if file descriptor is closed

$
0
0

In my C++ application one thread uses the poll() function to be notified when a file descriptor is opened, data is available to read and the fd is closed. When data is available, it is read and delivered to other threads for processing and reply. In fact, on the other side the client waits on the open socket for a synchronous reply.I make the best effort to notify the other threads when one fd is no more available, but without synchronizing (for now) the file descriptor set across all threads.The problem is that this piece of code:

while(bytes < len && d->ok) {        w = write(fd, buf + bytes, len - bytes);        d->ok = (w >= 0);        if(d->ok)            bytes += w;    }

crashes the entire application as soon as fd is closed.

Expected behaviour: write returns negative but no crash.I've read on some thread that SIGPIPE is sent, and that's why the application crashes, but I find it's not documented explicitly in

man write

Options that come to my mind:

  • synchronize the file descriptor set so that as soon as poll() notifies a fd is closed no other threads use it anymore
  • use send() instead of write.

But, I guess, if fd is closed by the other end when I'm in the write() while cycle, I would get a crash instead of a simple negative result from write()

What am I doing wrong?Thanks for any suggestion

Xamarin Android, crash when open many apps

$
0
0

Xamarin Android. When I open a lot of apps up to my application( android 4-7 android version) and then go back to application from app icon(not application manager), app crashes and can be launched only if I remove it from application manager. Application has Hockey app but it seems app crashes before hockey launched. When I work in debug mode I also cant catch this cause debug connection lost with studio cause you open a lot of apps up to your application(this is how android) works. All activities launched through StartActivity(new Intent(this, typeof(MyActivity)));and i set the in app can be opened max only 2 activities.Where you think can be my problem?Thank you

I fixed this. I created new class MyActivity and use him instead, where I have a check if app go in background or not, and if app in background - all activity cleared. After this, if i'm back, app starts from MainActivity and all work fine.

   public class MyActivity : Activity        {            private bool goBackgraund = true;            public bool loadingScreen = false;            public override void StartActivity(Intent intent)            {                goBackground = false;                base.StartActivity(intent);            }            protected override void OnDestroy()            {                if (goBackground && !loadingScreen)                {                    FinishAffinity();                }                base.OnDestroy();            }            public override void Finish()            {                goBackground = false;                base.Finish();            }        }

How to fix: "E/AndroidRuntime: FATAL EXCEPTION: main"?

$
0
0

I am developing an application, and every time I run it, my app crashes. When I look in Stack trace I receive this message.


E/AndroidRuntime: FATAL EXCEPTION: main    Process: fast.com, PID: 17032    java.lang.RuntimeException: Unable to start activity ComponentInfo{fast.com/fast.com.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.auth.FirebaseUser com.google.firebase.auth.FirebaseAuth.getCurrentUser()' on a null object reference        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2778)        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)        at android.app.ActivityThread.-wrap11(Unknown Source:0)        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)        at android.os.Handler.dispatchMessage(Handler.java:106)        at android.os.Looper.loop(Looper.java:164)        at android.app.ActivityThread.main(ActivityThread.java:6494)        at java.lang.reflect.Method.invoke(Native Method)        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.auth.FirebaseUser com.google.firebase.auth.FirebaseAuth.getCurrentUser()' on a null object reference        at fast.com.MainActivity$1.<init>(MainActivity.java:30)        at fast.com.MainActivity.onCreate(MainActivity.java:29)        at android.app.Activity.performCreate(Activity.java:7009)        at android.app.Activity.performCreate(Activity.java:7000)        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2731)        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2856)         at android.app.ActivityThread.-wrap11(Unknown Source:0)         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1589)         at android.os.Handler.dispatchMessage(Handler.java:106)         at android.os.Looper.loop(Looper.java:164)         at android.app.ActivityThread.main(ActivityThread.java:6494) emphasized text        at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

When I look to Stack Trace I understand nothing. If you have some time please answer because I really need it.

How to get a notification if Google Script's "My Executions" shows that a script hasn't run in specified time

$
0
0

I have a Google Script running every 5 minutes. It works except randomly there are sudden crashes and the script/trigger won't survive that. So, for many different reasons, the script stops running after some weeks of continuing runtime. At this point, I would need a notification.

How can I get a notification if a function (script) hasn't run in say 2 hours? Doesn't matter what the technique/notification is, but probably email would be great for the notification. I don't think the solution can be in the script code itself, because the script randomly (every few weeks) crashes at Google's side and there's nothing I can do about that.

Exception when sorting a single value Swift array

$
0
0

When loading my project I get

IB Designables: Failed to render and update auto layout status for HighscoreViewController (6Ed-3Z-stE): The agent crashed

The crash report in the log folder shows

Fatal error: Unexpectedly found nil while unwrapping an Optional value: file /Users/me/Documents/xCode/1x1/ScoreTimeGraphView.swift, line 31

Line 31 (if comments and blank lines are counted) would be

let sortedJsonResult = jsonResult!.highscoreRecord.sorted  { $0.Date < $1.Date }

jsonResult currently has only a single record, so I assume the error is caused by $1.Date.

However, I have never seen any exception handling for sorting single value arrays.

And this is also strange because I would not assume Xcode to load the JSON file when only opening the project.


I am aware of nil values. So let me phrase my questions a bit more concrete:

  1. Is the line number shown in the crash log the same number as I see in Xcode including comments and blank lines?

  2. Why would Xcode run my script and load a JSON file upon opening a project?

  3. Is there a standard code to cope with sorting a single value array? I guess I could do:

    guard sortedJsonResult = jsonResult!.highscoreRecord.sorted { $0.Date < $1.Date } else {sortedJsonResult = jsonResult!.highscoreRecord}

executable created by pyinstaller doesn't run

$
0
0

I'm creating a sudoku Solver on pygame, and now want to make an executable for the project, since you can't expect a user to know about programming, virtual environments, etc

I installed PyInstaller on my virtual environment, in pygame, and used the following command:

pyinstaller --onefile -w main.py

It worked.

However, I can't run the executable, inside the dist folder :(

When I try to click on the executable, on the paste, nothing happens. Using the terminal, I get the following error:

./mainpygame 1.9.6Hello from the pygame community. https://www.pygame.org/contribute.htmlTraceback (most recent call last):  File "main.py", line 1, in <module>    import pygame  File "<frozen importlib._bootstrap>", line 971, in _find_and_load  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked  File "/home/lucas1809/Área de Trabalho/Projetos/sudokey/venv/lib/python3.6/site-packages/PyInstaller/loader/pyimod03_importers.py", line 623, in exec_module    exec(bytecode, module.__dict__)  File "PyInstaller/__init__.py", line 68, in <module>  File "setuptools-40.8.0-py3.6.egg/pkg_resources/__init__.py", line 481, in get_distribution  File "setuptools-40.8.0-py3.6.egg/pkg_resources/__init__.py", line 357, in get_provider  File "setuptools-40.8.0-py3.6.egg/pkg_resources/__init__.py", line 900, in require  File "setuptools-40.8.0-py3.6.egg/pkg_resources/__init__.py", line 786, in resolvepkg_resources.DistributionNotFound: The 'PyInstaller' distribution was not found and is required by the application[3920] Failed to execute script main

I don't think the main.py code is necessary, since It's running fine when executed in pycharm. But, if I'm wrong, I'll post the code

I'll be grateful If someone can help me with this problem. If you have some problem understanding, or I wasn't clear. Please, ask.

Thanks in advance :)

Edit: Here is the "main.py" code:

import pygame, os, PyInstallerfrom pygame.locals import *from board import Boardfrom button import Button # Initialization and screen surface loadingpygame.init()screen = pygame.display.set_mode()screenSize = pygame.display.get_surface().get_size()width = screenSize[0]height = screenSize[1]pygame.display.set_caption("Sudokey: Sudoku's Solver")# Image and music loadingbgMenu = pygame.image.load("background/sudokey2Menu.png")bgMenu = pygame.transform.scale(bgMenu, (width, height - 30))bgStart = pygame.image.load("background/sudokeyCustom.png")bgStart = pygame.transform.scale(bgStart, (width - 40, height - 55))pygame.mixer.pre_init()pygame.mixer.init()pygame.mixer.music.load("musica/lullabyGhostInYourPiano.mp3")pygame.mixer.music.play(-1)click = pygame.mixer.Sound("sons/click.ogg")# Default screen and game staterunning = 1menu = 1start = 0credit = 0# Mouse logic to detect clickcurrentSquare = (9, 9)clickedCell = None# Creating board using class "Board"tabuleiro = Board()# Creating menu buttons using class "Button"buttonStart = Button(400, 186, 530, 90)buttonTutorial = Button(400, 325, 530, 90)buttonOptions = Button(400, 464, 530, 90)buttonCredits = Button(400, 603, 530, 90)# Creating start buttons using class "Button"buttonSolve = Button(898, 40, 380, 80)buttonReset = Button(898, 159, 380, 80)buttonGoBack = Button(898, 279, 380, 80)buttonOptionsStart = Button(898, 398, 380, 80)# Font loadingfont = pygame.font.Font("freesansbold.ttf", 30)# Visually updates the boarddef drawGrid(board):    for i in range(9):        for j in range(9):            if (board[i][j]):                text = font.render(str(board[i][j]), True, (0, 0, 0))                textRect = text.get_rect()                textRect.center = (j * 90 + 45, i * 80 + 45)                screen.blit(text, textRect)# Plays music based on inputdef jukebox(number):    if number == 0:        pygame.mixer.music.stop()    elif number == 1:        pygame.mixer.music.load("musica/lullabyGhostInYourPiano.mp3")        pygame.mixer.music.play(-1)    elif number == 2:        pygame.mixer.music.load("musica/adventureGhostInYourPiano.mp3")        pygame.mixer.music.play(-1)    elif number == 3:        pygame.mixer.music.load("musica/liebestrau.mp3")        pygame.mixer.music.play(-1)    elif number == 4:        pygame.mixer.music.load("musica/Kiss_the_Sky.mp3")        pygame.mixer.music.play(-1)    elif number == 5:        pygame.mixer.music.load("musica/Lullaby.mp3")        pygame.mixer.music.play(-1)    elif number == 6:        pygame.mixer.music.load("musica/Gentle_Breeze.mp3")        pygame.mixer.music.play(-1)    elif number == 7:        pygame.mixer.music.load("musica/Eternal_Hope.mp3")        pygame.mixer.music.play(-1)    elif number == 8:        pygame.mixer.music.load("musica/Pressure.mp3")        pygame.mixer.music.play(-1)    elif number == 9:        pygame.mixer.music.load("musica/01 To the Moon - Main Theme.mp3")        pygame.mixer.music.play(-1)while running:    while menu:        pygame.display.flip()        screen.blit(bgMenu, (0, 0))        for event in pygame.event.get():            if (event.type == pygame.QUIT) or (event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE):                running = 0                menu = 0            elif event.type == pygame.KEYDOWN and event.key == pygame.K_s:                start = 1                menu = 0            if event.type == pygame.MOUSEBUTTONUP:                x, y = pygame.mouse.get_pos()                if buttonStart.isOn(x, y):                    #click.play()                    #click.stop()                    print(x, y)                    menu = 0                    start = 1                elif buttonTutorial.isOn(x, y):                    print(x, y)                    print('tutorial')                    menu = 0                    start = 1                elif buttonOptions.isOn(x, y):                    print(x, y)                    print('Options')                    menu = 0                    start = 1                elif buttonCredits.isOn(x, y):                    print(x, y)                    print('Credits')                    menu = 0                    start = 1            if (event.type == pygame.KEYDOWN):                if (pygame.K_0 <= event.key <= pygame.K_9):                    number = int(event.unicode)                    jukebox(number)    while start:        pygame.display.flip()        screen.blit(bgStart, (0, 0))        drawGrid(tabuleiro.tabuleiro)        for event in pygame.event.get():            if event.type == pygame.QUIT:                print('stopping')                running = 0                start = 0            elif event.type == pygame.KEYDOWN and (event.key == pygame.K_m or event.key == pygame.K_ESCAPE):                start = 0                menu = 1            if (event.type == pygame.MOUSEBUTTONUP):                coords = pygame.mouse.get_pos()                col = coords[1] // 80                line = coords[0] // 90                clickedCell = (line, col)            if (event.type == pygame.KEYDOWN):                if (clickedCell != None):                    if (pygame.K_0 <= event.key <= pygame.K_9):                        line = clickedCell[1]                        col = clickedCell[0]                        number = int(event.unicode)                        if 0 <= line <= 8 and 0 <= col <= 8:                            tabuleiro.setCell(line, col, number)                            clickedCell = None            if (event.type == pygame.KEYDOWN):                if event.key == pygame.K_s:                    tabuleiro.findFirst()                    tabuleiro.solve()                elif event.key == pygame.K_r:                    tabuleiro.reset()            if event.type == pygame.MOUSEBUTTONUP:                x, y = pygame.mouse.get_pos()                print(x, y)                if buttonSolve.isOn(x, y):                    print('solving')                    tabuleiro.solve()                elif buttonReset.isOn(x, y):                    tabuleiro.reset()                    tabuleiro.show()                elif buttonGoBack.isOn(x, y):                    start = 0                    menu = 1                elif buttonOptionsStart.isOn(x, y):                    start = 0                    menu = 1pygame.quit()

Obs: Button and Board are both classes I use to solve the game

Edit 2: The previous error was fixed! :)Now, I just got another one, but this time, I can execute the file, but It closes right after

This is the mistake, now:

./mainpygame 1.9.6Hello from the pygame community. https://www.pygame.org/contribute.htmlTraceback (most recent call last):  File "main.py", line 51, in <module>    font = pygame.font.Font("freesansbold.ttf", 30)  File "pygame/pkgdata.py", line 50, in getResource  File "setuptools-40.8.0-py3.6.egg/pkg_resources/__init__.py", line 1134, in resource_exists  File "setuptools-40.8.0-py3.6.egg/pkg_resources/__init__.py", line 1404, in has_resource  File "setuptools-40.8.0-py3.6.egg/pkg_resources/__init__.py", line 1457, in _hasNotImplementedError: Can't perform this operation for unregistered loader type[3816] Failed to execute script main

Looks like It has something to do with fonts, in pygame, but I don't see why. The code runs perfectly inside pycharm.

Maybe my pyinstaller is using a wrong version of pygame, and don't recognize the method? Doesn't make sense to me, but I don't know what can be causing this

Thanks in advance (again). I couldn't find help anywhere besides here

UICollectionView/AppDelegate causing crashes while following video tutorial

$
0
0

After returning to Swift after a long time I really need a number pad for what I'm working on now. I'm currently following this video https://youtu.be/vI7m5RTYNng?t=319 (start at 5:19) however at 7:18 when he builds the app again and it works, mine still crashes with the same error. I've checked the code in AppDelegate at least 5 times and everything is exactly the same as his code down to the last character. I've attached my code below. I don't know if something has changed with Swift since the video was released since when I switched to AppDelegate for the first time var window:UIWindow? wasn't there, I had to type it in myself. I'm frustrated to say the least. Any help much appreciated.

My code for proofreading:

AppDelegate:

enter image description here

ViewController:

enter image description here

Error message:

2020-02-26 00:14:41.148993+0000 software[714:18581] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UICollectionViewController loadView] instantiated view controller with identifier "UIViewController-BYZ-38-t0r" from storyboard "Main", but didn't get a UICollectionView.'

executable file imediatly closes with "NotImplementedError"

$
0
0

I'm trying to use pyinstaller to turn a project into an executable. Pyinstaller creates the directories with sucess, but when I try to run the executable, It gives the following Error.

./mainpygame 1.9.6Hello from the pygame community. https://www.pygame.org/contribute.htmlTraceback (most recent call last):  File "main.py", line 51, in <module>    font = pygame.font.Font("freesansbold.ttf", 30)  File "pygame/pkgdata.py", line 50, in getResource  File "setuptools-40.8.0-py3.6.egg/pkg_resources/__init__.py", line 1134, in resource_exists  File "setuptools-40.8.0-py3.6.egg/pkg_resources/__init__.py", line 1404, in has_resource  File "setuptools-40.8.0-py3.6.egg/pkg_resources/__init__.py", line 1457, in _hasNotImplementedError: Can't perform this operation for unregistered loader type[8482] Failed to execute script main

This is the main code:

import pygamefrom pygame.locals import *from board import Boardfrom button import Button # Initialization and screen surface loadingpygame.init()screen = pygame.display.set_mode()screenSize = pygame.display.get_surface().get_size()width = screenSize[0]height = screenSize[1]pygame.display.set_caption("Sudokey: Sudoku's Solver")# Image and music loadingbgMenu = pygame.image.load("background/sudokey2Menu.png")bgMenu = pygame.transform.scale(bgMenu, (width, height - 30))bgStart = pygame.image.load("background/sudokeyCustom.png")bgStart = pygame.transform.scale(bgStart, (width - 40, height - 55))pygame.mixer.pre_init()pygame.mixer.init()pygame.mixer.music.load("musica/lullabyGhostInYourPiano.mp3")pygame.mixer.music.play(-1)click = pygame.mixer.Sound("sons/click.ogg")# Default screen and game staterunning = 1menu = 1start = 0credit = 0# Mouse logic to detect clickcurrentSquare = (9, 9)clickedCell = None# Creating board using class "Board"tabuleiro = Board()# Creating menu buttons using class "Button"buttonStart = Button(400, 186, 530, 90)buttonTutorial = Button(400, 325, 530, 90)buttonOptions = Button(400, 464, 530, 90)buttonCredits = Button(400, 603, 530, 90)# Creating start buttons using class "Button"buttonSolve = Button(898, 40, 380, 80)buttonReset = Button(898, 159, 380, 80)buttonGoBack = Button(898, 279, 380, 80)buttonOptionsStart = Button(898, 398, 380, 80)# Font loadingfont = pygame.font.Font("freesansbold.ttf", 30)# Visually updates the boarddef drawGrid(board):    for i in range(9):        for j in range(9):            if (board[i][j]):                text = font.render(str(board[i][j]), True, (0, 0, 0))                textRect = text.get_rect()                textRect.center = (j * 90 + 45, i * 80 + 45)                screen.blit(text, textRect)# Plays music based on inputdef jukebox(number):    if number == 0:        pygame.mixer.music.stop()    elif number == 1:        pygame.mixer.music.load("musica/lullabyGhostInYourPiano.mp3")        pygame.mixer.music.play(-1)    elif number == 2:        pygame.mixer.music.load("musica/adventureGhostInYourPiano.mp3")        pygame.mixer.music.play(-1)    elif number == 3:        pygame.mixer.music.load("musica/liebestrau.mp3")        pygame.mixer.music.play(-1)    elif number == 4:        pygame.mixer.music.load("musica/Kiss_the_Sky.mp3")        pygame.mixer.music.play(-1)    elif number == 5:        pygame.mixer.music.load("musica/Lullaby.mp3")        pygame.mixer.music.play(-1)    elif number == 6:        pygame.mixer.music.load("musica/Gentle_Breeze.mp3")        pygame.mixer.music.play(-1)    elif number == 7:        pygame.mixer.music.load("musica/Eternal_Hope.mp3")        pygame.mixer.music.play(-1)    elif number == 8:        pygame.mixer.music.load("musica/Pressure.mp3")        pygame.mixer.music.play(-1)    elif number == 9:        pygame.mixer.music.load("musica/01 To the Moon - Main Theme.mp3")        pygame.mixer.music.play(-1)while running:    while menu:        pygame.display.flip()        screen.blit(bgMenu, (0, 0))        for event in pygame.event.get():            if (event.type == pygame.QUIT) or (event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE):                running = 0                menu = 0            elif event.type == pygame.KEYDOWN and event.key == pygame.K_s:                start = 1                menu = 0            if event.type == pygame.MOUSEBUTTONUP:                x, y = pygame.mouse.get_pos()                if buttonStart.isOn(x, y):                    #click.play()                    #click.stop()                    print(x, y)                    menu = 0                    start = 1                elif buttonTutorial.isOn(x, y):                    print(x, y)                    print('tutorial')                    menu = 0                    start = 1                elif buttonOptions.isOn(x, y):                    print(x, y)                    print('Options')                    menu = 0                    start = 1                elif buttonCredits.isOn(x, y):                    print(x, y)                    print('Credits')                    menu = 0                    start = 1            if (event.type == pygame.KEYDOWN):                if (pygame.K_0 <= event.key <= pygame.K_9):                    number = int(event.unicode)                    jukebox(number)    while start:        pygame.display.flip()        screen.blit(bgStart, (0, 0))        drawGrid(tabuleiro.tabuleiro)        for event in pygame.event.get():            if event.type == pygame.QUIT:                print('stopping')                running = 0                start = 0            elif event.type == pygame.KEYDOWN and (event.key == pygame.K_m or event.key == pygame.K_ESCAPE):                start = 0                menu = 1            if (event.type == pygame.MOUSEBUTTONUP):                coords = pygame.mouse.get_pos()                col = coords[1] // 80                line = coords[0] // 90                clickedCell = (line, col)            if (event.type == pygame.KEYDOWN):                if (clickedCell != None):                    if (pygame.K_0 <= event.key <= pygame.K_9):                        line = clickedCell[1]                        col = clickedCell[0]                        number = int(event.unicode)                        if 0 <= line <= 8 and 0 <= col <= 8:                            tabuleiro.setCell(line, col, number)                            clickedCell = None            if (event.type == pygame.KEYDOWN):                if event.key == pygame.K_s:                    tabuleiro.findFirst()                    tabuleiro.solve()                elif event.key == pygame.K_r:                    tabuleiro.reset()            if event.type == pygame.MOUSEBUTTONUP:                x, y = pygame.mouse.get_pos()                print(x, y)                if buttonSolve.isOn(x, y):                    print('solving')                    tabuleiro.solve()                elif buttonReset.isOn(x, y):                    tabuleiro.reset()                    tabuleiro.show()                elif buttonGoBack.isOn(x, y):                    start = 0                    menu = 1                elif buttonOptionsStart.isOn(x, y):                    start = 0                    menu = 1pygame.quit()

Thanks in advance. I tried to search for the error on the internet, but didn't had any luck. I'll be grateful if someone can help :)

Crashes on CollectionView's delegate methoed

$
0
0

Not always, but sometimes CollectionView crashes on its delegate methods - didSelectItem and cellForItem.
Code of methods

    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {        if collectionView == clothesCollectionView {            guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: LookClothesCollectionViewCell.reuseId, for: indexPath) as? LookClothesCollectionViewCell else { return UICollectionViewCell() }            let entity = presenter.getClotheForRow(indexPath.item) ?? CatalogEntity()            cell.configure(with: entity)            cell.setSelected(presenter.isEntityDressedUp(entity: entity))            if CatalogManager.current.isFirstLaunch {                cell.setAsTry(!(presenter.isEntityDressedUp(entity: entity)))            }            return cell        } else if collectionView == categoriesCollection {            guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: SelectCategoryCell.reuseId, for: indexPath) as? SelectCategoryCell else { return UICollectionViewCell() }            let entity = presenter.getCategory(indexPath.item)            cell.configure(itemType: entity, isSelected: presenter.isSelectedCategory(indexPath.item))            return cell        } else {            return UICollectionViewCell()        }    }         func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {        collectionView.deselectItem(at: indexPath, animated: false)        if collectionView == clothesCollectionView {            guard indexPath.section == 0 else { return }            presenter.dressUpItemAt(indexPath.item)            tryOnView?.fadeOn { [weak self] (success) in                self?.tryOnView?.removeFromSuperview()                self?.tryOnView = nil            }        } else if collectionView == categoriesCollection {            presenter.selectCategory(indexPath.item)        }    }   

Crash log:
enter image description hereenter image description here

Any ideas?

website on Hostinger crashes or gets stuck

$
0
0

I'm conducting an online survey on my website hosted by Hostinger (if that helps something to solve my problem). When a certain amount of people are online it doesn't respond at all. For some visitors, there was no problem at all (which means that maybe only they were online). There's a use of the DB in the background but I don't think it's too heavy... Also, all of the visitors are asked to enter through a computer so it's not a problem related to the device...

Does anyone have an idea of how can I solve this problem? What can I do to fix it?

Thanks!

How to run application on background in latest android version 9 and version 10

$
0
0

I face a problem from a week behind. Actually i want to run my application on background but its not working in android 8,9,10.i tried some ways like1-Background service2-perform task by using Alarm managerbut still its killed by OS

UIPopOverPresentationController crashes on presentationTransitionWillBegin

$
0
0

I am receiving crashes from Apple like this:

enter image description here

The crash report is so bad, as expected for Xcode, that I have to guess where in my code this is coming from.

The crash talks about popover. The only part of my code where I have popover is this `share" stuff, when I have these "delete" and "share" trailing swipe action on a table view that shows files from the documents folder.

 override func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {    let delete = ... bla bla bla    let share = UIContextualAction(style: .normal, title: "") {[weak self] (contextualAction, view, boolValue) in      let oneFile = self?.files![indexPath.section]![indexPath.row]      let activityViewController = UIActivityViewController(        activityItems: ["Check out these files.", (oneFile?.url)! as URL],        applicationActivities: nil      )      activityViewController.popoverPresentationController?.sourceView = self?.view      self?.present(activityViewController, animated: true, completion: {[weak self] in        self?.tableView.setEditing(false, animated: true)      })    }    let swipeActions = UISwipeActionsConfiguration(actions: [delete,share])    swipeActions.performsFirstActionWithFullSwipe = true    return swipeActions}

Is there anything you guys see here that can be causing the crash?

The reports show this is crashing on the iPad but I test and it is working fine.


My code works on the emulator but when running on Samsung S6 it says the app does not work. What should I do?

$
0
0

I am just starting to learn to use an app. I am using Android Studios and when I run onto my Samsung S6, the app says it has stopped working and will not open. However, it works on the emulator. What should I do? Here is the code:

package com.example.itsmybirthday

import androidx.appcompat.app.AppCompatActivity

import android.os.Bundle

class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) } }

adapter.clear in android application

$
0
0

I'm trying to get a couple spinners to change dynamically based on their previous spinner selections. I can update the list but when i use adapter.clear() it crashes. Here is my code:

import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.AdapterView;import android.widget.AdapterView.OnItemSelectedListener;import android.widget.ArrayAdapter;import android.widget.Spinner;import android.widget.TextView;public class CarKitsAct extends Activity{    ArrayAdapter<String> adMod, adEd;    String[] models, edition;    Boolean initSpMan = true;    Boolean initSpMod = true;    @Override    protected void onCreate(Bundle savedInstanceState) {        // TODO Auto-generated method stub        super.onCreate(savedInstanceState);        setContentView(R.layout.carkitslayout);    // Construct TextViews        TextView textMan = (TextView) findViewById(R.id.textMan);        textMan.setText(R.string.selectmanufacturer);        TextView textMod = (TextView) findViewById(R.id.textMod);        textMod.setText(R.string.selectmodel);        TextView textEd = (TextView) findViewById(R.id.textEd);        textEd.setText(R.string.selectedition);    // Construct Spinners        Spinner spMan = (Spinner) findViewById(R.id.spMan);        Spinner spMod = (Spinner) findViewById(R.id.spMod);        Spinner  spEd = (Spinner) findViewById(R.id.spEd);    // Construct Manufacturer Spinner Adapter        ArrayAdapter<CharSequence> adMan;        adMan = ArrayAdapter.createFromResource(this, R.array.cars, android.R.layout.simple_spinner_item);        adMan.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        spMan.setAdapter(adMan);    // Set initial values for model and edition spinners        models = getResources().getStringArray(R.array.AC);        edition = getResources().getStringArray(R.array.ACAcceca);    //Construct adapters for models and editions        adMod = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, models);        adMod.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        adMod.setNotifyOnChange(true);        spMod.setAdapter(adMod);        adEd = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, edition);        adEd.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);        adEd.setNotifyOnChange(true);        spEd.setAdapter(adEd);    // Set up listeners for item selection        spMan.setOnItemSelectedListener(new ManItemSelectedListener());    }    public class ManItemSelectedListener implements OnItemSelectedListener {        public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {            if (initSpMan ==  true) {                initSpMan = false;            } else {                models = getResources().getStringArray(2130968577 + pos);                adMod.clear();                adMod.addAll(models);                adMod.notifyDataSetChanged();                           }    }        public void onNothingSelected(AdapterView<?> parent) {}    }}

As you can see I tried using a boolean flag to determine whether the spinners have just been created or not but then when I change a selection it dies.

SFML Crash using Clear function

$
0
0

I'm new to SFML and am currently reading through the documentation. For some reason, however, my "program" crashes whenever I call the Clear() function. My program code is as follows:

#include <SFML/Window.hpp>#include <SFML/Graphics.hpp>#include <cstdlib>#include <iostream>void HandleEvents(sf::RenderWindow &App){    sf::Event Event;    while (App.GetEvent(Event)) {        if (Event.Type == sf::Event::Closed) {            App.Close();            exit(0);        }        if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape)) {            App.Close();            exit(0);        }    }}int main(){    sf::RenderWindow App(sf::VideoMode(800, 640, 32), "SFML Graphics");    App.SetFramerateLimit(60);      // cap the framerate at 60 FPS    while (App.IsOpened()) {        HandleEvents(App);      // handle events... duh        App.Clear();      // When I remove this line, the program doesn't crash....        App.Display();    }    return EXIT_SUCCESS;}

So do any SFML gurus have advice for me? I've tried researching this problem but the only other person I've seen who tried to ask this had a broken link (because of the new SFML forums).

Thanks.

PyQt4 TextEdit.clear causes crash

$
0
0

I have a deque type list (a queue) which I'd like to show and update in QTextEdit.There is a function uuenda_kama in class MyForm which should do this (and some other s*** too). First pass of this function when textEdit is empty, it works like a charm, all necessary fields are updated. But on second pass as there has some text added to it, it crashes throwing me a Visual Studio debugger in face.Tried commenting different parts out and came out that line "self.ui.textEdit.clear()" is causing this. What is wrong with it and why is it working on first pass? What can I do to fix it? Code I have right now:

class MyForm(QtGui.QMainWindow):    ...    def uuenda_kama(self):        while True:        ...        if vana_que != list(que):            self.ui.textEdit.clear()            for i in que:                self.ui.textEdit.append(i)            vana_que = list(que)        sleep(1)if __name__ == "__main__":    app = QtGui.QApplication(sys.argv)    myapp = MyForm()    uuendamine = Thread(target=myapp.uuenda_kama)    uuendamine.start()    myapp.show()    sys.exit(app.exec_())

Flutter app crashes after some random time

$
0
0

Error message which occurs when app crashes

Flutter app crashes after (no specific duration ) , currently testing on samsung s8

Viewing all 7144 articles
Browse latest View live