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

How does a coredump retrieve values of function arguments at the entry of the function and its actual value during crash?

$
0
0

I have a coredump, where in each frame, it gives me the values of function arguments at entry level and its actual value during the crash..(It gives me actual value, only if it is changed from entry value)

As I know, coredump is the copy of RAM during the crash. So, at any point of time only the actual value of the variable can be retieved... Just want to know how does coredump retrieve entry value of the function argument and also the actual value of the function argument?


Androd HTTP request [duplicate]

$
0
0

This question already has an answer here:

I have a problem with creating an android app in Java. I need to send a http request to webserver. I have tried many http libraries, but every of them has the same problem. When the request is processed, the app crashes, even through it is wrapped in try block.

I have tried to add all of the permissions as:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

I get following error:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.scanner, PID: 23467
    java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=49374, result=-1, data=Intent { act=com.google.zxing.client.android.SCAN flg=0x80000 (has extras) }} to activity {com.example.scanner/com.example.scanner.MainActivity}: android.os.NetworkOnMainThreadException
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4335)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:4379)
        at android.app.ActivityThread.-wrap19(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:176)
        at android.app.ActivityThread.main(ActivityThread.java:6651)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
     Caused by: android.os.NetworkOnMainThreadException
        at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1450)
        at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:102)
        at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:90)
        at java.net.InetAddress.getAllByName(InetAddress.java:787)
        at okhttp3.Dns$Companion$SYSTEM$1.lookup(Dns.kt:48)
        at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.kt:160)
        at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.kt:125)
        at okhttp3.internal.connection.RouteSelector.next(RouteSelector.kt:71)
        at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.kt:199)
        at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.kt:109)
        at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.kt:77)
        at okhttp3.internal.connection.Transmitter.newExchange$okhttp(Transmitter.kt:162)
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.kt:35)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.kt:82)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:84)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:71)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:184)
        at okhttp3.RealCall.execute(RealCall.kt:66)
        at com.example.scanner.Analysator.process(Analysator.java:37)
        at com.example.scanner.MainActivity.onActivityResult(MainActivity.java:62)
        at android.app.Activity.dispatchActivityResult(Activity.java:7355)
        at android.app.ActivityThread.deliverResults(ActivityThread.java:4331)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:4379) 
        at android.app.ActivityThread.-wrap19(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1673) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:176) 
        at android.app.ActivityThread.main(ActivityThread.java:6651) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824) 

ANDROID | Native crash | signal 7 (SIGBUS), code 1 (BUS_ADRALN)

$
0
0

I was unable to understand what could have caused this issue. Though it refers to RegexMatcher. Does it mean, regular expression used in app may have caused this? I am unable to reproduce this in devices. And it doesn't look like every-time issue. Need support to understand what backtrace suggests?

Devices where Issue is seen
Huawei honor 10 Lite (HWHRY-H), Android 9
Huawei Mate 10 Pro (HWBLA), Android 9
Huawei Mate 20 Pro (HWLYA), Android 9
Huawei P20 Pro (HWCLT), Android 9
Huawei P10 Plus (HWVKY), Android 9
Huawei FIG-LX1 (HWFIG-H), Android 9
Huawei P20 Pro (HWCLT), Android 9

**Error received from Google Play console:**
backtrace:
  #00  pc 0000000000133d69  /system/lib64/libicuuc.so
  #01  pc 000000000019cf58  /system/lib64/libicui18n.so (icu_60::RegexMatcher::~RegexMatcher()+48)
  #02  pc 000000000019cfec  /system/lib64/libicui18n.so (icu_60::RegexMatcher::~RegexMatcher()+16)
  #03  pc 000000000002336c  /system/lib64/libjavacore.so (Matcher_free(void*)+68)
  #04  pc 0000000000094120  /system/framework/arm64/boot-core-libart.oat (java.math.NativeBN.BN_copy [DEDUPED]+160)
  #05  pc 000000000018340c  /system/framework/arm64/boot-core-libart.oat (libcore.util.NativeAllocationRegistry$CleanerThunk.run+76)
  #06  pc 000000000040c754  /system/framework/arm64/boot.oat (sun.misc.Cleaner.clean+164)
  #07  pc 00000000001daa0c  /system/framework/arm64/boot.oat (java.lang.ref.ReferenceQueue.enqueueLocked+236)
  #08  pc 00000000001dab2c  /system/framework/arm64/boot.oat (java.lang.ref.ReferenceQueue.enqueuePending+172)
  #09  pc 00000000001d7b04  /system/framework/arm64/boot-core-libart.oat (java.lang.Daemons$ReferenceQueueDaemon.runInternal+244)
  #10  pc 000000000015978c  /system/framework/arm64/boot-core-libart.oat (java.lang.Daemons$Daemon.run+76)
  #11  pc 00000000002c1038  /system/framework/arm64/boot.oat (java.lang.Thread.run+72)
  #12  pc 000000000056ef88  /system/lib64/libart.so (art_quick_invoke_stub+584)
  #13  pc 00000000000d4204  /system/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+200)
  #14  pc 0000000000472fd4  /system/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
  #15  pc 0000000000474090  /system/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue*)+424)
  #16  pc 000000000049f684  /system/lib64/libart.so (art::Thread::CreateCallback(void*)+1120)
  #17  pc 0000000000083588  /system/lib64/libc.so (__pthread_start(void*)+36)
  #18  pc 00000000000241dc  /system/lib64/libc.so (__start_thread+68)

java.lang.RuntimeException: Unable to instantiate application

$
0
0

In Google Play Developer Console I see this crash:

java.lang.RuntimeException: Unable to instantiate application com.example.MyApp: java.lang.ClassNotFoundException: Didn't find class "com.example.MyApp" on path: DexPathList[[zip file "/mnt/asec/com.example.testapp-1/pkg.apk"],nativeLibraryDirectories=[/mnt/asec/com.example.testapp-1/lib, /vendor/lib, /system/lib]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4545)
at android.app.ActivityThread.access$1500(ActivityThread.java:160)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1390)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5330)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.MyApp" on path: DexPathList[[zip file "/mnt/asec/com.example.testapp-1/pkg.apk"],nativeLibraryDirectories=[/mnt/asec/com.example.testapp-1/lib, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newApplication(Instrumentation.java:975)
at android.app.LoadedApk.makeApplication(LoadedApk.java:511)
... 11 more
Suppressed: java.io.IOException: unable to open DEX file
at dalvik.system.DexFile.openDexFileNative(Native Method)
at dalvik.system.DexFile.openDexFile(DexFile.java:296)
at dalvik.system.DexFile.<init>(DexFile.java:80)
at dalvik.system.DexFile.<init>(DexFile.java:59)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:263)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:230)
at dalvik.system.DexPathList.<init>(DexPathList.java:112)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:65)
at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:57)
at android.app.LoadedApk.getClassLoader(LoadedApk.java:326)
at android.app.LoadedApk.makeApplication(LoadedApk.java:508)
... 11 more

This crash occurs mostly on Android versions 4.4 and 4.2. This answer suggests that this crash occurs when the apk is updated by dalvik. It seems to be a low-priority Android bug.

Are there any workarounds for this? Does it help to set

<application        
        android:allowBackup="false"

in Manifest.xml?

(Maybe the backup of application is stored on SD-card, which is causing the problem on apk update).

Why does my action crash when I create intent and start it? [duplicate]

$
0
0

This question already has an answer here:

Why does my app crash when changing activity???????????????????

.java:

package com.example.findyourgift;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.Intent;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.RemoteViews;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

public class Riddle1 extends AppCompatActivity {

    TextView textRiddle1;
    Button buttonSubmit;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_riddle1);
        textRiddle1 = (TextView) findViewById(R.id.textRiddle1);
        buttonSubmit= (Button) findViewById(R.id.buttonSubmit);
    }

    Intent intent2 = new Intent(this, Incorrect1.class);
    Intent intent1 = new Intent(this, Correct.class);

    public void riddle1(View View){
        if (textRiddle1.getText() == "Footsteps" || textRiddle1.getText() == "footsteps") {
            startActivity(intent1);
        } else {
            startActivity(intent2);
        }
    }
}

.xml:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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"
    tools:context=".Riddle1">

    <EditText
        android:id="@+id/headingRiddle1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginTop="16dp"
        android:ems="10"
        android:importantForAutofill="no"
        android:inputType="textPersonName"
        android:text="@string/riddle_1"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/textView"
        android:layout_width="234dp"
        android:layout_height="111dp"
        android:layout_marginStart="72dp"
        android:layout_marginTop="229dp"
        android:text="@string/textRiddle1"
        android:textAllCaps="true"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/headingRiddle1" />

    <EditText
        android:id="@+id/textRiddle1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="96dp"
        android:layout_marginTop="128dp"
        android:ems="10"
        android:hint="@string/answer"
        android:importantForAutofill="no"
        android:inputType="textPersonName"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textView" />

    <Button
        android:id="@+id/buttonSubmit"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="162dp"
        android:layout_marginTop="57dp"
        android:onClick="riddle1"
        android:text="Submit"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/textRiddle1" />

</androidx.constraintlayout.widget.ConstraintLayout>

If you need more help tell me? Please HELP? pls! pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls! pls! pls! pls!pls!pls!v pls!pls!pls!pls!pls!pls!pls!pls! pls!pls! pls! vv pls! vpls!pls! pls!pls!pls! pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!pls!

Click on SELECT tag in a WebView on a Samsung Galaxy Tab Version 9.0 crashes the application

$
0
0

I have custom Webview in android application which opens a webpage containing ** html dropdown List(Select HTML Tag)**. Whenever I click on this dropdown list app got crashed.

This crash is happening on Samsung Tab Android Version 9.0 and It's working fine at Samsung Tab version 7.0, Google Pixel Mobile V9.0, Samsung Mobile device V7.0,V6.0 are also working fine. It's working fine with Tab Emulator version 8.0, 9.0 as well.

I did lots of research but no luck. There are many posts where people were facing the same issue in the past with Android Version 8.0 but there is no proper solution for the same.

Someone said that it's happening because we are passing ApplcationContext to the fragment(which contains Webview) and suggested to add tool:context with Activity context in XML but it didn't work.

Reference Link:- Trying to open SELECT tag in Android WebView crashes the application

Trying to open SELECT tag in Android WebView crashes the application

I didn't try it on any other brand devices(except Samsung) with the same version V9.0 but I think it's happening only Samsung Tab device version 9.0 as it's not crashing on Emulators with the same version and not even on mobile devices

So, I'm not sure why it's happening. Can some please look into it and provide a proper solution.

2019-09-27 12:56:56.508
13968-13968/****************************************pe
D/InputMethodManager: startInputInner - Id : 0 2019-09-27 12:56:56.508
13968-13968/****************************************pe
I/InputMethodManager: startInputInner -
mService.startInputOrWindowGainedFocus 2019-09-27 12:56:56.512
13968-13968/****************************************pe
D/InputTransport: Input channel constructed: fd=198 2019-09-27
12:56:56.513 13968-13968/****************************************pe
D/InputTransport: Input channel destroyed: fd=171 2019-09-27
12:56:56.665 13968-13968/****************************************pe
******: android.view.InflateException: Binary XML file line #32: Binary XML file line #32: Error inflating class TextView 2019-09-27
12:56:56.666 13968-13968/****************************************pe
******: Caused by: android.view.InflateException: Binary XML file line #32: Error inflating class TextView 2019-09-27 12:56:56.668 13968-13968/****************************************pe ******: Caused
by: android.content.res.Resources$NotFoundException: Unable to find
resource ID #0x20b019d 2019-09-27 12:56:56.669
13968-13968/****************************************pe ******:     at
android.content.res.ResourcesImpl.getResourceEntryName(ResourcesImpl.java:291)
2019-09-27 12:56:56.699
13968-13968/****************************************pe ******:     at
org.chromium.content.browser.input.SelectPopup.show(PG:40) 2019-09-27
12:56:56.699 13968-13968/****************************************pe
******:     at android.os.MessageQueue.nativePollOnce(Native Method) 2019-09-27 12:56:56.699
13968-13968/****************************************pe ******:     at
android.os.MessageQueue.next(MessageQueue.java:326) 2019-09-27
12:56:56.699 13968-13968/****************************************pe
******:     at android.os.Looper.loop(Looper.java:181) 2019-09-27 12:56:56.700 13968-13968/****************************************pe
******:     at android.app.ActivityThread.main(ActivityThread.java:7179) 2019-09-27
12:56:56.700 13968-13968/****************************************pe
******:     at java.lang.reflect.Method.invoke(Native Method) 2019-09-27 12:56:56.700
13968-13968/****************************************pe ******:     at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
2019-09-27 12:56:56.701
13968-13968/****************************************pe ******:     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
2019-09-27 12:56:56.725
13968-13968/****************************************pe A/chromium:
[FATAL:jni_android.cc(249)] Please include Java exception stack in
crash report

Node.js heap out of memory

$
0
0

Today I ran my script for filesystem indexing to refresh RAID files index and after 4h it crashed with following error:

[md5:]  241613/241627 97.5%  
[md5:]  241614/241627 97.5%  
[md5:]  241625/241627 98.1%
Creating missing list... (79570 files missing)
Creating new files list... (241627 new files)

<--- Last few GCs --->

11629672 ms: Mark-sweep 1174.6 (1426.5) -> 1172.4 (1418.3) MB, 659.9 / 0 ms [allocation failure] [GC in old space requested].
11630371 ms: Mark-sweep 1172.4 (1418.3) -> 1172.4 (1411.3) MB, 698.9 / 0 ms [allocation failure] [GC in old space requested].
11631105 ms: Mark-sweep 1172.4 (1411.3) -> 1172.4 (1389.3) MB, 733.5 / 0 ms [last resort gc].
11631778 ms: Mark-sweep 1172.4 (1389.3) -> 1172.4 (1368.3) MB, 673.6 / 0 ms [last resort gc].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x3d1d329c9e59 <JS Object>
1: SparseJoinWithSeparatorJS(aka SparseJoinWithSeparatorJS) [native array.js:~84] [pc=0x3629ef689ad0] (this=0x3d1d32904189 <undefined>,w=0x2b690ce91071 <JS Array[241627]>,L=241627,M=0x3d1d329b4a11 <JS Function ConvertToString (SharedFunctionInfo 0x3d1d3294ef79)>,N=0x7c953bf4d49 <String[4]\: ,\n  >)
2: Join(aka Join) [native array.js:143] [pc=0x3629ef616696] (this=0x3d1d32904189 <undefin...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/bin/node]
 2: 0xe2c5fc [/usr/bin/node]
 3: v8::Utils::ReportApiFailure(char const*, char const*) [/usr/bin/node]
 4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/bin/node]
 5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/usr/bin/node]
 6: v8::internal::Runtime_SparseJoinWithSeparator(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/bin/node]
 7: 0x3629ef50961b

Server is equipped with 16gb RAM and 24gb SSD swap. I highly doubt my script exceeded 36gb of memory. At least it shouldn't

Script creates index of files stored as Array of Objects with files metadata (modification dates, permissions, etc, no big data)

Here's full script code: http://pastebin.com/mjaD76c3

I've already experiend weird node issues in the past with this script what forced me eg. split index into multiple files as node was glitching when working on such big files as String. Is there any way to improve nodejs memory management with huge datasets?

1073.75 MB of file backed memory dirtied over 186 seconds (5770.75 KB per second average), exceeding limit of 12.43 KB per second over 86400 seconds

$
0
0

iOS crash

Look the crash stack, is it the icloud backup get something error? I don't know what is this error.

Help, thanks.

1073.75 MB of file backed memory dirtied over 186 seconds (5770.75 KB per second average), exceeding limit of 12.43 KB per second over 86400 seconds
Command:          HelloTalk_Binary
Path:             
Identifier:       
Version:          3.6.4 (6)
Beta Identifier:  5D4C1274-7310-4015-9227-B2190563BAE3
PID:              623

Event:            disk writes
Action taken:     none
Writes:           1073.75 MB of file backed memory dirtied over 186 seconds (5770.75 KB per second average), exceeding limit of 12.43 KB per second over 86400 seconds
Writes limit:     1073.74 MB
Limit duration:   86400s
Writes caused:    1073.75 MB
Writes duration:  186s
Duration:         186.07s
Duration Sampled: 45.98s
Steps:            60 ( (10.49 MB/step))

Hardware model:   iPhone10,3
Active cpus:      6


Heaviest stack for the target process:
  60  ??? (libsystem_pthread.dylib + 48008) [0x18271eb88]
  60  ??? (libdispatch.dylib + 275516) [0x1826b643c]
  60  ??? (libdispatch.dylib + 237864) [0x1826ad128]
  60  ??? (libdispatch.dylib + 235280) [0x1826ac710]
  60  ??? (libdispatch.dylib + 377220) [0x1826cf184]
  60  ??? (libdispatch.dylib + 374288) [0x1826ce610]
  57  ??? (HelloTalk_Binary + 23667476) [0x105792314]
  23  ??? (HelloTalk_Binary + 23665404) [0x105791afc]
  23  ??? (HelloTalk_Binary + 32163208) [0x105fac588]
  23  ??? (<7F66DDA9-9EB4-3CA9-94BF-2E87E9B8B20C> + 47812) [0x108cffac4]
  23  ??? (<7F66DDA9-9EB4-3CA9-94BF-2E87E9B8B20C> + 48280) [0x108cffc98]
  23  ??? (libsystem_c.dylib + 245252) [0x182631e04]
  20  ??? (libsystem_c.dylib + 244268) [0x182631a2c]
  20  ??? (libsystem_c.dylib + 5588) [0x1825f75d4]
  20  ??? (libsystem_kernel.dylib + 154316) [0x1827faacc]


Powerstats for:   [623]
Bundle ID:        
Adam ID:          0
Is first party:   No
App version:      3.6.4
Build version:    6
Is Beta:          No
Share with Devs:  Yes
UUID:             8A9B6AAB-F4F1-3ADA-9CDF-0C0D23A46AF1
Path:             
Architecture:     arm64
Footprint:        217.66 MB -> 171.48 MB (-46.17 MB) (max 362.86 MB )
Pageins:          399 pages
Start time:       2019-11-28 08:58:06 +0800
End time:         2019-11-28 08:58:52 +0800
Num samples:      60 (100%)
CPU Time:         13.931s
Primary state:    59 samples Frontmost App, Non-Suppressed, Kernel mode, Effective Thread QoS User Initiated, Requested Thread QoS User Initiated, Override Thread QoS Unspecified
User Activity:    0 samples Idle, 60 samples Active
Power Source:     60 samples on Battery, 0 samples on AC
  60  ??? (libsystem_pthread.dylib + 48008) [0x18271eb88]
    60  ??? (libdispatch.dylib + 275516) [0x1826b643c]
      60  ??? (libdispatch.dylib + 237864) [0x1826ad128]
        60  ??? (libdispatch.dylib + 235280) [0x1826ac710]
          60  ??? (libdispatch.dylib + 377220) [0x1826cf184]
            60  ??? (libdispatch.dylib + 374288) [0x1826ce610]
              57  __31-[HTBackupToIcloudModel backup]_block_invoke (HTBackupToIcloudModel.m:358 in HelloTalk_Binary + 23667476) [0x105792314]
                23  -[HTBackupToIcloudModel createBackupFile] (HTBackupToIcloudModel.m:271 in HelloTalk_Binary + 23665404) [0x105791afc]
                  23  -[ZipWriteStream writeData:] (ZipWriteStream.m:53 in HelloTalk_Binary + 32163208) [0x105fac588]
                    23  zipWriteInFileInZip (zip.c:1464 in SSZipArchive + 47812) [0x108cffac4]
                      23  zip64FlushWriteBuffer (zip.c:1381 in SSZipArchive + 48280) [0x108cffc98]
                        23  ??? (libsystem_c.dylib + 245252) [0x182631e04]
                          20  ??? (libsystem_c.dylib + 244268) [0x182631a2c]
                            20  ??? (libsystem_c.dylib + 5588) [0x1825f75d4]
                              20  ??? (libsystem_kernel.dylib + 154316) [0x1827faacc]
                          3   ??? (libsystem_c.dylib + 244316) [0x182631a5c]
                            3   ??? (libsystem_c.dylib + 235260) [0x18262f6fc]
                              3   ??? (libsystem_c.dylib + 5588) [0x1825f75d4]
                                3   ??? (libsystem_kernel.dylib + 154316) [0x1827faacc]
                20  -[HTBackupToIcloudModel createBackupFile] (HTBackupToIcloudModel.m:272 in HelloTalk_Binary + 23665416) [0x105791b08]
                  20  -[ZipWriteStream finishedWriting] (ZipWriteStream.m:61 in HelloTalk_Binary + 32163424) [0x105fac660]
                    18  zipCloseFileInZipRaw64 (zip.c:1589 in SSZipArchive + 48540) [0x108cffd9c]
                      18  zip64FlushWriteBuffer (zip.c:1381 in SSZipArchive + 48280) [0x108cffc98]
                        18  ??? (libsystem_c.dylib + 245252) [0x182631e04]
                          18  ??? (libsystem_c.dylib + 244268) [0x182631a2c]
                            18  ??? (libsystem_c.dylib + 5588) [0x1825f75d4]
                              18  ??? (libsystem_kernel.dylib + 154316) [0x1827faacc]
                    2   zipCloseFileInZipRaw64 (zip.c:1718 in SSZipArchive + 49524) [0x108d00174]
                      2   ??? (libsystem_c.dylib + 5144) [0x1825f7418]
                        2   ??? (libsystem_c.dylib + 243516) [0x18263173c]
                          2   ??? (libsystem_c.dylib + 235260) [0x18262f6fc]
                            2   ??? (libsystem_c.dylib + 5588) [0x1825f75d4]
                              2   ??? (libsystem_kernel.dylib + 154316) [0x1827faacc]
                13  -[HTBackupToIcloudModel createBackupFile] (HTBackupToIcloudModel.m:252 in HelloTalk_Binary + 23664864) [0x1057918e0]
                  13  -[ZipWriteStream writeData:] (ZipWriteStream.m:53 in HelloTalk_Binary + 32163208) [0x105fac588]
                    13  zipWriteInFileInZip (zip.c:1464 in SSZipArchive + 47812) [0x108cffac4]
                      13  zip64FlushWriteBuffer (zip.c:1381 in SSZipArchive + 48280) [0x108cffc98]
                        13  ??? (libsystem_c.dylib + 245252) [0x182631e04]
                          13  ??? (libsystem_c.dylib + 244268) [0x182631a2c]
                            13  ??? (libsystem_c.dylib + 5588) [0x1825f75d4]
                              13  ??? (libsystem_kernel.dylib + 154316) [0x1827faacc]
                1   -[HTBackupToIcloudModel createBackupFile] (HTBackupToIcloudModel.m:253 in HelloTalk_Binary + 23664876) [0x1057918ec]
                  1   -[ZipWriteStream finishedWriting] (ZipWriteStream.m:61 in HelloTalk_Binary + 32163424) [0x105fac660]
                    1   zipCloseFileInZipRaw64 (zip.c:1589 in SSZipArchive + 48540) [0x108cffd9c]
                      1   zip64FlushWriteBuffer (zip.c:1381 in SSZipArchive + 48280) [0x108cffc98]
                        1   ??? (libsystem_c.dylib + 245252) [0x182631e04]
                          1   ??? (libsystem_c.dylib + 244268) [0x182631a2c]
                            1   ??? (libsystem_c.dylib + 5588) [0x1825f75d4]
                              1   ??? (libsystem_kernel.dylib + 154316) [0x1827faacc]
              2   __25-[HTCache synchronizeNow]_block_invoke (HTCache.m:555 in HelloTalk_Binary + 28087512) [0x105bc94d8]
                2   ??? (Foundation + 424364) [0x182d1a9ac]
                  2   ??? (Foundation + 1163316) [0x182dcf034]
                    2   ??? (Foundation + 297596) [0x182cfba7c]
                      2   ??? (Foundation + 1164516) [0x182dcf4e4]
                        2   ??? (libsystem_kernel.dylib + 162716) [0x1827fcb9c]
                          1   <Effective Thread QoS User Interactive>
              1   __53-[SensorsAnalyticsSDK track:withProperties:withType:]_block_invoke (SensorsAnalyticsSDK.m:1668 in SensorsAnalyticsSDK + 194464) [0x108d477a0]
                1   -[SensorsAnalyticsSDK enqueueWithType:andEvent:] (SensorsAnalyticsSDK.m:1404 in SensorsAnalyticsSDK + 187712) [0x108d45d40]
                  1   -[MessageQueueBySqlite addObejct:withType:] (MessageQueueBySqlite.m:115 in SensorsAnalyticsSDK + 31508) [0x108d1fb14]
                    1   ??? (libsqlite3.dylib + 269148) [0x18465ab5c]
                      1   ??? (libsqlite3.dylib + 313648) [0x184665930]
                        1   ??? (libsqlite3.dylib + 440088) [0x184684718]
                          1   ??? (libsqlite3.dylib + 437700) [0x184683dc4]
                            1   ??? (libsqlite3.dylib + 427668) [0x184681694]
                              1   ??? (libsqlite3.dylib + 483304) [0x18468efe8]
                                1   ??? (libsystem_kernel.dylib + 157916) [0x1827fb8dc]


- (BOOL)createBackupFile {
    @autoreleasepool {
        NSFileManager *fileManager = NSFileManager.new;

        // 创建缓存路径
        NSString *tmpICloudPath = [NSTemporaryDirectory() stringByAppendingPathComponent:@"iCloud"];
        if ([fileManager fileExistsAtPath:tmpICloudPath isDirectory:NULL]) {
            [[NSFileManager defaultManager] removeItemAtPath:tmpICloudPath error:NULL];
        }
        [fileManager createDirectoryAtPath:tmpICloudPath withIntermediateDirectories:YES attributes:NULL error:NULL];

        NSString *zipFilePath = [tmpICloudPath stringByAppendingPathComponent:@"Backup.zip"];
        if ([fileManager fileExistsAtPath:zipFilePath]) {
            [fileManager removeItemAtPath:zipFilePath error:NULL];
        }

        ZipFile *zipFile= [[ZipFile alloc] initWithFileName:zipFilePath mode:ZipFileModeCreate];

        // 开始压缩
        NSInteger totalFileCounts = 0;

        // 压缩数据库
        NSString *dbBackupPath = nil;
        NSArray *dbSubpaths = nil;
        @autoreleasepool {
            dbBackupPath = [HTPath localBackupPathWithUserId:[[HTCache sharedCache] stringForKey:HT_UserId]];
            dbSubpaths = [fileManager subpathsAtPath:dbBackupPath];
            totalFileCounts += dbSubpaths.count;
        }

        // 压缩语音
        NSString *audioPath = nil;
        NSArray *audioSubpaths = nil;
        @autoreleasepool {
            audioPath = [HTPath localAudioPathWithUserId:[[HTCache sharedCache] stringForKey:HT_UserId]];
            audioSubpaths = [fileManager subpathsAtPath:audioPath];
            totalFileCounts += audioSubpaths.count;
        }

        // 压缩图片
        NSString *imagesPath = nil;
        NSMutableArray *imageSubpaths = nil;
        @autoreleasepool {
            imagesPath = [HTPath localImagePathWithUserId:[[HTCache sharedCache] stringForKey:HT_UserId]];
            NSArray *tempImagesSubPath = [fileManager subpathsAtPath:imagesPath];
            imageSubpaths = [NSMutableArray array];
            for (NSString *path in tempImagesSubPath) {
                if ([path hasSuffix:@"_thum.jpg"]) {
                    [imageSubpaths addObject:path];
                }
            }

            totalFileCounts += imageSubpaths.count;
        }

        // 压缩视频缩略图,不压缩视频文件
        NSString *videosPath = nil;
        NSMutableArray *videoSubpaths = nil;
        @autoreleasepool {
            videosPath = [HTPath localVideoPathWithUserId:[[HTCache sharedCache] stringForKey:HT_UserId]];
            NSArray *tempVideoSubpaths = [fileManager subpathsAtPath:videosPath];
            videoSubpaths = [NSMutableArray array];
            for (NSString *path in tempVideoSubpaths) {
                if([path hasSuffix:@"_thum.jpg"]) {
                    [videoSubpaths addObject:path];
                }
            }

            totalFileCounts += videoSubpaths.count;
        }

        float onePercent = 1 / (float)totalFileCounts;
        float tempTotalPercent = self.conpressProgress / 100.0f;

        NSLog(@"iCloud total files: %@", @(totalFileCounts).stringValue);

        BOOL isDir = YES;
        for(NSString *path in dbSubpaths){
            @autoreleasepool {
                NSString *fullPath = [dbBackupPath stringByAppendingPathComponent:path];
                if([fileManager fileExistsAtPath:fullPath isDirectory:&isDir] && !isDir){
                    ZipWriteStream *stream= [zipFile writeFileInZipWithName:[NSString stringWithFormat:@"Backup/Backup/%@", path] compressionLevel:ZipCompressionLevelFastest];
                    NSData *data = [[NSData alloc] initWithContentsOfFile:fullPath options:NSDataReadingUncached error:NULL];
                    [stream writeData:data];
                    [stream finishedWriting];
                }
            }

            tempTotalPercent += onePercent;
            int conpressProgress = tempTotalPercent * 100;
            if (conpressProgress != self.conpressProgress) {
                self.conpressProgress = conpressProgress;
            }
        }


        for(NSString *path in audioSubpaths){
            @autoreleasepool {
                NSString *fullPath = [audioPath stringByAppendingPathComponent:path];
                if([fileManager fileExistsAtPath:fullPath isDirectory:&isDir] && !isDir){
                    ZipWriteStream *stream= [zipFile writeFileInZipWithName:[NSString stringWithFormat:@"Backup/audios/%@", path] compressionLevel:ZipCompressionLevelNone];
                    NSData *data = [[NSData alloc] initWithContentsOfFile:fullPath options:NSDataReadingUncached error:NULL];
                    [stream writeData:data];
                    [stream finishedWriting];
                }
            }

            tempTotalPercent += onePercent;
            int conpressProgress = tempTotalPercent * 100;
            if (conpressProgress != self.conpressProgress) {
                self.conpressProgress = conpressProgress;
            }
        }


        for(NSString *path in imageSubpaths){
            @autoreleasepool {
                NSString *fullPath = [imagesPath stringByAppendingPathComponent:path];
                if([fileManager fileExistsAtPath:fullPath isDirectory:&isDir] && !isDir){
                    ZipWriteStream *stream= [zipFile writeFileInZipWithName:[NSString stringWithFormat:@"Backup/images/%@", path] compressionLevel:ZipCompressionLevelNone];
                    NSData *data = [[NSData alloc] initWithContentsOfFile:fullPath options:NSDataReadingUncached error:NULL];
                    [stream writeData:data];
                    [stream finishedWriting];
                }
            }

            tempTotalPercent += onePercent;
            int conpressProgress = tempTotalPercent * 100;
            if (conpressProgress != self.conpressProgress) {
                self.conpressProgress = conpressProgress;
            }
        }


        for(NSString *path in videoSubpaths){
            @autoreleasepool {
                NSString *fullPath = [videosPath stringByAppendingPathComponent:path];
                if([fileManager fileExistsAtPath:fullPath isDirectory:&isDir] && !isDir){
                    ZipWriteStream *stream= [zipFile writeFileInZipWithName:[NSString stringWithFormat:@"Backup/videos/%@", path] compressionLevel:ZipCompressionLevelFastest];
                    NSData *data = [[NSData alloc] initWithContentsOfFile:fullPath options:NSDataReadingUncached error:NULL];
                    [stream writeData:data];
                    [stream finishedWriting];
                }
            }

            tempTotalPercent += onePercent;
            int conpressProgress = tempTotalPercent * 100;
            if (conpressProgress != self.conpressProgress) {
                self.conpressProgress = conpressProgress;
            }
        }

        [zipFile close];
        [zipFile release];

        NSLog(@"conpress end");

        NSDictionary *attributes = [fileManager attributesOfItemAtPath:zipFilePath error:NULL];
        self.backupSize = [attributes doubleForKey:NSFileSize] / (1024.0f * 1024.0f);

        return YES;
    }

}

Jailbreak phones crash Hookkeyboard.dylib

$
0
0

Jailbreak phones crash hookkeyboard.dylib 0xc6bcf4b replaced_SCNetworkReachabilityGetFlags(__SCNetworkReachability const*, unsigned int*)

# OS Version: 10.3.3 (17A854)
# Device: iPhone X
#9. Crashed: com.sensorsdata.serialQueue.0x15528900
0  CoreFoundation                 0x1b1d6eb4 CFBasicHashFindBucket + 2724
1  CoreFoundation                 0x1b2a16f5 __CFStringEqual + 168
2  CoreFoundation                 0x1b1d63b5 CFDictionaryGetValue + 100
3  hookkeyboard.dylib             0xc6bcf4b replaced_SCNetworkReachabilityGetFlags(__SCNetworkReachability const*, unsigned int*) + 136190
4  hookkeyboard.dylib             0xc69fbc7 replaced_SCNetworkReachabilityGetFlags(__SCNetworkReachability const*, unsigned int*) + 16506
5  hookkeyboard.dylib             0xc69f533 replaced_SCNetworkReachabilityGetFlags(__SCNetworkReachability const*, unsigned int*) + 14822
6  Foundation                     0x1bb66279 <redacted> + 192
7  Foundation                     0x1bb2d9c3 <redacted> + 142
8  ZZKKO                          0x361e6c3 -[SensorsAnalyticsSDK isFirstDay] + 1320422 (SensorsAnalyticsSDK.m:674)
9  ZZKKO                          0x3624335 __53-[SensorsAnalyticsSDK track:withProperties:withType:]_block_invoke + 1344088 (SensorsAnalyticsSDK.m:1644)

ios - present UIAlertController on top of everything regardless of the view hierarchy

$
0
0

I'm trying to have an helper class that presents an UIAlertController. Since it's a helper class, I want it to work regardless of the view hierarchy, and with no information about it. I'm able to show the alert, but when it's being dismissed, the app crashed with:

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'Trying to dismiss UIAlertController <UIAlertController: 0x135d70d80>
 with unknown presenter.'

I'm creating the popup with:

guard let window = UIApplication.shared.keyWindow else { return }
let view = UIView()
view.isUserInteractionEnabled = true
window.insertSubview(view, at: 0)
window.bringSubview(toFront: view)
// add full screen constraints to view ...

let controller = UIAlertController(
  title: "confirm deletion?",
  message: ":)",
  preferredStyle: .alert
)

let deleteAction = UIAlertAction(
  title: "yes",
  style: .destructive,
  handler: { _ in
    DispatchQueue.main.async {
      view.removeFromSuperview()
      completion()
    }
  }
)
controller.addAction(deleteAction)

view.insertSubview(controller.view, at: 0)
view.bringSubview(toFront: controller.view)
// add centering constraints to controller.view ...

When I tap yes, the app will crash and the handler is not being hit before the crash. I can't present the UIAlertController because this would be dependent of the current view hierarchy, while I want the popup to be independant

EDIT: Swift solution Thanks @Vlad for the idea. It seems that operating in a separate window is much more simple. So here is a working Swift solution:

class Popup {
  private var alertWindow: UIWindow
  static var shared = Popup()

  init() {
    alertWindow = UIWindow(frame: UIScreen.main.bounds)
    alertWindow.rootViewController = UIViewController()
    alertWindow.windowLevel = UIWindowLevelAlert + 1
    alertWindow.makeKeyAndVisible()
    alertWindow.isHidden = true
  }

  private func show(completion: @escaping ((Bool) -> Void)) {
    let controller = UIAlertController(
      title: "Want to do it?",
      message: "message",
      preferredStyle: .alert
    )

    let yesAction = UIAlertAction(
      title: "Yes",
      style: .default,
      handler: { _ in
        DispatchQueue.main.async {
          self.alertWindow.isHidden = true
          completion(true)
        }
    })

    let noAction = UIAlertAction(
      title: "Not now",
      style: .destructive,
      handler: { _ in
        DispatchQueue.main.async {
          self.alertWindow.isHidden = true
          completion(false)
        }
    })

    controller.addAction(noAction)
    controller.addAction(yesAction)
    self.alertWindow.isHidden = false
    alertWindow.rootViewController?.present(controller, animated: false)
  }
}

SwiftUI Observable Object Not Observed

$
0
0

In my latest project to learn SwiftUI, I create an Observable Object in a file called UserData:

final class UserData: ObservableObject {
    @Published var data = jsonData
}

I set the Environmental Variable in SceneDelgate:

window.rootViewController = UIHostingController(rootView: dataList().environmentObject(UserData()))

And declare it in the relevant file:

@EnvironmentObject private var userData: UserData

    var body: some View {
        NavigationView {
            List {
                ForEach(userData.data) { data in
                    DataRow(data: data)
                }
            }
        }
            .navigationBarTitle(Text("My Data"))
    }

Yet I get this:

"Can Not Preview File, Data.app may have crashed"

Checking the crash report, it appears my code can't find UserData. However, I believe I have taken all the steps necessary to make it observable (as this is basically copy and pasted from an Apple tutorial). What's going wrong?

C++ code crashes and has an infinite loop

$
0
0

I have several problems with this code;

First, if I run it then I chose PUSH and typed two names like "Emily Glassberg" it goes into infinite loop but if I typed only one name like "Michael" it works good.Problem picture.

Secondly, after I run the code when I

  1. choose "PUSH" -type one name-
  2. then choose "Delete"
  3. then choose "PUSH" -and type one name again- the program crashes,
    It even crashes if I chose "Delete" only before I enter any names.
    Problem 2.1 picture
    Problem 2.2 picture
#include<iostream>
#include<conio.h>
#include<stdlib.h>
using namespace std;

struct Queue
{
    struct node
    {
        node *next;
        string name;
    };

    node *head;
    int front=-1,rare=-1;

    void push(string x)
    {
        if (rare < 0 )
        {
            head =new node;
            head->next=NULL;
            head->name=x;
            rare ++;
        }
        else
        {
            node *temp,*temp1;
            temp=head;

            while(temp->next != NULL){temp=temp->next;}

            temp1=new node;
            temp->next=temp1;
            temp1->next=NULL;
            temp1->name=x;
        }
    }

    void display()
    {
        node *temp;
        temp=head;
        if (rare < 0)
        {
            cout <<"Queue under flow";
            return;
        }
        cout<<"\nthe queue is: \n\n";
        while(temp != NULL)
        {
            cout <<temp->name<<endl;
            temp=temp->next;
        }
    }
    void pop()
    {

        if( rare < 0)
        {
            cout <<"Queue under flow\n";
            return;
        }
        if(front == rare)
        {
            front = rare =-1;
            head=NULL;
            return;
        }
        front++;
        head=head->next;
    }

    Queue Delete(Queue q){
        node* temp = head;
        while (head != nullptr){
            head = head->next;
            delete temp;
            temp = head;
        }
        head  = nullptr;
    }

};


main()
{
    Queue q1;
    string x;
    int ch;
    while(true)
    {
        cout<<"1.PUSH\n2.POP\n3.DISPLAY\n4.DELETE\n5.EXIT\nenter Ur choice:\n";
        cin >> ch;

        switch(ch)
        {
        case 1:
            cout <<"plz,enter the name \n";
            cin >> x;
            q1.push(x);
            cout<<"\n";
            break;

        case 2:
            q1.pop();
            break;
        case 3:
            q1.display();
            cout<<"\n";
            break;
        case 4:
            q1.Delete(q1);
            break;
        case 5:
            exit(0);
        default :
            cout<<"error selection.plz,try again\n";
        }
    }
    return (0);
}

Google maps app crashes after phone restart

$
0
0

I made a Google map application and it worked all until I restarted my phone. Every time I try to launch my app it crashes and I don't know why. I think it cant get the location or the map won't create?

public class GoogleMapsActivity extends FragmentActivity implements LocationListener, OnMapReadyCallback{

    private GoogleMap mMap; // Might be null if Google Play services APK is not available.

    private GoogleApiClient mGoogleApiClient;
    private LocationRequest myLocationRequest;
    public static final String TAG = GoogleMapsActivity.class.getSimpleName();

    double latitude2;
    double longitude2;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_google_maps);
        setUpMapIfNeeded();



        // Macht andere GooglePlayServices einfacher zu benutzen
        mGoogleApiClient = new GoogleApiClient.Builder(this)
                .addApi(LocationServices.API)
                .build();

        // Baut das LocationRequest objekt
        myLocationRequest = LocationRequest.create()
                .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)
                .setInterval(10 * 1000)        // 10 seconds, in millisekunden
                .setFastestInterval(1 * 1000); // 1 second, in millisekunden
    }


    @Override
    protected void onResume() {
        super.onResume();
        setUpMapIfNeeded();
    }




    private void setUpMapIfNeeded() {
        // Do a null check to confirm that we have not already instantiated the map.
        if (mMap == null) {
            // Try to obtain the map from the SupportMapFragment.
            mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
                    .getMap();
            // Check if we were successful in obtaining the map.
            if (mMap != null) {
                setUpMap();
            }
        }
    }



    private void setUpMap() {


    }


    private void handleNewLocation(Location location) {

        /*Marker flora = mMap.addMarker(new MarkerOptions()
                .position(florakoords)
                .title("Castle")
                .alpha(0.7f));
      */


        Log.d(TAG, location.toString());


        double currentLatitude = location.getLatitude();
        double currentLongitude = location.getLongitude();

        LatLng latLng = new LatLng(currentLatitude, currentLongitude);

        mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));

        double entfernung = vergleicheDistanz(currentLatitude, currentLongitude, latitude2, longitude2);


        //Rundet Entfernung
        entfernung = Math.round(100.0 * entfernung)/100.0;

        String entfernungString = String.valueOf(entfernung);

       // flora.setSnippet(entfernungString);
       // flora.showInfoWindow();


        if (entfernung <= 200.0){


            new AlertDialog.Builder(this).setMessage("Noch 200 Meter bis zum Auto!").setNeutralButton("ok",null).show();


        }

        else {

            new AlertDialog.Builder(this).setMessage("Über 200 meter bis zum Auto").setNeutralButton("ok",null).show();

        }

    }


    public static float vergleicheDistanz(double latitude, double longitude, double latitude2, double longitude2) {


        Location locationA = new Location("point A");
        locationA.setLatitude(latitude);
        locationA.setLongitude(longitude);

        Location locationB = new Location("point B");
        locationB.setLatitude(latitude2);
        locationB.setLongitude(longitude2);

        float distanz = locationA.distanceTo(locationB);

        return distanz;
    }


    public void getsavedKoords(){


        Bundle extras = getIntent().getExtras();

        String latitude = extras.getString("latitude");

        String longitude = extras.getString("longitude");

        double latitude2 = Double.valueOf(latitude);
        double longitude2 = Double.valueOf(longitude);

        mMap.addMarker(new MarkerOptions().position(new LatLng(latitude2,longitude2)).title("Saved"));

    }


    @Override
    public void onLocationChanged(Location location) {

    }

    @Override
    public void onStatusChanged(String provider, int status, Bundle extras) {

    }

    @Override
    public void onProviderEnabled(String provider) {

    }

    @Override
    public void onProviderDisabled(String provider) {

    }

    @Override
    public void onMapReady(GoogleMap googleMap) {

        // Erlaubt google maps meine Location zu nutzen
        mMap.setMyLocationEnabled(true);

        // Ist dazu da das LocationManager aus getSystemService "importiert" wird wofür LocationManager da ist keine ahnung ...
        LocationManager locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE);


        // Create a criteria object to retrieve provider (Braucht man um später seine Location zu bestimmen)
        Criteria criteria = new Criteria();

        String provider = locationManager.getBestProvider(criteria, true);


        Location location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
        if (location == null) {
            // request location update!!
            locationManager.requestLocationUpdates (LocationManager.GPS_PROVIDER,1000, 0,  this);

        }
        else {

            double lat = location.getLatitude();
            double lon = location.getLongitude();

            LatLng latLng = new LatLng(lat,lon);

            getsavedKoords();


            // Show the current location in Google Map (Zeigt die jetzige Location in einer "animation")
            mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));

            // Zoom in the Google Map (Zoomt zu unserer Position, Erschafft danach einen Marker an unserer Position mit der Nachricht "Du bist hier")
            mMap.animateCamera(CameraUpdateFactory.zoomTo(14));


            // Zoom in the Google Map (Zoomt zu unserer Position, Erschafft danach einen Marker an unserer Position mit der Nachricht "Du bist hier")
            mMap.animateCamera(CameraUpdateFactory.zoomTo(14));
        }


    }
}


My MainActivity 

    public class MainActivity extends ActionBarActivity {

    public String saved = "false";

    private Button ParkMyCar;
    private Button BringMeBackToMyCar;
    private Button DeleteMyCar;


    private SharedPreferences preferences;
    private SharedPreferences.Editor preferencesEditor;

    private static final String SavedKoordsFile = "savedKoords";
    private static final int PREFERENCE_MODE_PRIVATE = 0;

    private SharedPreferences FilepreferencesSetting;
    private SharedPreferences.Editor FilepreferencesEditor;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        ParkMyCar = (Button) findViewById(R.id.ParkMyCar);
        ParkMyCar.setOnClickListener(new View.OnClickListener() {


            @Override


            public void onClick(View ParkMyCar) {

                LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);

                Criteria criteria = new Criteria();

                String provider = locationManager.getBestProvider(criteria, true);

                Location myLocation = locationManager.getLastKnownLocation(provider);

                double lat = myLocation.getLatitude();
                double lon = myLocation.getLongitude();

                String savedlatitude = String.valueOf(lat);
                String savedlongitude = String.valueOf(lon);

                saved = "true";

                FilepreferencesSetting = getSharedPreferences(SavedKoordsFile, PREFERENCE_MODE_PRIVATE);
                FilepreferencesEditor = FilepreferencesSetting.edit();


                // preferencesEditor.putString("latitude",savedlatitude); Schreibt die variable in einen textfile
                FilepreferencesEditor.putString("latitude", savedlatitude);
                FilepreferencesEditor.putString("longitude", savedlongitude);
                FilepreferencesEditor.putString("saved", saved);


                //Speichert dad ganze
                FilepreferencesEditor.commit();

                Intent i = new Intent(MainActivity.this, GoogleMapsActivity.class);
                i.putExtra("latitude", savedlatitude);
                i.putExtra("longitude", savedlongitude);
                startActivity(i);

            }
        });



        BringMeBackToMyCar = (Button) findViewById(R.id.BringMeBackToMyCar);
        BringMeBackToMyCar.setOnClickListener(new View.OnClickListener() {


            @Override


            public void onClick(View v) {

               FilepreferencesSetting = getSharedPreferences(SavedKoordsFile, PREFERENCE_MODE_PRIVATE);


                String LoadedLat = FilepreferencesSetting.getString("latitude","DEFAULT");
                String LoadedLon = FilepreferencesSetting.getString("longitude", "DEFAULT");
                String saved = FilepreferencesSetting.getString("saved", "DEFAULT");

                if (saved == "true") {


                    FilepreferencesSetting = getSharedPreferences(SavedKoordsFile, PREFERENCE_MODE_PRIVATE);
                    FilepreferencesEditor = FilepreferencesSetting.edit();

                    Toast.makeText(getApplicationContext(), LoadedLat + "" + LoadedLon, Toast.LENGTH_LONG).show();


                    FilepreferencesEditor.putString("LoadedLat", LoadedLat);
                    FilepreferencesEditor.putString("LoadedLon", LoadedLon);

                    FilepreferencesEditor.commit();

                    Intent i = new Intent(MainActivity.this, LoadedGoogleMaps.class);
                    i.putExtra("LoadedLat", LoadedLat);
                    i.putExtra("LoadedLon", LoadedLon);

                    startActivity(i);

                }
                else {


                    Toast.makeText(getApplicationContext(), "Keine Position vorhanden!", Toast.LENGTH_SHORT).show();


                }

            }

        });


        DeleteMyCar = (Button)findViewById(R.id.DeleteMyCar);
        DeleteMyCar.setOnClickListener(new View.OnClickListener() {


            @Override


            public void onClick(View v) {


                FilepreferencesSetting = getSharedPreferences(SavedKoordsFile, PREFERENCE_MODE_PRIVATE);
                FilepreferencesEditor = FilepreferencesSetting.edit();

                String saved = FilepreferencesSetting.getString("saved", "DEFAULT");

                if (saved == "true") {

                    FilepreferencesEditor.clear();
                    FilepreferencesEditor.commit();

                    Toast.makeText(getApplicationContext(), "Position gelöscht", Toast.LENGTH_SHORT).show();

                    FilepreferencesSetting = getSharedPreferences(SavedKoordsFile, PREFERENCE_MODE_PRIVATE);
                    FilepreferencesEditor = FilepreferencesSetting.edit();

                    saved = "false";

                    FilepreferencesEditor.putString("saved", saved);

                }

                else{

                Toast.makeText(getApplicationContext(), "Die Position wurde schon gelöscht", Toast.LENGTH_SHORT).show();

                }

                }

        });

    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

}

GPU crashes on gpuArray matrix in Matlab for large array

$
0
0

I am trying to do a simple matrix multiplication using gpuArray in matlab. I am using a NVIDIA GForce 960M GPU with 4GB dedicated memory. The code is given below.

function gpuExample(A, B)
     tic
     C = A*B;    % matrix product on Client
     tC = toc;
     % copy A and B from Client to GPU
     a = gpuArray(A); b = gpuArray(B);
     tic
     c = a*b;    % matrix product on GPU
     tgpu = toc;
     tic
     CC = gather(c);   % copy data from GPU to Client
     tg = toc;

     disp(['Matrix multiply time on Client is ' num2str(tC)])
     disp(['Matrix multiply time on GPU is ' num2str(tgpu)])
     disp(['Time for gathering data from GPU back to Client is '        
            num2str(tg)])

     % Verify that GPU and Client computations agree
     tol = 1e-5;
     if any(abs(CC-C) > tol)
         disp('Matrix product on Client and GPU disagree')
     else
         disp('Matrix product on Client and GPU agree')
     end
end   %

N=4000;
A=rand(N); 
B=rand(N);
gpuExample(A,B)

The code works good for smaller matrix, but when I try with matrix dimension 4000X4000 for both matrix, GPU crashes, so do the Matlab execution.

The GPU output is as follows:

gpuDevice

ans =

CUDADevice with properties:

                  Name: 'GeForce GTX 960M'
                 Index: 1
     ComputeCapability: '5.0'
        SupportsDouble: 1
         DriverVersion: 7.5000
        ToolkitVersion: 7.5000
    MaxThreadsPerBlock: 1024
      MaxShmemPerBlock: 49152
    MaxThreadBlockSize: [1024 1024 64]
           MaxGridSize: [2.1475e+09 65535 65535]
             SIMDWidth: 32
           TotalMemory: 4.2950e+09
   MultiprocessorCount: 5
          ClockRateKHz: 1176000
           ComputeMode: 'Default'
  GPUOverlapsTransfers: 1
KernelExecutionTimeout: 1
      CanMapHostMemory: 1
       DeviceSupported: 1
        DeviceSelected: 1

Here is the crash report:

Warning: An unexpected error occurred during CUDA execution. The CUDA error was: CUDA_ERROR_LAUNCH_FAILED

To me, the GPU should be good enough to multiply two matrixes of size 4000X4000. why it is crashing.

Cordova App for Windows 10 stuck on Splash screen at launch behind a proxy

$
0
0

I have a Cordova app working fine on multiple devices that are connected to internet.

Behavior Observed:

But when I deploy the app on our dev env VM, it just freezes on splash screen. The one peculiar thing I noticed is that every time I launch a browser, it asks me to login to the proxy server. This is because the proxy uses my production credentials to authenticate. The credentials are saved in the browser, I just have to click on OK. I feel that the app is unable to launch as the web view is waiting for a proxy login prompt to be actioned, which is obviously invisible at launch time. The app just sits there until it is closed.

Also, when I run the app in debug mode using VS2017, the index.html file is loaded with just the head tag, no body tag.

All libraries and scripts are referenced locally in the head tab as the app is meant to work offline as well. Sample of head section below.

Configuration:

index.html

<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
    <link rel="stylesheet" href="css/jquery-ui.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="scripts/datepicker/bootstrap-datetimepicker.min.css">
    <link rel="stylesheet" href="scripts/daterangepicker/daterangepicker.css">
    <link rel="stylesheet" href="scripts/timepicker/bootstrap-timepicker.min.css">
    <link rel="stylesheet" href="scripts/easyautocomplete/easy-autocomplete.css">
    <link href="scripts/growl/jquery.growl.css" rel="stylesheet" type="text/css" />
    <link href="scripts/jquery-confirm/jquery-confirm.min.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="css/SHMOStyles.css" />
    <link rel="stylesheet" href="css/ripple.min.css">
    <script type="text/javascript" src="scripts/jquery-2.2.3.min.js"></script>
    <script type="text/javascript" src="scripts/jquery-ui.min.js"></script>
    <script type="text/javascript" src="scripts/bootstrap.min.js"></script>
    <script type="text/javascript" src="scripts/fastclick.js"></script>
    <script type="text/javascript" src="mapapi.js"></script>
    <script type="text/javascript" src="scripts/index.js"></script>
    <script type="text/javascript" src="scripts/jquery.dataTables.min.js"></script>
    <script type="text/javascript" src="scripts/dataTables.bootstrap.min.js"></script>
    <script type="text/javascript" src="scripts/hammer.min.js"></script>

I use some plugins in config.xml, but there is no problem with any of them as I run them in production env or any device connected straight to the internet. In production, it uses same credentials for computer logon and proxy, so I do not get the login prompt like I do in Dev env.

config.xml

<vs:platformSpecificValues>
    <vs:platformSpecificWidget platformName="windows" id="SIMSMobileV0" />
  </vs:platformSpecificValues>
  <plugin name="cordova-plugin-fastclick" spec="~1.0.0" />
  <plugin name="cordova-plugin-file-opener2" spec="~2.0.19" />
  <plugin name="cordova-sqlite-storage" spec="~2.3.1" />
  <plugin name="cordova-plugin-camera" spec="~2.4.1" />
  <plugin name="cordova-plugin-device" spec="~2.0.2" />
  <plugin name="cordova-plugin-network-information" spec="~2.0.1" />
  <plugin name="cordova-plugin-splashscreen" spec="~5.0.2" />
  <plugin name="cordova-plugin-file" spec="~6.0.1" />
  <plugin name="cordova-plugin-zeep" spec="~0.0.4" />
  <plugin name="cordova-plugin-file" spec="~6.0.1" />
  <plugin name="cordova-plugin-geolocation" spec="~4.0.1" />
  <plugin name="cordova-plugin-insomnia" spec="~4.3.0" />

Things I tried:

  1. Override proxy settings on the windows 10 VM, still leads to prompt coming up

  2. Save credentials in Windows/Generic credentials for proxy host, no luck

  3. Added proxy configuration to npm, git, gradle, etc. Did not work

The question is, how to resolve this situation so:

  1. the proxy login prompt appears in the app? I did some research, it looks like cordova apps dont support this. But, keen to see if this can be done.
  2. Add a module to the app to manage this behavior if it detects no connectivity
  3. Somehow setup a persistent proxy globally without installing any software or without connecting to a VPN

If you have any other suggestions / solutions, they are most welcome. Any help can be greatly appreciated.


when i press dot button i want that dot button press only one time in input 1?

$
0
0
package com.deitel.calculator;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    double input1 = 0, input2 = 0d ,count=0;
    Button btn0, btn1, btn2, btn3, btn4, btn5, btn6, btn7, btn8, btn9, btn_dot, btn_equal, btn_subtract, btn_multi, btn_add, btn_devision, btn_clear, btn_back;
    TextView text_result;
    boolean Addition, Subtraction, Multiplication, Devision, decimal;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        btn0 = findViewById(R.id.btn0);
        btn1 = findViewById(R.id.btn1);
        btn2 = findViewById(R.id.btn2);
        btn3 = findViewById(R.id.btn3);
        btn4 = findViewById(R.id.btn4);
        btn5 = findViewById(R.id.btn5);
        btn6 = findViewById(R.id.btn6);
        btn7 = findViewById(R.id.btn7);
        btn8 = findViewById(R.id.btn8);
        btn9 = findViewById(R.id.btn9);
        btn_dot = findViewById(R.id.btn_dot);
        btn_equal = findViewById(R.id.btn_equal);
        btn_add = findViewById(R.id.btn_add);
        btn_subtract = findViewById(R.id.btn_subtract);
        btn_multi = findViewById(R.id.btn_multi);
        btn_devision = findViewById(R.id.btn_devision);
        btn_clear = findViewById(R.id.btn_clear);
        btn_back = findViewById(R.id.btn_back);
        text_result = findViewById(R.id.text_result);

        btn0.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                text_result.setText(text_result.getText() + "0");
            }
        });

        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                text_result.setText(text_result.getText() + "1");

            }
        });

        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                text_result.setText(text_result.getText() + "2");
            }
        });

        btn3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                text_result.setText(text_result.getText() + "3");
            }
        });
        btn4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                text_result.setText(text_result.getText() + "4");
            }
        });
        btn5.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                text_result.setText(text_result.getText() + "5");
            }
        });
        btn6.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                text_result.setText(text_result.getText() + "6");
            }
        });
        btn7.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                text_result.setText(text_result.getText() + "7");
            }
        });
        btn8.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                text_result.setText(text_result.getText() + "8");
            }
        });
        btn9.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                text_result.setText(text_result.getText() + "9");
            }
        });
        btn_add.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (text_result.getText().length() != 0) {
                    input1 = Float.parseFloat(text_result.getText() + "");
                    Addition = true;
                    decimal = false;
                    text_result.setText(null);
                }
            }
        });
        btn_subtract.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View view) {

                if (text_result.getText().length() != 0) {
                    input1 = Float.parseFloat(text_result.getText() + "");
                    Subtraction = true;
                    decimal = false;
                    text_result.setText(null);
                }

            }
        });

        btn_multi.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                if (text_result.getText().length() != 0) {
                    input1 = Float.parseFloat(text_result.getText() + "");
                    Multiplication = true;
                    decimal = false;
                    text_result.setText(null);
                }


            }
        });

        btn_devision.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                if (text_result.getText().length() != 0) {
                    input1 = Float.parseFloat(text_result.getText() + "");
                    Devision = true;
                    decimal = false;
                    text_result.setText(null);

                }

            }
        });
        btn_clear.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                text_result.setText("");
                input1 = 0.0;
                input1 = 0.0;
            }

        });
        btn_dot.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

                if(count==0){
                    count=1;
                        text_result.setText(text_result.getText()+".");
                        return;
                    }
                else{
                        text_result.setText(text_result.getText()+"0.");
                        decimal=true;
                    }
            }
        });
        btn_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                String number = text_result.getText().toString();
                int input = number.length();
                if (input > 0) {
                    text_result.setText(number.substring(0, input - 1));
                }
            }
        });

        btn_equal.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                count=0;
                if ((Addition || Subtraction || Multiplication || Devision) ) {
                    if (text_result.getText().toString().trim().equals("")){
                   input2=0;
                    return;

                    }else {
                        input2 = Float.parseFloat(text_result.getText() + "");
                    }

                }
                if (Addition) {
                    text_result.setText(input1 + input2 + "");
                    Addition = false;
                }

                if (Subtraction) {
                    text_result.setText(input1 - input2 + "");
                    Subtraction = false;
                }
                if (Multiplication) {
                    text_result.setText(input1 * input2 + "");
                    Multiplication = false;
                }
                if (Devision) {
                    text_result.setText(input1 / input2 + "");
                    Devision = false;
                }

            }
        });


    }
}

When I press dot button I want that dot button press only one time in input 1 like:2.5+3.7 etc. But this code doesn't meet that requirements - it displays 2.3.4.5 etc..but I want only one dot in one input. When I press dot button I want that dot button press only one time in input 1 like:2.5+3.7 etc.

Xcode - But... Where are our archives?

$
0
0

I've submitted three versions of my app onto the App Store using the Build and Archive commands. But... Where are those archives?

I've just learnt that I just need them to be able to read crashlogs. My ~/Library/Developer/Xcode/Archives folder is empty (in fact there is one xarchive file inside it I've just generated now to test a crashlog reading).

Spotlight does not find any .xarchive.

I never been asked to delete or clear anything else than my project builds (Product - clean) when coding next version.

Qt application segv at libgnome

$
0
0

I have two servers, RHEL6.5 and 6.8. My project files are located in a separate disk and I have access from both of the servers. The project (Qt application) was compiled in RHEL 6.8. Here is the problem:

  1. login RHEL6.5 machine from RHEL6.8 via ssh and start the program, I works fine
  2. start the program directly from RHEL6.5, it segvs at:

    [bt]: (1) /lib64/libpthread.so.0[0x3bdf20f7e0]

    [bt]: (2) /lib64/libc.so.6[0x3bde729540]

    [bt]: (3) /usr/lib64/libxml2.so.2 (__xmlParserInputBufferCreateFilename) +0x135 [0x3be865e465]

    [bt]: (4) /usr/lib64/libxml2.so.2 (xmlNewTextReaderFilename) +0x25 [0x3be86e2585]

    [bt]: (5) /usr/lib64/libgnomevfs-2.so.0[0x3064629755]

    [bt]: (6) /usr/lib64/libgnomevfs-2.so.0 (gnome_vfs_mime_get_value) +0xcd [0x3064629d0d]

    [bt]: (7) /usr/lib64/libgnomeui-2.so.0 (gnome_icon_lookup) +0x2c3 [0x3d61e61c53]

    [bt]: (8) /usr/lib64/libgnomeui-2.so.0 (gnome_icon_lookup_sync) +0x7d [0x3d61e621ed]

Have any idea the diffrence and why the segv happens? BTW, Qt is linked statically.

How to prevent OneLogin Protect android app v4.3.0 from crashing?

$
0
0

DISCLAIMER

I'm opening this Q&A because:

  • I've tried contacting OneLogin through Twitter without success
  • I can't fill a bug without a Developer Account (which I don't want)
  • They clearly state in their site to ask on Stackoverflow when seeing weird errors:

    enter image description here

THE PROBLEM

In my company, we're using the OneLogin Protect as 2FA (OTP) device for accessing a partner VPN.

On December 10, 2019, OneLogin released the version 4.3.0 of its app, which our smartphones automatically updated from the previous 4.1.0, which was fully working.

The 4.3.0 app crashes when starting, with a miserable NPE:

enter image description here

THE ATTEMPTS AND THE QUESTIONS

I've reinstalled it, reinstalled the previous version (which got updated again), disabled the automatic updates (which is not something I'm happy about), but this is so fragile, so I'm asking:

  • Is this happening to us only, or it's a huge production bug?
  • Is there any way to fix it?
  • Are you guys at OneLogin aware of this? Are you working on it? Have you a release date for a patched version?

Hint: the problem is in the Kotlin file Utils.kt, row 42. Sanitize the input, for God sake

edittext setSelection is crashing the app when accessibility talkback is turned on

$
0
0

I have an edittext for date and it automatically adds a slash for the date. To do so, I have a text change listener with this code in it.

if (currentTextLength == 2 || currentTextLength == 5) {
   editText.setText("$s/")
   editText.setSelection(editText.text.length)
}

setSelection places the cursor at the end of the text but it is taking the value as Spannable(if you look at its implementation) which will crash when Accessibility talkback is turned on. Is there a way to place the cursor at the end of the edittext without using setSelection? I tried append but it is not placing the cursor at the end.

The crash exception is IndexOutOfBoundException caused by Spannable when accessibility talkback is on.

Thanks in advanced.

Viewing all 7161 articles
Browse latest View live


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