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

Android Room - simple select query - Cannot access database on the main thread

$
0
0

I am trying a sample with Room Persistence Library.I created an Entity:

@Entitypublic class Agent {    @PrimaryKey    public String guid;    public String name;    public String email;    public String password;    public String phone;    public String licence;}

Created a DAO class:

@Daopublic interface AgentDao {    @Query("SELECT COUNT(*) FROM Agent where email = :email OR phone = :phone OR licence = :licence")    int agentsCount(String email, String phone, String licence);    @Insert    void insertAgent(Agent agent);}

Created the Database class:

@Database(entities = {Agent.class}, version = 1)public abstract class AppDatabase extends RoomDatabase {    public abstract AgentDao agentDao();}

Exposed database using below subclass in Kotlin:

class MyApp : Application() {    companion object DatabaseSetup {        var database: AppDatabase? = null    }    override fun onCreate() {        super.onCreate()        MyApp.database =  Room.databaseBuilder(this, AppDatabase::class.java, "MyDatabase").build()    }}

Implemented below function in my activity:

void signUpAction(View view) {        String email = editTextEmail.getText().toString();        String phone = editTextPhone.getText().toString();        String license = editTextLicence.getText().toString();        AgentDao agentDao = MyApp.DatabaseSetup.getDatabase().agentDao();        //1: Check if agent already exists        int agentsCount = agentDao.agentsCount(email, phone, license);        if (agentsCount > 0) {            //2: If it already exists then prompt user            Toast.makeText(this, "Agent already exists!", Toast.LENGTH_LONG).show();        }        else {            Toast.makeText(this, "Agent does not exist! Hurray :)", Toast.LENGTH_LONG).show();            onBackPressed();        }    }

Unfortunately on execution of above method it crashes with below stack trace:

    FATAL EXCEPTION: main Process: com.example.me.MyApp, PID: 31592java.lang.IllegalStateException: Could not execute method for android:onClick    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:293)    at android.view.View.performClick(View.java:5612)    at android.view.View$PerformClick.run(View.java:22288)    at android.os.Handler.handleCallback(Handler.java:751)    at android.os.Handler.dispatchMessage(Handler.java:95)    at android.os.Looper.loop(Looper.java:154)    at android.app.ActivityThread.main(ActivityThread.java:6123)    at java.lang.reflect.Method.invoke(Native Method)    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757) Caused by: java.lang.reflect.InvocationTargetException    at java.lang.reflect.Method.invoke(Native Method)    at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)    at android.view.View.performClick(View.java:5612)     at android.view.View$PerformClick.run(View.java:22288)     at android.os.Handler.handleCallback(Handler.java:751)     at android.os.Handler.dispatchMessage(Handler.java:95)     at android.os.Looper.loop(Looper.java:154)     at android.app.ActivityThread.main(ActivityThread.java:6123)     at java.lang.reflect.Method.invoke(Native Method)     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)  Caused by: java.lang.IllegalStateException: Cannot access database on the main thread since it may potentially lock the UI for a long periods of time.    at android.arch.persistence.room.RoomDatabase.assertNotMainThread(RoomDatabase.java:137)    at android.arch.persistence.room.RoomDatabase.query(RoomDatabase.java:165)    at com.example.me.MyApp.RoomDb.Dao.AgentDao_Impl.agentsCount(AgentDao_Impl.java:94)    at com.example.me.MyApp.View.SignUpActivity.signUpAction(SignUpActivity.java:58)    at java.lang.reflect.Method.invoke(Native Method)     at android.support.v7.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:288)     at android.view.View.performClick(View.java:5612)     at android.view.View$PerformClick.run(View.java:22288)     at android.os.Handler.handleCallback(Handler.java:751)     at android.os.Handler.dispatchMessage(Handler.java:95)     at android.os.Looper.loop(Looper.java:154)     at android.app.ActivityThread.main(ActivityThread.java:6123)     at java.lang.reflect.Method.invoke(Native Method)     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757) 

Seems like that problem is related to execution of db operation on main thread. However the sample test code provided in above link does not run on a separate thread:

@Test    public void writeUserAndReadInList() throws Exception {        User user = TestUtil.createUser(3);        user.setName("george");        mUserDao.insert(user);        List<User> byName = mUserDao.findUsersByName("george");        assertThat(byName.get(0), equalTo(user));    }

Am I missing anything over here? How can I make it execute without crash? Please suggest.


Swift get Idfa crash

$
0
0
ASIdentifierManager.shared().advertisingIdentifier.uuidString

EXC_CRASH when get idfa.

Xcode terminal Print

LaunchServices: disconnect event (interruption) received for service com.apple.lsd.advertisingidentifiers

Android Crash from Web View

$
0
0

I have trouble building my application using WebView (crash)
Error text:

Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class android.webkit.WebView        at android.view.LayoutInflater.createView(LayoutInflater.java:633)        at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)        at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)        at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)        at android.view.LayoutInflater.inflate(LayoutInflater.java:504)        at android.view.LayoutInflater.inflate(LayoutInflater.java:414)        at android.view.LayoutInflater.inflate(LayoutInflater.java:365)        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)        at project.activity.MainActivity.onCreate(MainActivity.java:24)// from my code...

my MainActivity:

@Override  protected void onCreate(Bundle savedInstanceState) {    super.onCreate(savedInstanceState);// line 23    setContentView(R.layout.activity_main);// line 24 => error    WebView webView = findViewById(R.id.web);    // Other things    ...}

and xml File:

<androidx.swiperefreshlayout.widget.SwipeRefreshLayout  xmlns:android="http://schemas.android.com/apk/res/android"  xmlns:app="http://schemas.android.com/apk/res-auto"  xmlns:tools="http://schemas.android.com/tools"  android:layout_width="match_parent"  android:layout_height="match_parent"><WebView => line 10    android:id="@+id/web"    android:layout_width="match_parent"    android:layout_height="match_parent"></WebView></androidx.swiperefreshlayout.widget.SwipeRefreshLayout>



Why is my program crashing?
Is it due to the original code or not ??
Or do I not know how to use it properly ??
Please help me...

VMWare Workstation 15.5 on Windows 10 crashes every 2 hours

$
0
0

Every 2 hours or so, whether or not a guest VM is running, I get an error message popping up.The message box says:

VMware Workstation unrecoverable error: (host-12960)NOT_IMPLEMENTED bora\lib\pollDefault\pollDefault.c4290A log file is available in"C:\Users\Fred\AppData\Local\Temp\vmware-Fred\vmware-ui-.log"


If I have a guest running, and I ignore the error message, it will often work for quite a while.At some (as yet undetermined) time after the message, the guest WILL become unresponsive.If I then click the OK button on the error message, VWware Workstation will close.I can then start Workstation again, and the guest comes back to exactly where it was when I clicked the OK button.Nothing seems to be lost.

This is very annoying but, as I mentioned, I have not yet lost any work, and the guest is still operational.

This is not unique to any one guest. I have 4 or 5 that I use regularly, and it has happened with each of them.As I mentioned above, even if I have no guest currently running, just having Workstation open will cause this error.

Looking for help from a guru.

some errors from the log file:2020-07-01T10:17:51.611-04:00| host-2100| W003: POLL Failed to read from the signal socket 2140, return -1, error 10054/An existing connection was forcibly closed by the remote host2020-07-01T10:17:51.611-04:00| host-2100| I005: PANIC: NOT_IMPLEMENTED bora\lib\pollDefault\pollDefault.c:42902020-07-01T10:17:51.611-04:00| host-2100| I005: Backtrace:2020-07-01T10:17:51.628-04:00| host-2100| I005: backtrace[00] frame 0x0af0f5ec IP 0x7478eecb params 0xaf0f600 0x7478d3d0 0 0 [C:\Program Files (x86)\VMware\VMware Workstation\vmwarebase.DLL base 0x74730000 0x0001:0x0005decb] CoreDump_SetUnhandledExceptionFilter2020-07-01T10:17:51.629-04:00| host-2100| I005: backtrace[01] frame 0x0af0f620 IP 0x7478d499 params 0 0x74b6bb90 0xaf0f640 0xaf0f640 [C:\Program Files (x86)\VMware\VMware Workstation\vmwarebase.DLL base 0x74730000 0x0001:0x0005c499] Util_Backtrace2020-07-01T10:17:51.629-04:00| host-2100| I005: backtrace[02] frame 0x0af0fa40 IP 0x7478b9be params 0x74b41660 0xaf0fa5c 0xaf0feb8 0x747a4591 [C:\Program Files (x86)\VMware\VMware Workstation\vmwarebase.DLL base 0x74730000 0x0001:0x0005a9be] Panic_Panic2020-07-01T10:17:51.630-04:00| host-2100| I005: backtrace[03] frame 0x0af0fa50 IP 0x7474180f params 0x74b41660 0x74b7ba00 0x10c2 0x747a3e40 [C:\Program Files (x86)\VMware\VMware Workstation\vmwarebase.DLL base 0x74730000 0x0001:0x0001080f] Panic2020-07-01T10:17:51.630-04:00| host-2100| I005: backtrace[04] frame 0x0af0feb8 IP 0x747a4591 params 0x6ec7288 0x753df970 0xaf0ff24 0x76ff7084 [C:\Program Files (x86)\VMware\VMware Workstation\vmwarebase.DLL base 0x74730000 0x0001:0x00073591] Poll_LoopTimeout2020-07-01T10:17:51.632-04:00| host-2100| I005: backtrace[05] frame 0x0af0fec8 IP 0x753df989 params 0x6ec7288 0xffffffffaf25fc7e 0 0 [C:\WINDOWS\System32\KERNEL32.DLL base 0x753c0000 0x0001:0x0000f989] BaseThreadInitThunk2020-07-01T10:17:51.635-04:00| host-2100| I005: backtrace[06] frame 0x0af0ff24 IP 0x76ff7084 params 0xffffffffffffffff 0x770162a8 0 0 [C:\WINDOWS\SYSTEM32\ntdll.dll base 0x76f90000 0x0001:0x00066084] RtlGetAppContainerNamedObjectPath2020-07-01T10:17:51.636-04:00| host-2100| I005: backtrace[07] frame 0x0af0ff34 IP 0x76ff7054 params 0x747a3e40 0x6ec7288 0 0 [C:\WINDOWS\SYSTEM32\ntdll.dll base 0x76f90000 0x0001:0x00066054] RtlGetAppContainerNamedObjectPath2020-07-01T10:17:51.636-04:00| host-2100| W003: Win32 object usage: GDI 1774, USER 6472020-07-01T10:17:51.636-04:00| host-2100| I005: CoreDump_CoreDump: faking exception to get context2020-07-01T10:17:51.637-04:00| host-2100| I005: CoreDump: Minidump file C:\Users\Fred\AppData\Local\Temp\vmware-Fred\vmware.dmp exists. Rotating ...2020-07-01T10:17:51.640-04:00| host-2100| W003: CoreDump: Writing minidump to C:\Users\Fred\AppData\Local\Temp\vmware-Fred\vmware.dmp2020-07-01T10:17:51.746-04:00| host-2100| I005: CoreDump: including module base 0x0x00400000 size 0x0x002220002020-07-01T10:17:51.746-04:00| host-2100| I005: checksum 0x0022b539 timestamp 0x5ed9f0b22020-07-01T10:17:51.746-04:00| host-2100| I005: image file C:\Program Files (x86)\VMware\VMware Workstation\vmware.exe2020-07-01T10:17:51.746-04:00| host-2100| I005: file version 15.5.6.58036


Software & hardware info below:VMWare version 15.5.6 build-16341506Windows 10 Pro N, version 2004, OS build: 19041.329Windows Feature Experience Pack 120.2202.130.0

ASUS ROG laptop 48 GB RAMIntel Core i7 - 6700 HQ CPU @ 2.60 GHz

Camera intent crashes on Oppo devices

$
0
0

Camera intent along with file provider works fine on all the devices and Android versions, but for Oppo devices the app crashes as soon as the user clicks a picture.There's no error regarding this in the stacktrace.

Why did my app keep crashing on debug mode and also the released version is crashing on startup in flutter?

$
0
0

I released the app earlier and then it couldn't run now, I can't run it in debug or release versions, I just completed the setup of publishing the app on play store and then when I visited my code to make some changes it keeps on crashing.Below is my app level build.gradle file, -

def localProperties = new Properties()def localPropertiesFile = rootProject.file('local.properties')if (localPropertiesFile.exists()) {    localPropertiesFile.withReader('UTF-8') { reader ->        localProperties.load(reader)    }}def flutterRoot = localProperties.getProperty('flutter.sdk')if (flutterRoot == null) {    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")}def flutterVersionCode = localProperties.getProperty('flutter.versionCode')if (flutterVersionCode == null) {    flutterVersionCode = '1'}def flutterVersionName = localProperties.getProperty('flutter.versionName')if (flutterVersionName == null) {    flutterVersionName = '1.0'}apply plugin: 'com.android.application'apply plugin: 'kotlin-android'apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"def keystoreProperties = new Properties()   def keystorePropertiesFile = rootProject.file('key.properties')   if (keystorePropertiesFile.exists()) {       keystoreProperties.load(new FileInputStream(keystorePropertiesFile))   }android {    compileSdkVersion 28    sourceSets {        main.java.srcDirs += 'src/main/kotlin'    }    lintOptions {        disable 'InvalidPackage'    }    defaultConfig {        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).        minSdkVersion 16        targetSdkVersion 28        versionCode flutterVersionCode.toInteger()        versionName flutterVersionName    }    signingConfigs {       release {           keyAlias keystoreProperties['keyAlias']           keyPassword keystoreProperties['keyPassword']           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null           storePassword keystoreProperties['storePassword']       }    }    buildTypes {       release {           signingConfig signingConfigs.release       }    }}flutter {    source '../..'}dependencies {    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"}

I am new as developer, published first time.I did keyStore setup, signed my app and completed the whole publishing process and then it is happening,I want to get rid of this situation, please comment the appropriate answer.

How can I catch an application crash/ungraceful exit?

$
0
0

I have a VB.NET WinForms application running from an executable stored on a network share. In that application, I have defined the UnhandledException handler in the ApplicationEvents (Private Sub MyApplication_UnhandledException(sender As Object, e As UnhandledExceptionEventArgs) Handles Me.UnhandledException). In my handler, I have a method that logs the exception details to a text file before prompting the user to confirm exiting the application.

However, this application "randomly" crashes and exits completely without any log created or message box displayed. This behavior happens at different executable points in the application and I'm trying desperately to track down the cause. I'm guessing that the problem may be due to either a temporary loss of network connectivity or some other issue communicating with the PostgreSQL database, but I can't confirm the source since there's no stack trace or message detail provided before the application disappears from the user's screen.

This should be "simple", but I'm at a loss as I've tried several things, including wrapping massive blocks of code in Try...Catch blocks and adding additional logging features to my error handler. I've tried rearranging the code in my UnhandledException handler to avoid any issues with new object instantiation (for my ErrorHandler object). I added a check in the error handling for logging the error locally if the network is unavailable. I've even added a simple message box to the FormClosing event of my main form if the closing wasn't directly initiated by the user to try to at least have the application do something before shutting down completely.

No matter what I've tried so far, the application still forcibly exits during seemingly random times. The user will be pressing a button to execute any of a number of methods that usually work normally. If the user relaunches the application after being kicked out and performs the exact same action again, it works without a problem. What I need to accomplish is some form of "idiot-proofing" the error handling so that whatever is causing the application's exit is caught and logged. I'm sure there are things I'm not thinking of at this point, so let me know if any further clarification is needed.


CODE

The application's Startup event handler:

Private Sub MyApplication_Startup(sender As Object, e As StartupEventArgs) Handles Me.Startup    Try        Common.ApplicationStartup(ApplicationSettings.CurrentUser)    Catch ex As Exception        Dim StartupException As New ErrorHandler(ex)        StartupException.LogException()        MessageBox.Show("You do not have permission to access this resource." & vbCrLf & vbCrLf &"The application will now exit.")        System.Environment.Exit(1)    End Try' *********************************************************************' ** Notify the user if the application is running in test mode.     **' *********************************************************************    If ApplicationSettings.TestMode Then        MessageBox.Show("This application is currently running in Test Mode, and will use " &"local paths for data and configuration information." & vbCrLf & vbCrLf &"If you are trying to use this application with live data and see " &"this message, please contact the IT HelpDesk for assistance.", "TEST MODE",                        MessageBoxButtons.OK, MessageBoxIcon.Exclamation)        If ApplicationSettings.CurrentUser.Department = Users.Employee.Department.IS Then            If MessageBox.Show("Do you want to continue in Test Mode?", "TEST MODE", MessageBoxButtons.YesNo,                               MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) = DialogResult.No Then                ApplicationSettings.TestMode = False            End If        End If    End If' *********************************************************************' ** Initialize any application-specific settings here.              **' *********************************************************************    Try'If ApplicationSettings.TestMode AndAlso ApplicationSettings.CurrentUser.Department = Users.Employee.Department.IS Then'    MessageBox.Show("If you have any additional parameters/settings to configure for this application, " &'"please do so before commenting out this message.",'"DEVELOPMENT WARNING", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)'End If    Catch ex As Exception        Dim ExHandling As New Common.ErrorHandler(ex)        ExHandling.LogException()        MessageBox.Show("There was a problem with initializing the application's configuration." & vbCrLf & vbCrLf &"The application will now exit.")        System.Environment.Exit(2)    End TryEnd Sub

The ApplicationStartup method:

Public Sub ApplicationStartup(ByRef CurrentUser As Users.Employee)' *********************************************************************' ** Default the TestMode variable to False.  If the check for       **' ** whether or not the application is running from the IDE fails,   **' ** the application should assume that it's running live.           **' *********************************************************************    ApplicationSettings.TestMode = False' *********************************************************************' ** Perform a check of whether or not the application is running    **' ** from the IDE or the Debug folder.                               **' *********************************************************************    SetTestMode()' *********************************************************************' ** Retrieve any parameters sent to the executable from the command **' ** line and determine if the application is running from the task  **' ** scheduler.                                                      **' *********************************************************************    ApplicationSettings.ScheduledTask = False    ApplicationSettings.RuntimeParameters = System.Environment.GetCommandLineArgs().ToList    If Not ApplicationSettings.RuntimeParameters Is Nothing AndAlso ApplicationSettings.RuntimeParameters.Count > 0 Then        For Each Parameter As String In ApplicationSettings.RuntimeParameters            If Parameter.ToUpper.Contains("SCHEDTASK") Then                ApplicationSettings.ScheduledTask = True                Exit For            End If        Next    End If' *********************************************************************' ** Set up the CurrentUser object by querying Active Directory and  **' ** the PostgreSQL database for details.                            **' *********************************************************************    Try        If CurrentUser.ADUserName Is Nothing OrElse String.IsNullOrEmpty(CurrentUser.ADUserName) Then            CurrentUser = New Users.Employee(Environment.UserName)        End If    Catch UserEx As Exception        Dim ExHandler As New ErrorHandler(UserEx)        ExHandler.LogException()        Throw UserEx    End Try    If CurrentUser Is Nothing Then        Throw New Exception("Username " & Environment.UserName & " was not found in Active Directory.")    ElseIf CurrentUser.Enabled = False Then        Throw New Exception("Username " & Environment.UserName & " is not a currently active employee.")    End If' *********************************************************************' ** Default the DBCommandTimeout variable to 30.                    **' *********************************************************************    ApplicationSettings.DBCommandTimeout = 30End SubPrivate Sub SetTestMode()' *********************************************************************' ** Use the Debug.Assert to call the InTestMode function, which     **' ** will set the TestMode variable to True.  Debug.Assert will only **' ** execute if the program is running from a debugging version of   **' ** the code (in Design-Time, or from the Debug folder).  When the  **' ** code is running from a compiled executable, the Debug.Assert    **' ** statement will be ignored.                                      **' *********************************************************************    Debug.Assert(InTestMode)End SubPrivate Function InTestMode() As Boolean' *********************************************************************' ** Set the global TestMode variable to True.  This function is     **' ** only called in debug mode using the Debug.Assert method in the  **' ** SetTestMode Sub.  It will not be called if the application is   **' ** running from a compiled executable.                             **' *********************************************************************    Common.ApplicationSettings.TestMode = True    Return TrueEnd Function

The UnhandledException event handler:

Private Sub MyApplication_UnhandledException(sender As Object, e As UnhandledExceptionEventArgs) Handles Me.UnhandledException    Dim Response As DialogResult = DialogResult.Yes    Response = MessageBox.Show("An unknown error occurred in the application." & vbCrLf & vbCrLf &"Do you want to exit the application?", "UNHANDLED EXCEPTION",                               MessageBoxButtons.YesNo, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1)    Dim UnhandledError As New ErrorHandler(e.Exception)    UnhandledError.LogException()    If Response = DialogResult.Yes Then        e.ExitApplication = True    Else        e.ExitApplication = False    End IfEnd Sub

The main form's FormClosing event:

Private Sub frmMain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing    If Not e.CloseReason = CloseReason.UserClosing Then        MessageBox.Show("The application has encountered some sort of problem and is closing.")    End IfEnd Sub

Let me know if you want/need to see more code. As I said, the error occurs at seemingly random points in the application's execution and are inconsistent between one try or another.


UPDATE 7/1/2020


I haven't come back to this topic for a while because I moved a copy of the executable (and the supporting libraries) to the user's local drive and had her run the application from there. While she was using that copy, she wasn't "booted" from the program as described above (she had a few errors here and there, but those were all handled by my exception handling routine as expected).

Here we are a few months later and I've had cause to switch the user back to using the copy of the executable from the network share. I just received a report from the user that she's once again experiencing the issue with being randomly kicked out of the application without any warning or error and I'm not getting any of my exception "reports". Luckily for me, she's done a decent job of documenting the occurrences.

The strange thing is that sometimes these crashes occur when she's not doing anything "special". A couple of times they've happened when she simply clicks on one of the toolstrip menus to display a drop-down list of submenus. I've checked and there isn't any event handling code for these parent toolstrip menus, so it isn't like there are any queries or other instructions being executed. It should simply be displaying the submenu.

FWIW, a couple of weeks ago, we had a serious connectivity issue between our office and the server on which these executables are being stored (hosted VM's accessed via site-to-site VPN). I was getting around 10% packet loss across the VPN, even though I didn't see any packet loss anywhere else. I never found out what was causing the packet loss, but it appears to have been resolved and I can only assume that one of the ISP's between here and there had a faulty piece of equipment that they repaired/replaced. When I run a PING test to the server across the VPN, I'm not seeing any significant packet loss (maybe 1 packet out of several thousand) and response times of 15-35ms.

At this point, I'm only guessing (obviously), but I'm thinking that perhaps there's some sort of "time-out" occurring on the VPN connection that's causing a loss of connection to the code base. It's a total pS.W.A.G. ((pseudo) Scientific Wild-@$$ Guess), but I'm trying to come up with a viable solution to address the issue.


MY IDEAS

One thought is this: All of my in-house applications are run from this server and all of the supporting libraries for each are stored in the executable folder. Yes, this means that I've got multiple copies of many libraries stored on the server in various folders. I've been wanting to reduce this duplication, but I haven't really had/taken the time to figure out the best way to do so. At this point, I'm considering some sort of "installer" package for each of the workstations to drop the necessary libraries into each user's GAC (Global Assembly Cache) instead of accessing them through the VPN.

The only problem with this (that I can think of) is that there are several legacy systems that use different versions of the same libraries. For example, my current development is using Npgsql v4.1.3.1, but there are some applications that are still using v2.x and I don't really have time to go through every application to find which ones are/aren't using the current version and implement a version upgrade. That's just one of the many libraries where such an issue would arise, so I suppose I'd need to try to install all of the in-use versions to each GAC.

Another thought: Bring all of the executables back to a local server (not over the VPN) and change all of the shortcuts to point to that version instead of the one that requires the VPN. This, obviously, would have the benefit of less dependency on things like Internet connectivity and 3rd-party systems, as well as reduced latency.

The issue with this option, however, is that it's completely "unsupported" by my bosses. Their response when I've suggested something similar in the past is along the lines of "we're paying for a hosted server and they should support it..." Well, we all know that something like this may well be beyond the scope of any reasonable support request for a 3rd-party server host.

I'm really leaning towards the GAC option - at least as a first step - but I'll need to do a bit of research before I start traipsing down that road. Does anyone else have other suggestions for ways I might be able to deal with this? I'm really running out of ideas and I've got to find a real, workable and sustainable solution.

MORE INFO


I've implemented the suggestion below from @djv of wrapping the application's launch in a "startup" form that starts a new thread, but that still hasn't been able to catch whatever is causing the crash. The application still just periodically dies with absolutely no logging that I've been able to find so far.

I've also included, in the ApplicationEvents, a very simple handler for the NetworkAvailabilityChanged event to try to catch something happening there.

        Private Sub MyApplication_NetworkAvailabilityChanged(sender As Object, e As NetworkAvailableEventArgs) Handles Me.NetworkAvailabilityChanged            If Not My.Computer.Network.IsAvailable Then                MessageBox.Show("Network connection has been lost.", "NETWORK CONNECTION TESTING", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)            End If        End Sub

Unfortunately, even that hasn't given me any additional insights as the user hasn't ever seen that MessageBox.

I have found an error in the user's Windows Event Logs that seems to correspond to the most recent event, but I'm not sure what it means, exactly:

Faulting application name: <EXECUTABLE_NAME>.exe, version: 1.0.0.0, time stamp: 0x9d491d36Faulting module name: clr.dll, version: 4.8.4180.0, time stamp: 0x5e7d1ed7Exception code: 0xc0000006Fault offset: 0x000cc756Faulting process id: 0xe570Faulting application start time: 0x01d64fc245d7d922Faulting application path: \\<SERVER_NAME>\<SHARE_PATH>\<EXECUTABLE_NAME>.exeFaulting module path: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dllReport Id: 7016e3cc-7406-4854-95be-dbe3231447e7Faulting package full name: Faulting package-relative application ID: 

This seems to indicate something in the CLR crapping out, but that really doesn't seem to give me any more information than I had before.

App with Mapkit view crashes when run on iPhone

$
0
0

Here is my problem: I open Xcode, start a new project. Import Mapkit. Add a Mapkit view to storyboard, link into view controller.

I connect my iPhone, build the app. App runs and shows map view as expected. But: If I Kill the app on iPhone, and relaunch from iPhone(rather than rebuild in Xcode), the app crashes instantly.

The app behaves the same on two different phones- 8 and XR.

If I delete the mapkit view and rebuild, the app does not crash, it loads fine from phone screen as expected, even after being killed and relaunched locally.

Thanks for any input.(iOS 13)

import UIKitimport MapKitclass ViewController: UIViewController {    @IBOutlet weak var test: MKMapView?    override func viewDidLoad() {        super.viewDidLoad()        // Do any additional setup after loading the view.    }}

Why does my app keep crashing when I open a certain page? [closed]

$
0
0

I am creating a page in my app where users can search for other users and follow them. I did this through a fragment. When testing my app, it is crashing when I go to this page. I followed a video exactly, so I am not sure where I am going wrong. I am attaching my code below. Please let me know if more information is needed.

package com.example.simplysnap.Fragment;import android.app.DownloadManager;import android.os.Bundle;import androidx.annotation.NonNull;import androidx.fragment.app.Fragment;import androidx.recyclerview.widget.LinearLayoutManager;import androidx.recyclerview.widget.RecyclerView;import android.text.Editable;import android.text.TextWatcher;import android.view.LayoutInflater;import android.view.View;import android.view.ViewGroup;import android.widget.EditText;import com.example.simplysnap.Adapter.UserAdapter;import com.example.simplysnap.R;import com.example.simplysnap.model.User;import com.google.firebase.database.DataSnapshot;import com.google.firebase.database.DatabaseError;import com.google.firebase.database.DatabaseReference;import com.google.firebase.database.FirebaseDatabase;import com.google.firebase.database.Query;import com.google.firebase.database.ValueEventListener;import java.util.ArrayList;import java.util.List;public class SearchFragment extends Fragment {    private RecyclerView recyclerView;    private UserAdapter userAdapter;    private List<User> mUsers;    EditText search_bar;    @Override    public View onCreateView(LayoutInflater inflater, ViewGroup container,                             Bundle savedInstanceState) {        View view = inflater.inflate(R.layout.fragment_search, container, false);        recyclerView = view.findViewById(R.id.recycler_view);        recyclerView.setHasFixedSize(true);        recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));        search_bar = view.findViewById(R.id.search_bar);        mUsers = new ArrayList<>();        userAdapter = new UserAdapter(getContext(), mUsers);        recyclerView.setAdapter(userAdapter);        readUsers();        search_bar.addTextChangedListener(new TextWatcher() {            @Override            public void beforeTextChanged(CharSequence s, int start, int count, int after) {            }            @Override            public void onTextChanged(CharSequence charSequence, int start, int before, int count) {                serachUsers(charSequence.toString().toLowerCase());            }            @Override            public void afterTextChanged(Editable s) {            }        });        return view;    }    private void serachUsers(String s){        Query query = FirebaseDatabase.getInstance().getReference("Users").orderByChild("username")                .startAt(s)                .endAt(s+"\uf8ff");        query.addValueEventListener(new ValueEventListener() {            @Override            public void onDataChange(@NonNull DataSnapshot dataSnapshot) {                mUsers.clear();                for (DataSnapshot snapshot : dataSnapshot.getChildren()){                    User user = snapshot.getValue(User.class);                    mUsers.add(user);                }                userAdapter.notifyDataSetChanged();            }            @Override            public void onCancelled(@NonNull DatabaseError databaseError) {            }        });    }    private void readUsers() {        DatabaseReference reference = FirebaseDatabase.getInstance().getReference("Users");        reference.addValueEventListener(new ValueEventListener() {            @Override            public void onDataChange(@NonNull DataSnapshot dataSnapshot) {                if (search_bar.getText().toString().equals("")){                    mUsers.clear();                    for (DataSnapshot snapshot : dataSnapshot.getChildren()){                        User user = snapshot.getValue(User.class);                        mUsers.add(user);                    }                    userAdapter.notifyDataSetChanged();                }            }            @Override            public void onCancelled(@NonNull DatabaseError databaseError) {            }        });    }}

LogCat:

2020-07-02 00:44:21.983 22505-22587/com.example.simplysnap E/RunLoop: Uncaught exception in Firebase Database runloop (3.0.0). Please report to firebase-database-client@google.com    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/FirebaseApp$IdTokenListener;        at com.google.firebase.database.android.AndroidPlatform.newAuthTokenProvider(com.google.firebase:firebase-database@@16.0.4:112)        at com.google.firebase.database.core.Context.ensureAuthTokenProvider(com.google.firebase:firebase-database@@16.0.4:246)        at com.google.firebase.database.core.Context.initServices(com.google.firebase:firebase-database@@16.0.4:98)        at com.google.firebase.database.core.Context.freeze(com.google.firebase:firebase-database@@16.0.4:77)        at com.google.firebase.database.core.RepoManager.createLocalRepo(com.google.firebase:firebase-database@@16.0.4:92)        at com.google.firebase.database.core.RepoManager.createRepo(com.google.firebase:firebase-database@@16.0.4:42)        at com.google.firebase.database.FirebaseDatabase.ensureRepo(com.google.firebase:firebase-database@@16.0.4:357)        at com.google.firebase.database.FirebaseDatabase.getReference(com.google.firebase:firebase-database@@16.0.4:201)        at com.example.simplysnap.Fragment.SearchFragment.readUsers(SearchFragment.java:101)        at com.example.simplysnap.Fragment.SearchFragment.onCreateView(SearchFragment.java:54)        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600)        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881)        at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)        at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)        at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079)        at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869)        at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824)        at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)        at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)        at android.os.Handler.handleCallback(Handler.java:883)        at android.os.Handler.dispatchMessage(Handler.java:100)        at android.os.Looper.loop(Looper.java:237)        at android.app.ActivityThread.main(ActivityThread.java:7811)        at java.lang.reflect.Method.invoke(Native Method)        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.FirebaseApp$IdTokenListener" on path: DexPathList[[zip file "/data/app/com.example.simplysnap-9QQRR1LLxN4haWuy43TSkA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.simplysnap-9QQRR1LLxN4haWuy43TSkA==/lib/arm64, /system/lib64, /system/product/lib64]]        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)        at com.google.firebase.database.android.AndroidPlatform.newAuthTokenProvider(com.google.firebase:firebase-database@@16.0.4:112)         at com.google.firebase.database.core.Context.ensureAuthTokenProvider(com.google.firebase:firebase-database@@16.0.4:246)         at com.google.firebase.database.core.Context.initServices(com.google.firebase:firebase-database@@16.0.4:98)         at com.google.firebase.database.core.Context.freeze(com.google.firebase:firebase-database@@16.0.4:77)         at com.google.firebase.database.core.RepoManager.createLocalRepo(com.google.firebase:firebase-database@@16.0.4:92)         at com.google.firebase.database.core.RepoManager.createRepo(com.google.firebase:firebase-database@@16.0.4:42)         at com.google.firebase.database.FirebaseDatabase.ensureRepo(com.google.firebase:firebase-database@@16.0.4:357)         at com.google.firebase.database.FirebaseDatabase.getReference(com.google.firebase:firebase-database@@16.0.4:201)         at com.example.simplysnap.Fragment.SearchFragment.readUsers(SearchFragment.java:101)         at com.example.simplysnap.Fragment.SearchFragment.onCreateView(SearchFragment.java:54)         at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600)         at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881)         at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)         at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)         at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)         at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079)         at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869)         at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824)         at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)         at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)         at android.os.Handler.handleCallback(Handler.java:883)         at android.os.Handler.dispatchMessage(Handler.java:100)         at android.os.Looper.loop(Looper.java:237)         at android.app.ActivityThread.main(ActivityThread.java:7811)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076) 2020-07-02 00:44:22.009 22505-22505/com.example.simplysnap E/AndroidRuntime: FATAL EXCEPTION: main    Process: com.example.simplysnap, PID: 22505    java.lang.RuntimeException: Uncaught exception in Firebase Database runloop (3.0.0). Please report to firebase-database-client@google.com        at com.google.firebase.database.android.AndroidPlatform$1$1.run(com.google.firebase:firebase-database@@16.0.4:98)        at android.os.Handler.handleCallback(Handler.java:883)        at android.os.Handler.dispatchMessage(Handler.java:100)        at android.os.Looper.loop(Looper.java:237)        at android.app.ActivityThread.main(ActivityThread.java:7811)        at java.lang.reflect.Method.invoke(Native Method)        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/FirebaseApp$IdTokenListener;        at com.google.firebase.database.android.AndroidPlatform.newAuthTokenProvider(com.google.firebase:firebase-database@@16.0.4:112)        at com.google.firebase.database.core.Context.ensureAuthTokenProvider(com.google.firebase:firebase-database@@16.0.4:246)        at com.google.firebase.database.core.Context.initServices(com.google.firebase:firebase-database@@16.0.4:98)        at com.google.firebase.database.core.Context.freeze(com.google.firebase:firebase-database@@16.0.4:77)        at com.google.firebase.database.core.RepoManager.createLocalRepo(com.google.firebase:firebase-database@@16.0.4:92)        at com.google.firebase.database.core.RepoManager.createRepo(com.google.firebase:firebase-database@@16.0.4:42)        at com.google.firebase.database.FirebaseDatabase.ensureRepo(com.google.firebase:firebase-database@@16.0.4:357)        at com.google.firebase.database.FirebaseDatabase.getReference(com.google.firebase:firebase-database@@16.0.4:201)        at com.example.simplysnap.Fragment.SearchFragment.readUsers(SearchFragment.java:101)        at com.example.simplysnap.Fragment.SearchFragment.onCreateView(SearchFragment.java:54)        at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600)        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881)        at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)        at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)        at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)        at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079)        at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869)        at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824)        at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)        at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)        at android.os.Handler.handleCallback(Handler.java:883)         at android.os.Handler.dispatchMessage(Handler.java:100)         at android.os.Looper.loop(Looper.java:237)         at android.app.ActivityThread.main(ActivityThread.java:7811)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)      Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.FirebaseApp$IdTokenListener" on path: DexPathList[[zip file "/data/app/com.example.simplysnap-9QQRR1LLxN4haWuy43TSkA==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.simplysnap-9QQRR1LLxN4haWuy43TSkA==/lib/arm64, /system/lib64, /system/product/lib64]]        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)        at com.google.firebase.database.android.AndroidPlatform.newAuthTokenProvider(com.google.firebase:firebase-database@@16.0.4:112)         at com.google.firebase.database.core.Context.ensureAuthTokenProvider(com.google.firebase:firebase-database@@16.0.4:246)         at com.google.firebase.database.core.Context.initServices(com.google.firebase:firebase-database@@16.0.4:98)         at com.google.firebase.database.core.Context.freeze(com.google.firebase:firebase-database@@16.0.4:77)         at com.google.firebase.database.core.RepoManager.createLocalRepo(com.google.firebase:firebase-database@@16.0.4:92)         at com.google.firebase.database.core.RepoManager.createRepo(com.google.firebase:firebase-database@@16.0.4:42)         at com.google.firebase.database.FirebaseDatabase.ensureRepo(com.google.firebase:firebase-database@@16.0.4:357)         at com.google.firebase.database.FirebaseDatabase.getReference(com.google.firebase:firebase-database@@16.0.4:201)         at com.example.simplysnap.Fragment.SearchFragment.readUsers(SearchFragment.java:101)         at com.example.simplysnap.Fragment.SearchFragment.onCreateView(SearchFragment.java:54)         at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2600)         at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:881)         at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)         at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)         at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)         at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079)         at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869)         at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824)         at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)         at androidx.fragment.app.FragmentManagerImpl$2.run(FragmentManagerImpl.java:150)         at android.os.Handler.handleCallback(Handler.java:883)         at android.os.Handler.dispatchMessage(Handler.java:100)         at android.os.Looper.loop(Looper.java:237)         at android.app.ActivityThread.main(ActivityThread.java:7811)         at java.lang.reflect.Method.invoke(Native Method)         at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076) 

i have a problem message sent to deallocated instance

$
0
0

i have some code in HomeViewController when open next controller i taped button and do

let strotyboard = UIStoryboard(name: "Anketa", bundle: nil)if let anketaController = strotyboard.instantiateViewController(withIdentifier:"QuestionnaireViewController") as? QuestionnaireViewController {anketaController.startNew = trueprint("1111 HomeViewController openNext , ", anketaController)present(anketaController, animated: true, completion: nil)}

When i back to HomeViewController and tap button again to open QuestionnaireViewController it was an error message "QuestionnaireViewController retain]: message sent to deallocated instance 0x10480a400"

i print - print("1111 HomeViewController openNext , ", anketaController) and first time tupped button it was:1111 HomeViewController openNext , <.QuestionnaireViewController: 0x10480a400>in second tapped button it was:1111 HomeViewController openNext , <.QuestionnaireViewController: 0x10901fa00>and app crashes on ios 13 >

PC App wont run properly unless we rename it

$
0
0

We have out own PC app which we use for developing games, but when one user runs it, downloaded through SVN, it crashes after not being able to allocate textures. It seemed to me that it wasn't freeing things properly so just ran out, but I can't run on his machine. However, if he downloads it from svn and renames it, e.g. from TheApp.exe to TheApx.exe it works fine. If he copies it to TheAppCopy.exe it works. IF he renames it to something then back to the original name, it doesnt. Nowhere in the code do we reference the name.

A while ago I was playing with changing the DPI settings programmatically, but I took that out as it just never worked consistently. It seemed to change the settings on the shortcut, so I wondered if the problem was somethign that Windows was tracking about the exact name. I cant find it in the registry though.

Anyone any ideas what is so special about the app's name that causes it not to work unless renamed ?

Thanks

Shaun

Problem: message sent to deallocated instance

$
0
0

I have some code in HomeViewController. When I open next controller and tap the button and do

let strotyboard = UIStoryboard(name: "Anketa", bundle: nil)    if let anketaController = strotyboard.instantiateViewController(withIdentifier: "QuestionnaireViewController") as? QuestionnaireViewController {        anketaController.startNew = true        print("1111 HomeViewController openNext , ", anketaController)        present(anketaController, animated: true, completion: nil)    }

When I back to HomeViewController and tap the button again to open QuestionnaireViewController it was an error message:

"QuestionnaireViewController retain]: message sent to deallocated instance 0x10480a400"

I printed - print("1111 HomeViewController openNext , ", anketaController) and first time I tapped the button it was:

1111 HomeViewController openNext ,  <.QuestionnaireViewController: 0x10480a400>

on the second tapped button it was:

1111 HomeViewController openNext ,  <.QuestionnaireViewController: 0x10901fa00>

and the app crashes on iOS 13

Why does my visual studio closes automatically without any errors

$
0
0

it is the latest version of visual studio pro 2019and there is new folder on my desktop named .vsenter image description here

and the desktop folder contains a folder named v16 and it contains a file named .suoenter image description here

Can it be because of the "CloneSpy" that i installed before today before using visual studio?And what should i do?

Documents.Add in VBA is crashing Word

$
0
0

I have written a vba(word) add-in that I share with quite a few others. With Office 365 being more pervasive, I am starting to get 'crash' reports that I never got before. In debugging, I have found that the Documents.Add call is the culprit. When that line is encountered, it either crashes the program (Word restarts) or the new document is added, but no code after that line is processed (it totally jumps out of the program, but at least doesn't crash). Easily and consistently duplicable.

I created a bit of a workaround, but it's really not a good one. It's:SendKeys "^n"

This only sometimes works.

Anyone have a better solution? Will Microsoft see this complaint?

Roy Lasris

App crashes/stops with empty field. I want to display error enter details is field is empty

$
0
0

I want to know where i did wrong, i have just started learning android programming. And i want to check whether the user has entered any text or not if not display a message?

        button.setOnClickListener {        var hDouble: Double = height.text.toString().toDouble()        var wDouble: Double = weight.text.toString().toDouble()        val on: Boolean = switch1.isChecked        if (on) hDouble *= 0.0254        else hDouble /= 100        var bmicDouble: Double        if (hDouble.toString().isNullOrEmpty() or wDouble.toString().isNullOrEmpty()) {            showbmi.text = "Enter your details"        } else {            bmicDouble = (wDouble) / (hDouble * hDouble)            when {                bmicDouble < 15 -> showbmi.text = "Very Severely underweight"                bmicDouble < 16 -> showbmi.text = "Severely underweight"                bmicDouble < 18.5 -> showbmi.text = "Underweight"                bmicDouble < 25 -> showbmi.text = "Normal"                bmicDouble < 30 -> showbmi.text = "Obese Class 1 - Moderately Obese"                bmicDouble < 35 -> showbmi.text = "Obese Class 2 - Severely Obese"                bmicDouble < 40 -> showbmi.text = "Obese Class 3 - Very Severely Obese"                else -> showbmi.text = "Consult your Doctor"            }        }        showbmi.setError("Enter your details")

'''


Unity crashes when entering playmode

$
0
0

For some reason whenever I enter playmode unity crashes.When I open unity again after it crashed, I sometimes get this error in the console:

Request error (error) UnityEditor.asynchttpclient:Done

Here is editor.log:

Editor log

Player.log:

Player Log

Main Window crashes on close in Qt - ProxyModel header return statement

$
0
0

Having a problem with main window crashing on close, but only if I open the window normal size (not filling the screen) and then maximize it and close the window. If I open it normal size and close it, no problem. This project includes a tableview, tableModel and a ProxyModel. While debugging, it seems to be crashing on this statement in the proxy model header function:

return sourceModel()->headerData(section, orientation, role);

I'm assuming I am missing something in my main constructor based on what I've researched, but I'm not seeing it.

Main Window: #ifndef MAINWINDOW_H#define MAINWINDOW_H#include <QString>#include "XMLFile.h"#include "XMLReader.h"#include "XMLWriter.h"#include <QFile>#include <QMainWindow>#include <QTableWidget>#include <QStringList>#include <QHeaderView>#include <QAction>#include <QStandardItemModel>#include <QTableView>#include <QSortFilterProxyModel>#include "TableModel.h"#include "ProxyModel.h"#include <QItemSelectionModel>#include "CustomTableView.h"QT_BEGIN_NAMESPACEnamespace Ui { class MainWindow; }QT_END_NAMESPACEclass MainWindow : public QMainWindow{    Q_OBJECT       QWidget *centralWidget;   public:    MainWindow(QWidget *parent = nullptr);    ~MainWindow();    const QString filename;public slots:    void ReceiveMessage( const QString &message );  signals:      void readXmlFile( const QString &fileName );      void getXmlTableData();      void setFilter( QString );private slots:    void on_actionOpen_triggered();    void on_actionFind_triggered();    void on_pushButton_clicked();    void on_tableView_activated(const QModelIndex &index);    void on_actionExport_XML_triggered();    void on_actionExit_triggered();private:    Ui::MainWindow *ui;    QString xmlFileName;    QFile file;        XMLReader xmlReader;    XMLWriter xmlWriter;    QVector<QString> xmlArray;    QString filter = "";    CustomTableView *tableView;    TableModel mTableModel;     ProxyModel* proxyModel;        QString accountValue;    QString deptValue;    QString yearValue;    QString filterText;    void createItems();    void createConnections();};#endif // MAINWINDOW_HMainWindow.cpp#include "mainwindow.h"#include "ui_mainwindow.h"#include <QString>#include <QDebug>#include <QMessageBox>#include <QFile>#include <QFileDialog>#include <QApplication>#include "XMLReader.h"#include "XMLWriter.h"#include "XMLFile.h"#include <QInputDialog>#include <QMenu>#include <QModelIndexList>MainWindow::MainWindow(QWidget *parent)    : QMainWindow(parent)    , ui(new Ui::MainWindow)    , xmlReader( filename )      , xmlWriter( filename, &mTableModel )    //, tableView( NULL )    //, proxyModel( NULL )    //, m_xmlView(NULL){    ui->setupUi(this);       connect(&xmlReader, SIGNAL(SendMessage(const QString)), this, SLOT(ReceiveMessage(const QString)));    /* Setup tableview */    tableView = new CustomTableView(this);    ui->verticalLayout->addWidget(tableView);    tableView->setSortingEnabled(true);    /* Table Model Setup */    proxyModel = new ProxyModel(this);    proxyModel->setSourceModel(&mTableModel);    createConnections();}MainWindow::~MainWindow(){    delete ui;}void MainWindow::ReceiveMessage(const QString &message){    QMessageBox::warning(this, "Warning", "Cannot open file : " + message);}void MainWindow::on_actionOpen_triggered(){     QString filename = QFileDialog::getOpenFileName((this),"Open file");     xmlReader.readFile(filename);     setWindowTitle(filename);     createItems();}void MainWindow::createItems(){    xmlArray = xmlReader.getXmlData();    int tableSize = xmlArray.size();      QStringList strList;    QString strSplit = "";    QVector<TableItem> rows;    /* Split into individual items, add as row to tableItem array.*/    /* Insert each tableItem array into the table model. */    for( int row = 0; row < tableSize; row++ )    {        TableItem newRow;        strSplit = xmlArray[row];        strList = strSplit.split("|");        for( int k = 0; k < strList.length(); k++)        {          newRow.setData(k, strList[k] );        }        rows << newRow;    }    mTableModel.initModel( rows );    QAbstractItemModel* model = nullptr;    model = proxyModel;    tableView->setModel( model );    tableView->setColumnHidden(0, true); }void MainWindow::createConnections(){    QObject::connect(ui->lineEdit, SIGNAL(textChanged(QString)), proxyModel, SLOT(setAccount(QString)));    QObject::connect(ui->lineEdit_2, SIGNAL(textChanged(QString)), proxyModel, SLOT(setDept(QString)));    QObject::connect(ui->lineEdit_3, SIGNAL(textChanged(QString)), proxyModel, SLOT(setYear(QString)));    QObject::connect(this, SIGNAL(setFilter(QString)), proxyModel, SLOT(setSearchFilter(QString)));}void MainWindow::on_actionFind_triggered(){   /* Open find string dialog */   bool ok;   QString filterText =  QInputDialog::getText(this, tr("Find"),                                       tr("Search for string:"), QLineEdit::Normal,"", &ok);   setFilter( filterText );}void MainWindow::on_pushButton_clicked(){    /* Clear filter values */    ui->lineEdit->setText("");    ui->lineEdit_2->setText("");    ui->lineEdit_3->setText("");    setFilter("");}void MainWindow::on_tableView_activated(const QModelIndex &index){}void MainWindow::on_actionExport_XML_triggered(){    /* Open save file dialog, call xmlWriter */    QString filename = QFileDialog::getSaveFileName(this, tr("Save XML File"), ".", tr("XML files (*.xml)"));        xmlWriter.WriteFile(filename);  }void MainWindow::on_actionExit_triggered(){    QApplication::quit();}

I can upload more source code if needed. Thanks for any insight here.

-d

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 a picture of the code.enter image description here

Android 7.1 and 7 Native Crash: libc.so tgkill+12

$
0
0

I'm seeing this native crash with the following stack trace.

I have checked other questions similar to this but doesn't found anything similar solution as I have not used TextureView or CardView and I am also sure that it is not due to any library dependencies.

Can anyone have clue, Please?

#00 pc 000000000004ae30 /system/lib/libc.so (tgkill+12)#01 pc 00000000000485c3 /system/lib/libc.so (pthread_kill+34)#02 pc 000000000001de5d /system/lib/libc.so (raise+10)#03 pc 0000000000019561 /system/lib/libc.so (__libc_android_abort+34)#04 pc 00000000000171a0 /system/lib/libc.so (abort+4)#05 pc 000000000031e8fd /system/lib/libart.so (_ZN3art7Runtime5AbortEPKc+328)#06 pc 00000000000b56d7 /system/lib/libart.so (_ZN3art10LogMessageD2Ev+1134)#07 pc 00000000001be831 /system/lib/libart.so (_ZN3art22IndirectReferenceTable3AddEjPNS_6mirror6ObjectE+308)#08 pc 000000000023c917 /system/lib/libart.so (_ZN3art9JavaVMExt16AddWeakGlobalRefEPNS_6ThreadEPNS_6mirror6ObjectE+46)#09 pc 00000000002822ef /system/lib/libart.so (_ZN3art3JNI16NewWeakGlobalRefEP7_JNIEnvP8_jobject+418)#10 pc 0000000000090abb /system/lib/libandroid_runtime.so#11 pc 00000000029950cd /system/framework/arm/boot-framework.oat (android.view.RenderNode.nCreate+96)#12 pc 0000000002994e23 /system/framework/arm/boot-framework.oat (android.view.RenderNode.<init>+70)#13 pc 0000000002994f91 /system/framework/arm/boot-framework.oat (android.view.RenderNode.create+68)#14 pc 00000000027526e3 /system/framework/arm/boot-framework.oat (android.view.View.<init>+750)#15 pc 0000000002752a57 /system/framework/arm/boot-framework.oat (android.view.View.<init>+66)#16 pc 0000000002a6d831 /system/framework/arm/boot-framework.oat (android.widget.TextView.<init>+148)#17 pc 0000000002a6d765 /system/framework/arm/boot-framework.oat (android.widget.TextView.<init>+64)#18 pc 0000000002a6d6f1 /system/framework/arm/boot-framework.oat (android.widget.TextView.<init>+60)#19 pc 0000000002a6d683 /system/framework/arm/boot-framework.oat (android.widget.TextView.<init>+46)#20 pc 000000000003bd5b /dev/ashmem/dalvik-jit-code-cache_17678_17678 (deleted)

Tkinter program freezes with pywinauto

$
0
0

I am very new to python. We have the need to login to multiple servers on a daily basis using RDP. So I created a program using pywinauto to automate the process. This program works fine. Then I added a tkinter UI to display the list of servers in a dropdown. This is when the problem started.

I use pycharm. As soon as I added tkinter code to the program, pycharm started throwing a non-zero exit code. The pywinauto code still worked but the code exited with the message - Process finished with exit code -1073740771 (0xC000041D) in pycharm. I used cx_freeze to freeze this code as an executable. The exe program crashes after it finishes running. Event viewer has the below message -

Log Name: Application

Source: Application Error

Date: 7/4/2020 10:51:40 AM

Event ID: 1000

Task Category: (100)

Level: Error

Keywords: Classic

User: N/A

Description:

Faulting application name: ServerLogin.exe, version: 0.0.0.0, time stamp: 0x5e111c3a

Faulting module name: python38.dll, version: 3.8.2150.1013, time stamp: 0x5e55a7c4

Exception code: 0xc0000005

Fault offset: 0x000000000001cb2d

Faulting process id: 0x2f0c

Faulting application start time: 0x01d651c2f128f713

Faulting application path: C:\Users\username\PycharmProjects\ServerLogin\build\exe.win-amd64-3.8\ServerLogin.exe

Faulting module path: C:\Users\username\PycharmProjects\ServerLogin\build\exe.win-amd64-3.8\python38.dll

Report Id: ff281b07-5ad9-4150-8722-49cc3bf7d0a3

After a lot of research I found that using tkinter with pywinauto - 0.6.8 causes crashes. So I downgraded pywinauto to the version 0.6.5. After this I was getting zero exit code in pycharm but when this was frozen with cx_freeze I saw the same behavior as before with the same message logged in event viewer.

I have tested this on windows 10 and windows 7 64-bit machines using python 3.8.2.

I dont think my code is the problem since it runs fine on pycharm so I dont think there is a need to post the code here. But if you require it please let me know, I will post it.

I am wondering why the frozen application crashes even though pycharm gives me a clean exit. Any help on this appreciated. Please let me know if you need any more information. Thank you!

Viewing all 7149 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>