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

Crash when SVG is used as small Icon for notification

$
0
0

I've set a small icon to my notificaton builder using

NotificationCompat.Builder builder = new NotificationCompat.Builder(mContext)
.setSmallIcon(R.drawable.location_off_24dp);

location_off_24dp is actually a SVG file in my project.

Issue is that I get crash with this code on pre-lollipop devices.

Crash report:

  android.app.RemoteServiceException: Bad notification posted from package com.com.example.app: Couldn't create icon: StatusBarIcon(pkg=com.example.app.clientuser=0 id=0x7f02010e level=0 visible=true num=0 ) 
                                                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1410) 
                                                  at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                  at android.os.Looper.loop(Looper.java:136) 
                                                  at android.app.ActivityThread.main(ActivityThread.java:5426) 
                                                  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:1268) 
                                                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) 
                                                  at dalvik.system.NativeStart.main(Native Method) 

I know we can use app:srcCompat="@drawable/vector_file" in the layouts. But when we pass the SVG drawable resource ID to PendingIntent, will the system use something of srcCompat kind of version so it could apply to pre-lollipop too or it expects drawable to be a direct image ?

How do I use SVG as small Icon in Notification for pre-lollipop devices?


Java 9.0.1 OpenJdk crashed the JVM with problem with AdaptiveWeightedAverage

$
0
0

My application failed for a customer crashing the JVM

I have these details:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xb6b48b12, pid=31447, tid=31508
#
# JRE version: OpenJDK Runtime Environment (9.0+11) (build 9.0.1+11)
# Java VM: OpenJDK Client VM (9.0.1+11, mixed mode, serial gc, linux-)
# Problematic frame:
# V  [libjvm.so+0x1d9b12]  AdaptiveWeightedAverage::sample(float)+0x55
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /mnt/system/config/Apps/SongKong/songkong/hs_err_pid31447.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#

Does it look familar to anyone, I have search both https://bugs.java.com/bugdatabase/ and https://bugs.openjdk.java.net/secure/Dashboard.jspa without finding anything.

Here is the start of the hs_err_id log file

    #
    # A fatal error has been detected by the Java Runtime Environment:
    #
    #  SIGSEGV (0xb) at pc=0xb6aacb12, pid=13032, tid=13074
    #
    # JRE version: OpenJDK Runtime Environment (9.0+11) (build 9.0.1+11)
    # Java VM: OpenJDK Client VM (9.0.1+11, mixed mode, serial gc, linux-)
    # Problematic frame:
    # V  [libjvm.so+0x1d9b12]  AdaptiveWeightedAverage::sample(float)+0x55
    #
    # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
    #
    # If you would like to submit a bug report, please visit:
    #   http://bugreport.java.com/bugreport/crash.jsp
    #

    ---------------  S U M M A R Y ------------

    Command Line: -Duser.home=/mnt/disk1/share -Xms150m -Xmx900m -Dcom.mchange.v2.log.MLog=com.mchange.v2.log.jdk14logging.Jdk14MLog -Dorg.jboss.logging.provider=jdk -Djava.util.logging.config.class=com.jthink.songkong.logging.StandardLogging --add-opens=java.base/java.lang=ALL-UNNAMED lib/songkong-6.8.jar -r

    Host: Marvell PJ4Bv7 Processor rev 1 (v7l), 1 cores, 1G, Buildroot 2014.11-rc1
    Time: Fri Feb  7 01:50:35 2020 GMT elapsed time: 53621 seconds (0d 14h 53m 41s)

    ---------------  T H R E A D  ---------------

    Current thread (0xb6657d00):  VMThread "VM Thread" [stack: 0x7b7e9000,0x7b869000] [id=13074]

    Stack: [0x7b7e9000,0x7b869000],  sp=0x7b8677a0,  free space=505k
    Native frames: (J=compiled Java code, A=aot compiled Java code, j=interpreted, Vv=VM code, C=native code)
    V  [libjvm.so+0x1d9b12]  AdaptiveWeightedAverage::sample(float)+0x55

    [error occurred during error reporting (printing native stack), id 0xb]


    siginfo: si_signo: 11 (SIGSEGV), si_code: 1 (SEGV_MAPERR), si_addr: 0x0000000a

    Register to memory mapping:

      r0  = 0x00000000
    0x00000000 is an unknown value

      r1  = 0x00000100
    0x00000100 is an unknown value

      r2  = 0x000001fc
    0x000001fc is an unknown value

      r3  = 0x00000023
    0x00000023 is an unknown value

      r4  = 0x783bf970
    0x783bf970 is an unknown value

      r5  = 0x00000000
    0x00000000 is an unknown value

      r6  = 0x0e6a0000
    0x0e6a0000 is an unknown value

      r7  = 0x00000000
    0x00000000 is an unknown value

      r8  = 0x783bf940
    0x783bf940 is an unknown value

      r9  = 0x0e6a0000
    0x0e6a0000 is an unknown value

      r10 = 0x7b8679ec
    0x7b8679ec is an unknown value

      fp  = 0xb6657c38
    0xb6657c38 is an unknown value

      r12 = 0xfffffefe
    0xfffffefe is an unknown value

      sp  = 0x7b8677a0
    0x7b8677a0 is an unknown value

      lr  = 0xb6c62daf
    0xb6c62daf: <offset 0x0038fdaf> in /mnt/system/config/Apps/SongKong/songkong/jre/lib/client/libjvm.so at 0xb68d3000

      pc  = 0xb6aacb12
    0xb6aacb12: <offset 0x001d9b12> in /mnt/system/config/Apps/SongKong/songkong/jre/lib/client/libjvm.so at 0xb68d3000



    Registers:
      r0  = 0x00000000
      r1  = 0x00000100
      r2  = 0x000001fc
      r3  = 0x00000023
      r4  = 0x783bf970
      r5  = 0x00000000
      r6  = 0x0e6a0000
      r7  = 0x00000000
      r8  = 0x783bf940
      r9  = 0x0e6a0000
      r10 = 0x7b8679ec
      fp  = 0xb6657c38
      r12 = 0xfffffefe
      sp  = 0x7b8677a0
      lr  = 0xb6c62daf
      pc  = 0xb6aacb12
      cpsr = 0x80000030

    Top of Stack: (sp=0x7b8677a0)
    0x7b8677a0:   00000000 404e0000 00000001 000b6448
    0x7b8677b0:   7b8677b8 b6c62daf b6d4c8b8 783bf910
    0x7b8677c0:   00000000 b660d800 7b867808 b6d1f000
    0x7b8677d0:   b662f310 b6c62f43 7b8679f6 b6cac9cc
    0x7b8677e0:   7b8677f0 b6d1f000 7b8679ec b6b1d987
    0x7b8677f0:   7b867820 7b8679f0 7b867800 b6a068a3
    0x7b867800:   00000400 7b867820 00000000 00000012
    0x7b867810:   b660d800 00000000 00000012 b660d800 

    Instructions: (pc=0xb6aacb12)
    0xb6aacaf2:   ee064603 eeb83a10 ee377a46 ee286ac7
    0xb6aacb02:   ee667a07 ee876a86 eec67a27 ee777aa7
    0xb6aacb12:   edc47a87 46bd7a00 8b02ecbd 2064bd98
    0xb6aacb22:   f9e1f1fd 6a00edd4 0000e7db 480642c8 

    VM_Operation (0x77c5daa0): GenCollectForAllocation, mode: safepoint, requested by thread 0x77a0d790


    ---------------  P R O C E S S  ---------------

    Java Threads: ( => current thread )
      0x742a7448 JavaThread "Thread-513" daemon [_thread_blocked, id=11706, stack(0x76a70000,0x76ac0000)]
      0x73db7458 JavaThread "Thread-510" daemon [_thread_blocked, id=11027, stack(0x773b6000,0x77406000)]
      0x732b66f0 JavaThread "Thread-509" daemon [_thread_blocked, id=10757, stack(0x77b70000,0x77bc0000)]
      0x762428e0 JavaThread "Thread-508" daemon [_thread_blocked, id=10130, stack(0x79310000,0x79360000)]
      0x74284f48 JavaThread "Thread-503" daemon [_thread_blocked, id=8094, stack(0x78210000,0x78260000)]
      0x76d60e10 JavaThread "qtp9318356-11036" [_thread_blocked, id=4101, stack(0x78410000,0x78460000)]
      0x762dc8f0 JavaThread "qtp9318356-11035" [_thread_blocked, id=4100, stack(0x79bc0000,0x79c10000)]
      0x783bf910 JavaThread "qtp9318356-9925" [_thread_blocked, id=22685, stack(0x78260000,0x782b0000)]
      0x732170a8 JavaThread "qtp9318356-5567" [_thread_blocked, id=9426, stack(0x76810000,0x76860000)]
      0x760e2708 JavaThread "qtp9318356-5564" [_thread_blocked, id=9423, stack(0x768b0000,0x76900000)]
      0x77a0d790 JavaThread "Worker:12" [_thread_blocked, id=18002, stack(0x77c10000,0x77c60000)]
      0x77a0daf0 JavaThread "pool-1639-thread-1" [_thread_blocked, id=17984, stack(0x77186000,0x771d6000)]
      0x76db5e88 JavaThread "Worker:11" [_thread_blocked, id=17983, stack(0x77316000,0x77366000)]
      0x783c9df8 JavaThread "Worker:10" [_thread_blocked, id=17982, stack(0x77406000,0x77456000)]
      0x77a25388 JavaThread "SongLoaderWorker:9" [_thread_blocked, id=17942, stack(0x77366000,0x773b6000)]
      0x76d6bce8 JavaThread "com.jthink.songkong.server.callback.ServerFixSongs:8" [_thread_blocked, id=17922, stack(0x793b0000,0x79400000)]
      0x769c7cb8 JavaThread "pool-1636-thread-2" [_thread_blocked, id=17764, stack(0x77276000,0x772c6000)]
      0x732c50d8 JavaThread "pool-1636-thread-1" [_thread_blocked, id=17763, stack(0x77036000,0x77086000)]
      0x7690e140 JavaThread "pool-1601-thread-2" [_thread_blocked, id=11810, stack(0x771d6000,0x77226000)]
      0x769077c8 JavaThread "pool-1601-thread-1" [_thread_blocked, id=11809, stack(0x77226000,0x77276000)]
      0x769368a8 JavaThread "MappedByteBufferSource Async Flush Thread" daemon [_thread_blocked, id=8920, stack(0x76fe6000,0x77036000)]
      0x77d9d990 JavaThread "com.jthink.songkong.fileloader.LoadFolderWorker:3" [_thread_blocked, id=380, stack(0x77eb0000,0x77f00000)]
      0x77d940d8 JavaThread "pool-429-thread-1" [_thread_blocked, id=374, stack(0x77e60000,0x77eb0000)]
      0x77d9c740 JavaThread "SongLoaderCountFiles:2" [_thread_blocked, id=373, stack(0x77cb0000,0x77d00000)]
      0x7b670218 JavaThread "qtp9318356-91" [_thread_blocked, id=32431, stack(0x79360000,0x793b0000)]
      0x7833f418 JavaThread "qtp9318356-90" [_thread_in_native, id=32430, stack(0x79db0000,0x79e00000)]
      0x7b6e7478 JavaThread "MVStore background writer async:/mnt/disk1/share/SongKong/Prefs/Database/Database.mv.db" daemon [_thread_blocked, id=27227, stack(0x79270000,0x792c0000)]
      0x7b670cf8 JavaThread "H2 File Lock Watchdog (Socket) async:/mnt/disk1/share/SongKong/Prefs/Database/Database.lock.db" daemon [_thread_blocked, id=27222, stack(0x7a61c000,0x7a66c000)]
      0x7b694750 JavaThread "Scheduler-7136558" [_thread_blocked, id=13763, stack(0x78560000,0x785b0000)]
      0x7b6786c0 JavaThread "Scheduler-14033461" [_thread_blocked, id=13428, stack(0x785b0000,0x78600000)]
      0x7b6717d8 JavaThread "qtp9318356-45-acceptor-0@4cfe9c-ServerConnector@8b18a5{HTTP/1.1,[http/1.1]}{0.0.0.0:4567}" [_thread_in_native, id=13427, stack(0x7904c000,0x7909c000)]
      0x789c3e20 JavaThread "Thread-10" [_thread_blocked, id=13405, stack(0x791d0000,0x79220000)]
      0x7a0b4f10 JavaThread "C3P0PooledConnectionPoolManager[identityToken->1hge13oa8796in41o2hlgl|1df6bb7]-HelperThread-#2" daemon [_thread_blocked, id=13275, stack(0x7a66c000,0x7a6bc000)]
      0x7a0b4958 JavaThread "C3P0PooledConnectionPoolManager[identityToken->1hge13oa8796in41o2hlgl|1df6bb7]-HelperThread-#1" daemon [_thread_blocked, id=13274, stack(0x79b70000,0x79bc0000)]
      0x7a0b43c0 JavaThread "C3P0PooledConnectionPoolManager[identityToken->1hge13oa8796in41o2hlgl|1df6bb7]-HelperThread-#0" daemon [_thread_blocked, id=13273, stack(0x79920000,0x79970000)]
      0x7a0feb80 JavaThread "C3P0PooledConnectionPoolManager[identityToken->1hge13oa8796in41o2hlgl|1df6bb7]-AdminTaskTimer" daemon [_thread_blocked, id=13272, stack(0x79c10000,0x79c60000)]
      0x7adb1358 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=13146, stack(0x7a7e3000,0x7a833000)]
      0xb66f12d8 JavaThread "Service Thread" daemon [_thread_blocked, id=13114, stack(0x7b2b6000,0x7b306000)]
      0xb66a1a20 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=13105, stack(0x7b306000,0x7b356000)]
      0xb6675c88 JavaThread "Sweeper thread" daemon [_thread_blocked, id=13104, stack(0x7b356000,0x7b3a6000)]
      0xb6674978 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=13103, stack(0x7b3a6000,0x7b426000)]
      0xb666cdc8 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=13102, stack(0x7b426000,0x7b476000)]
      0xb6667688 JavaThread "Finalizer" daemon [_thread_blocked, id=13099, stack(0x7b748000,0x7b798000)]
      0xb665a900 JavaThread "Reference Handler" daemon [_thread_blocked, id=13088, stack(0x7b798000,0x7b7e8000)]
      0xb6609308 JavaThread "main" [_thread_blocked, id=13037, stack(0xb67d9000,0xb6828000)]

    Other Threads:
    =>0xb6657d00 VMThread "VM Thread" [stack: 0x7b7e9000,0x7b869000] [id=13074]
      0xb66f2a90 WatcherThread [stack: 0x7b236000,0x7b2b6000] [id=13115]

    Threads with active compile tasks:

VM state:at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread:  ([mutex/lock_event])
[0xb6608520] Threads_lock - owner thread: 0xb6657d00
[0xb6608930] Heap_lock - owner thread: 0x77a0d790

Heap:
 def new generation   total 265600K, used 265599K [0x7c000000, 0x8e020000, 0x8ec00000)
  eden space 236160K, 100% used [0x7c000000, 0x8a6a0000, 0x8a6a0000)
  from space 29440K,  99% used [0x8c360000, 0x8e01fff8, 0x8e020000)
  to   space 29440K,   0% used [0x8a6a0000, 0x8a6a0000, 0x8c360000)
 tenured generation   total 589672K, used 298477K [0x8ec00000, 0xb2bda000, 0xb4400000)
   the space 589672K,  50% used [0x8ec00000, 0xa0f7b5c0, 0xa0f7b600, 0xb2bda000)
 Metaspace       used 45545K, capacity 46775K, committed 46976K, reserved 47408K

Card table byte_map: [0x7be3d000,0x7c000000] byte_map_base: 0x7ba5d000

Polling page: 0xb6f30000

Android app crashes on launch due to constrain layout

$
0
0

I try to run my app but I keep getting this error:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.nachum.pap/com.example.nachum.pap.MainMap}: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.constraint.ConstraintLayout

I implemented Constraint Layout as instructed but it didn't help

my xml:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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"
    android:background="@android:color/white"
    tools:context=".MainMap">

    <android.support.constraint.ConstraintLayout
        android:layout_width="@dimen/map_width"
        android:layout_height="@dimen/map_height"
        android:layout_marginEnd="8dp"
        android:layout_marginRight="8dp"
        android:background="@drawable/menu_map"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">


        <!--
            The function "go to map" that activates in the onClick goes to the google maps activity and exists in MainMap java file
            The tag helps discern where on the map should the maps activity open.
        -->
        <Button
            android:id="@+id/MaalotButton"
            style="@android:style/Widget.Holo.Light.Button.Borderless.Small"
            android:layout_width="32dp"
            android:layout_height="10dp"
            android:layout_marginLeft="96dp"
            android:layout_marginTop="28dp"
            android:onClick="goToMap" android:tag="0"
            android:text="@string/PaPMaalot"
            android:textSize="8sp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <Button
            android:id="@+id/ShderotButton"
            style="@android:style/Widget.Holo.Light.Button.Borderless.Small"
            android:layout_width="32dp"
            android:layout_height="10dp"
            android:layout_marginTop="24dp"
            android:layout_marginRight="10dp"
            android:onClick="goToMap" android:tag="1"
            android:text="@string/PaPShderot"
            android:textSize="8sp"
            app:layout_constraintRight_toRightOf="@+id/AshdodButton"
            app:layout_constraintTop_toBottomOf="@+id/AshdodButton" />

        <Button
            android:id="@+id/KfarVardimButton"
            style="@android:style/Widget.Holo.Light.Button.Borderless.Small"
            android:layout_width="46dp"
            android:layout_height="10dp"
            android:layout_marginRight="6dp"
            android:onClick="goToMap" android:tag="2"
            android:text="@string/PaPKfarVradim"
            android:textSize="8sp"
            app:layout_constraintRight_toRightOf="@+id/MaalotButton"
            app:layout_constraintTop_toBottomOf="@+id/MaalotButton" />

        <Button
            android:id="@+id/TalElButton"
            style="@android:style/Widget.Holo.Light.Button.Borderless.Small"
            android:layout_width="32dp"
            android:layout_height="10dp"
            android:layout_marginRight="8dp"
            android:onClick="goToMap" android:tag="3"
            android:text="@string/PaPTalEl"
            android:textSize="8sp"
            app:layout_constraintRight_toRightOf="@+id/KfarVardimButton"
            app:layout_constraintTop_toBottomOf="@+id/KfarVardimButton" />

        <Button
            android:id="@+id/CholonButton"
            style="@android:style/Widget.Holo.Light.Button.Borderless.Small"
            android:layout_width="32dp"
            android:layout_height="10dp"
            android:layout_marginTop="110dp"
            android:layout_marginRight="12dp"
            android:onClick="goToMap" android:tag="4"
            android:text="@string/PaPCholon"
            android:textSize="8sp"
            app:layout_constraintRight_toLeftOf="@+id/TalElButton"
            app:layout_constraintTop_toBottomOf="@+id/TalElButton" />

        <Button
            android:id="@+id/AshdodButton"
            style="@android:style/Widget.Holo.Light.Button.Borderless.Small"
            android:layout_width="32dp"
            android:layout_height="10dp"
            android:layout_marginTop="18dp"
            android:layout_marginRight="14dp"
            android:onClick="goToMap" android:tag="5"
            android:text="@string/PaPAshdod"
            android:textSize="8sp"
            app:layout_constraintRight_toRightOf="@+id/CholonButton"
            app:layout_constraintTop_toBottomOf="@+id/CholonButton" />

        <Button
            android:id="@+id/TfachotButton"
            style="@android:style/Widget.Holo.Light.Button.Borderless.Small"
            android:layout_width="32dp"
            android:layout_height="10dp"
            android:layout_marginTop="7dp"
            android:layout_marginRight="8dp"
            android:onClick="goToMap" android:tag="6"
            android:text="@string/PaPTfachot"
            android:textSize="8sp"
            app:layout_constraintRight_toRightOf="@+id/BarYochayButton7"
            app:layout_constraintTop_toBottomOf="@+id/BarYochayButton7" />

        <Button
            android:id="@+id/DaltonButton"
            style="@android:style/Widget.Holo.Light.Button.Borderless.Small"
            android:layout_width="32dp"
            android:layout_height="10dp"
            android:layout_marginLeft="8dp"
            android:onClick="goToMap" android:tag="7"
            android:text="@string/PaPDalton"
            android:textSize="8sp"
            app:layout_constraintLeft_toRightOf="@+id/MaalotButton"
            app:layout_constraintTop_toTopOf="@+id/MaalotButton" />

        <Button
            android:id="@+id/BarYochayButton7"
            style="@android:style/Widget.Holo.Light.Button.Borderless.Small"
            android:layout_width="38dp"
            android:layout_height="10dp"
            android:layout_marginTop="7dp"
            android:layout_marginRight="8dp"
            android:onClick="goToMap" android:tag="8"
            android:text="@string/PaPBarYochay"
            android:textSize="8sp"
            app:layout_constraintRight_toRightOf="@+id/DaltonButton"
            app:layout_constraintTop_toBottomOf="@+id/DaltonButton" />
    </android.support.constraint.ConstraintLayout>

</android.support.constraint.ConstraintLayout>

java:

package com.example.nachum.pap;

import android.content.Intent;
import android.view.View;
import android.os.Bundle;
import android.widget.EditText;

import androidx.appcompat.app.AppCompatActivity;

public class MainMap extends AppCompatActivity {



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

    /** Called when the user taps the Send button */
    public void goToMap(View view) {
        Intent intent = new Intent(this, NAVDRAW.class);
        intent.putExtra("num", view.getTag().toString());
        startActivity(intent);
    }


}

logcat:

07-15 06:13:44.064 20107-20107/? I/art: Late-enabling -Xcheck:jni
07-15 06:13:44.604 20107-20107/com.example.nachum.pap W/FirebaseApp: Default FirebaseApp failed to initialize because no default options were found. This usually means that com.google.gms:google-services was not applied to your gradle project.
07-15 06:13:44.604 20107-20107/com.example.nachum.pap I/FirebaseInitProvider: FirebaseApp initialization unsuccessful
07-15 06:13:44.634 20107-20107/com.example.nachum.pap I/InstantRun: starting instant run server: is main process
07-15 06:13:44.804 20107-20107/com.example.nachum.pap D/ContextHelper: convertTheme. context->name=com.example.nachum.pap themeResourceId=2131689478
07-15 06:13:44.874 20107-20107/com.example.nachum.pap W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
07-15 06:13:44.944 20107-20107/com.example.nachum.pap D/PhoneWindow: [updateColorViews] sysUiVisibility=0x0
07-15 06:13:44.944 20107-20107/com.example.nachum.pap D/PhoneWindow: [updateColorViews] sysUiVisibility=0x0
07-15 06:13:44.944 20107-20107/com.example.nachum.pap D/PhoneWindow: [updateColorViews] sysUiVisibility=0x0
07-15 06:13:44.944 20107-20107/com.example.nachum.pap D/PhoneWindow: [updateColorViews] sysUiVisibility=0x0
07-15 06:13:44.944 20107-20107/com.example.nachum.pap I/PhoneWindow: [generateLayout] setColorNavigationBar => color=0x ff000001
07-15 06:13:44.944 20107-20107/com.example.nachum.pap D/PhoneWindow: [updateColorViews] sysUiVisibility=0x0
07-15 06:13:45.004 20107-20107/com.example.nachum.pap D/PhoneWindow: [updateColorViews] sysUiVisibility=0x0
07-15 06:13:45.004 20107-20107/com.example.nachum.pap D/PhoneWindowEx: [PWEx][generateLayout] setNavigationBarColor2 : colors=0xff000000
07-15 06:13:45.004 20107-20107/com.example.nachum.pap I/PhoneWindow: [setNavigationBarColor2] color=0x ff000000
07-15 06:13:45.004 20107-20107/com.example.nachum.pap D/PhoneWindow: [updateColorViews] sysUiVisibility=0x0
07-15 06:13:45.004 20107-20107/com.example.nachum.pap D/PhoneWindow: [updateColorViews] sysUiVisibility=0x0
07-15 06:13:45.054 20107-20107/com.example.nachum.pap I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>
07-15 06:13:45.054 20107-20107/com.example.nachum.pap I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>
07-15 06:13:45.214 20107-20107/com.example.nachum.pap D/AndroidRuntime: Shutting down VM
07-15 06:13:45.214 20107-20107/com.example.nachum.pap E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.nachum.pap, PID: 20107
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.nachum.pap/com.example.nachum.pap.MainMap}: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.constraint.ConstraintLayout
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2306)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2366)
        at android.app.ActivityThread.access$800(ActivityThread.java:149)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5297)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703)
     Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.constraint.ConstraintLayout
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:757)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:482)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
        at com.example.nachum.pap.MainMap.onCreate(MainMap.java:17)
        at android.app.Activity.performCreate(Activity.java:6020)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2259)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2366) 
        at android.app.ActivityThread.access$800(ActivityThread.java:149) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.app.ActivityThread.main(ActivityThread.java:5297) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703) 
     Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.constraint.ConstraintLayout" on path: DexPathList[[zip file "/data/app/com.example.nachum.pap-1/base.apk", zip file "/data/app/com.example.nachum.pap-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.nachum.pap-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.nachum.pap-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.nachum.pap-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.nachum.pap-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.nachum.pap-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.nachum.pap-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.nachum.pap-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.nachum.pap-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.nachum.pap-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.nachum.pap-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
        at android.view.LayoutInflater.createView(LayoutInflater.java:571)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:482) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) 
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
        at com.example.nachum.pap.MainMap.onCreate(MainMap.java:17) 
        at android.app.Activity.performCreate(Activity.java:6020) 
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2259) 
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2366) 
        at android.app.ActivityThread.access$800(ActivityThread.java:149) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1284) 
        at android.os.Handler.dispatchMessage(Handler.java:102) 
        at android.os.Looper.loop(Looper.java:135) 
        at android.app.ActivityThread.main(ActivityThread.java:5297) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at java.lang.reflect.Method.invoke(Method.java:372) 
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:908) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:703) 
        Suppressed: java.lang.ClassNotFoundException: android.support.constraint.ConstraintLayout
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                ... 22 more
     Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

EDIT: app gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.example.nachum.pap"
        minSdkVersion 15
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:support-compat:28.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'com.android.support:design:28.1.0'
    implementation 'com.google.firebase:firebase-database:18.0.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

project level gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
        maven { url "https://maven.google.com/"}
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Flutter app crashs and restart from splash screen when using camera function

$
0
0

I want to click an image and send it to the server. the code works well if we are using gallery function but fails to work when it is swap by camera function.

I am able to open the camera, click the image and after this select if correct or wrong.

after this step the app crash. Next to this step, image needs to be sent to the cropping screen.

here is the code:

Future getImage() async {
    // var image = await ImagePicker.pickImage(source: ImageSource.gallery);
      var _image = await ImagePicker.pickImage(source: ImageSource.camera);
      croppedFile = await ImageCropper.cropImage(
      sourcePath: _image.path,
      aspectRatioPresets: [
        CropAspectRatioPreset.square,
        CropAspectRatioPreset.ratio3x2,
        CropAspectRatioPreset.original,
        CropAspectRatioPreset.ratio4x3,
        CropAspectRatioPreset.ratio16x9
      ],
      androidUiSettings: AndroidUiSettings(
          toolbarTitle: 'Cropper',
          toolbarColor: Colors.deepOrange,
          toolbarWidgetColor: Colors.white,
          initAspectRatio: CropAspectRatioPreset.square,
          lockAspectRatio: false),
      iosUiSettings: IOSUiSettings(
        minimumAspectRatio: 1.0,
      )
    );
    if (_pickInProgress) {
        return;
    }
      _pickInProgress = true;
      if (_image != null) {
        setState(() {
          _newAvatar = croppedFile;
        });
      }
      _pickInProgress = false;
  }

in Android Studio I have the bellow log when filter is used with keyword flutter:

2020-02-19 17:51:48.404 10631-10631/in.x.demo D/FlutterActivity: Using the launch theme as normal theme.
2020-02-19 17:51:48.413 10631-10631/in.x.demo D/FlutterActivityAndFragmentDelegate: Setting up FlutterEngine.
2020-02-19 17:51:48.413 10631-10631/in.x.demo D/FlutterActivityAndFragmentDelegate: No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
2020-02-19 17:51:48.795 10631-10701/in.x.demo I/flutter: Observatory listening on http://127.0.0.1:38436/ayKKbiBs2ts=/
2020-02-19 17:51:49.031 10631-10631/in.x.demo D/FlutterActivityAndFragmentDelegate: Attaching FlutterEngine to the Activity that owns this Fragment.
2020-02-19 17:51:49.112 10631-10631/in.x.demo D/FlutterView: Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@178fa3d
2020-02-19 17:51:49.142 10631-10631/in.x.demo D/FlutterActivityAndFragmentDelegate: Executing Dart entrypoint: main, and sending initial route: /
2020-02-19 17:51:51.013 10631-10673/in.x.demo E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The method 'contains' was called on null.
    Receiver: null
    Tried calling: contains("access_token")
    #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
    #1      _SplashScreenState.didChangeDependencies (package:demo/screens/common/splash_screen.dart:58:28)
    #2      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:73:64)
    #3      _rootRunUnary (dart:async/zone.dart:1134:38)
    #4      _CustomZone.runUnary (dart:async/zone.dart:1031:19)
    #5      _FutureListener.handleValue (dart:async/future_impl.dart:139:18)
    #6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:680:45)
    #7      Future._propagateToListeners (dart:async/future_impl.dart:709:32)
    #8      Future._propagateToListeners (dart:async/future_impl.dart:607:9)
    #9      Future._completeWithValue (dart:async/future_impl.dart:524:5)
    #10     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:554:7)
    #11     _rootRun (dart:async/zone.dart:1126:13)
    #12     _CustomZone.run (dart:async/zone.dart:1023:19)
    #13     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
    #14     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
    #15     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
    #16     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)
2020-02-19 17:51:51.015 10631-10673/in.x.demo I/flutter: genesis started
2020-02-19 17:51:51.106 10631-10673/in.x.demo I/flutter: device ID: ee44d5897844a106
2020-02-19 17:51:52.078 10631-10673/in.x.demo I/flutter: genesis final completed
2020-02-19 17:51:52.102 10631-10673/in.x.demo I/flutter: genesis api called !
2020-02-19 17:51:52.102 10631-10673/in.x.demo I/flutter: hasToken true
2020-02-19 17:51:53.085 10631-10673/in.x.demo E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The method 'findAncestorStateOfType' was called on null.
    Receiver: null
    Tried calling: findAncestorStateOfType<NavigatorState>()
    #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
    #1      Navigator.of (package:flutter/src/widgets/navigator.dart:1492:19)
    #2      _SplashScreenState.didChangeDependencies.<anonymous closure> (package:demo/screens/common/splash_screen.dart:54:23)
    #3      new Future.delayed.<anonymous closure> (dart:async/future.dart:316:39)
    #4      _rootRun (dart:async/zone.dart:1122:38)
    #5      _CustomZone.run (dart:async/zone.dart:1023:19)
    #6      _CustomZone.runGuarded (dart:async/zone.dart:925:7)
    #7      _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
    #8      _rootRun (dart:async/zone.dart:1126:13)
    #9      _CustomZone.run (dart:async/zone.dart:1023:19)
    #10     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:949:23)
    #11     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:23:15)
    #12     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:384:19)
    #13     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:418:5)
    #14     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)


`

System crashing dual boot win 10 Ubuntu 18.04 [closed]

$
0
0

Ubuntu crash output

Both on Ubuntu and windows, my computer will come to a grinding hault and throw errors. It happens randomly. Ram is good and hard drive checks don't show immediate problems. Happens plugged in and unplugged (laptop)... Any ideas?

Unexpected turning off monitors after pluging to pycharm laptop

$
0
0

During work in Pycharm i have monitors issue. When I launch them, laptop crush and monitors turning off. Do you know what's going on? Any ideas?

Terminated due to signal 13 in swift iOS

$
0
0

My app got crashed with Terminated due to signal 13 error while i am running it.

App is getting crashed during this method execution.

@objc func handlePipeNotification(notification: Notification)
{
    inputPipe.fileHandleForReading.readInBackgroundAndNotify()
    if let data = notification.userInfo![NSFileHandleNotificationDataItem] as? Data,
        let str = String(data: data, encoding: String.Encoding.ascii) {
        outputPipe.fileHandleForWriting.write(data)
    }
}

Above method calls every time when something print on debug window.

If I remove this line than there is no issue.

outputPipe.fileHandleForWriting.write(data)

This line is writing back data to debug window.

Help me to solve this error.

Program Crash C++ [closed]

$
0
0

I have tried writing a program which idetifies Euler's indicator for numbers lower than a variable DIM. It keeps crashing. I think one of the arrays is the problem. I have tried to tweak my code in numerous ways, but to no avail. Here is my code:

#include <iostream>
#include <fstream>
using namespace std;
int main()
{
    ifstream fin("tramvaie.in");
    ofstream fout("tramvaie.out");
    int t,i,j,n=2,y,DIM=0;
    int x;
    bool ok;
    fin>>t;
    int q[t+1];
    for(i=1; i<=t; i++)
    {
        fin>>x;
        q[i]=x;
        if(x>DIM)
            DIM=x;
    }
    DIM=1000007;
    int F[DIM + 1];
    for(int i =1 ; i <= DIM ; i ++)
        F[i] = i;
    for(int i = 2;  i <= DIM ; i ++)
    {
        if(F[i] == i)
        {
            F[i] --;
            for(int j =2 ; j * i <= DIM ; j ++)
                F[j * i]= F[j * i] / i * (i - 1);
        }
    }
    for(i=1;i<=t;i++)
    {
        fout<<F[q[i]]<<"";
    }
    return 0;
}


Swift app crashes when I call method from dependecy project (framework)

$
0
0

I'm trying to create a modular architecture in my project but I came across a very strange error.

I have a project called Application and another called Core.

In "Application" I have a storyboard that has a HomeViewController which imports Core.

In the ViewDidLoad of HomeViewController I have a custom button called btnLater of type RGButton which is declared inside of the Core project.

Xcode's Autocomplete recognizes the public methods when I type "self.btnLater." or "RGButton."

RGButton class on Core proejct:

public class RGButton: UIButton {

// corner radius
public func borderRadius(radius : CGFloat) {
    self.layer.cornerRadius = radius
}
...

HomeViewController ViewDidLoad() on Application project

...
self.btnLater.layer.cornerRadius = 4
self.btnLater.borderRadius(radius: 4.0)
...

So when I run the project... on the line

self.btnLater.layer.cornerRadius = 4

there is no crash... But on the line

self.btnLater.borderRadius(radius: 4.0)

it crashes with the following error:

Thread 1: EXC_BAD_ACCESS (code=257, address=0x1a258656e61)

I fear that some project configuration may be causing this.. but I need some light to help me figure out what the aliens are doing to my project...

Thanks in advance!

Flutter URL launcher Google Maps crashes App

$
0
0

A couple of days ago launching both Google Maps and Apple Maps perfectly fine. I updated Flutter to its newest Version while on master channel to 1.13.1. I assume after updating it stopped working. So I changed channels to beta and tried, but still not working. When trying to launch Google Maps or Apple Maps the IOS app crashes and I neither understand the error nor did I find something on the internet.

Any help is much appreciated.

My UI code:


ListTile(
                 title: Text("Launch Google Maps", textAlign: TextAlign.center),
                  onTap: () async {
                    final String clubName =
                        clubs[index].name.toString().replaceAll("", "+");
                    print("Name: $clubName"); // 'Flawless+Club'
                    final String clubCity = clubs[index].stadt;
                    print("Name: $clubCity"); // 'London'
                    final String newGoogleUrl =
                        "https://www.google.com/maps/dir/?api=1&destination=$clubName+$clubCity";

                    if (await canLaunch(newGoogleUrl)) {
                      await launch(newGoogleUrl);
                    } else {
                      throw 'Could not launch $newGoogleUrl';
                    }
                  },
                ),

Flutter doctor -v Ouput:

[✓] Flutter (Channel beta, v1.12.13+hotfix.3, on Mac OS X 10.15.1 19B88, locale en-DE)
    • Flutter version 1.12.13+hotfix.3 at /Library/Flutter
    • Framework revision 57f2df76d7 (2 days ago), 2019-12-05 21:23:21 -0800
    • Engine revision ac9391978e
    • Dart version 2.7.0


[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/murat/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.2.1, Build version 11B500
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.4)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 35.3.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[✓] VS Code (version 1.40.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.7.0

[✓] Connected device (1 available)

• No issues found!

Error when tapping the ListTile:

Lost connection to device.
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff23c4f02e __exceptionPreprocess + 350
    1   libobjc.A.dylib                     0x00007fff50b97b20 objc_exception_throw + 48
    2   Foundation                          0x00007fff2578c55b -[__NSConcreteURLComponents initWithString:] + 0
    3   CoreServices                        0x00007fff24e970bd -[_LSURLOverride initWithOriginalURL:checkingForAvailableApplications:newsOnly:] + 151
    4   CoreServices                        0x00007fff24e97992 -[_LSURLOverride initWithOriginalURL:newsOnly:] + 25
    5   CoreServices                        0x00007fff24e982ae _ZN14LaunchServices12URLOverridesL20getURLOverrideCommonEP5NSURLb + 399
    6   CoreServices                        0x00007fff24e9810e -[LSApplicationWorkspace(LSURLOverride) URLOverrideForURL:] + 14
    7   UIKitCore<…>
Exited (sigterm)

XCode always crash when click on configurations settings

$
0
0

I tried to solve the error below:

"...Pods-Scanner.debug.xcconfig: unable to open file (in target "Scanner" in project "Scanner")"

However, when I try to click on those setting, it always crashed. screenshot

or is there anyway to set those configurations without click those buttons ? Thanks.

Not able to launch app after adding build flavours

$
0
0
I am using android build flavours in react-native application. The app crashes immediately after launch. Below is the build.gradle file 

    flavorDimensions "default"
    productFlavors {
        prod {           
            buildConfigField "String", "BASE_URL", "abc.com"
        }
        dev {
            buildConfigField "String", "BASE_URL", "abc-dev.com"          
        }
    }

The logs shown after app crash is: enter image description here

The Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference [duplicate]

$
0
0

I try to use a fragment to network call on a Button Click Listener, however, when I click the button to begin network, it will work But When I Double Click Button (Fastly) the program unexpectedly terminates and it shows the error like this:

enter image description here

AVPlayerItem externalMetadata unrecognized selector

$
0
0

This piece of code is crashing on iOS 12 with unrecognised selector exception:

[AVPlayerItem externalMetadata]: unrecognized selector sent to instance

However, this code is not crashing on iOS 13.

Apple documentation states that AVPlayerItem has externalMetadata getter and setter since iOS 12.


    let item = AVPlayerItem(url: videoURL)

    let mutableMetadataItem = AVMutableMetadataItem()
    mutableMetadataItem.identifier = AVMetadataIdentifier.commonIdentifierDescription
    mutableMetadataItem.value = 1
    item.externalMetadata.append(mutableMetadataItem)

Could you please help me to understand why is that happening?

How to catch a Swift crash and do some logging

$
0
0

In Objective-C, the NSSetUncaughtExceptionHandler can register some functionality to do some last minute logging about the exception.

This doesn't catch something crashing from Swift.

Is it possible to do something like this at a global level in Swift? E.g. do some logging if a crash happens in Swift code, like forced unwrapping a nil optional.

Specifically, I'm doing a utility to log network traffic in the app, and I would like to flush my in-memory data to disk if a crash happens.


app crashes immediately without giving any information in the debug

$
0
0

I am trying to run search Function in app and it crashes immediately without giving any information

my mvvm code

var userSearch = _apiServices.SearchEmailansPasswordUserAsync(Email , Password,accesstoken);

my Data Services

        public async Task<data.UserT> SearchEmailansPasswordUserAsync(string email, string pasword, string accessToken)
        {
            RestClient<data.UserT> restClient = new RestClient<data.UserT>();
            var userInformation = await restClient.SearchEmailandPasswordUser(email, pasword, accessToken);
            return userInformation;

        }

my rest Client code

public async Task<T> SearchEmailandPasswordUser(string email, string pasword, string accessToken)
        {
            var httpClient = new HttpClient();
            httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);                    
                var json = await httpClient.GetStringAsync(publicUrl + "api/UserCredentials/email=" + email + "/pasword=" + pasword);//code crashes her 
            var taskModels = JsonConvert.DeserializeObject<T>(json);
                return taskModels;                                                   
        }

this is my user Controller in api

 [HttpGet]        
        [Route("api/UserCredentials/email={email}/pasword={pasword}")]
        public async Task<IHttpActionResult> SearchUseremail(string email ,string pasword)
        {

            UserT login = await db.UserTs.Where(x => x.Email == email && x.Password == pasword).SingleOrDefaultAsync();

            if (login == null)
            {
                return NotFound();
            }
            return Ok(login);
        } 

**the line of code that crash **

var json = await httpClient.GetStringAsync(publicUrl + "api/UserCredentials/email=" + email + "/pasword=" + pasword);//code crashes her

I hope any one can help my

Android app stops after pull-to-refresh action

$
0
0

I got the following problem: I'm making an android webview app using fragments, and I want to implement a SwipeToRefresh action.

I tried to do it, but the app stops immediately after user's pull-to-refresh action. Here are different codes:

fragment_home.xml :

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/holo_red_light">

<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
    android:id="@+id/sr"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <WebView
        android:id="@+id/webviewhome"
        android:layout_width="match_parent"
        android:layout_height="match_parent"></WebView>

</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>

</RelativeLayout>    

HomeFragment.java public class HomeFragment extends Fragment {

public HomeFragment(){
    // Required
}

private SwipeRefreshLayout mRefreshLayout;
private WebView mWebView;

@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

    View v = inflater.inflate(R.layout.fragment_home, container, false);
    mRefreshLayout = (SwipeRefreshLayout) v.findViewById(R.id.sr);
    mRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            mWebView.reload();
            mRefreshLayout.setRefreshing(false);
        }
    });
    final WebView webView = (WebView) v.findViewById(R.id.webviewhome);
    webView.getSettings().setJavaScriptEnabled(true);
    webView.getSettings().setAppCacheEnabled(true);
    webView.loadUrl("MYURL");
    webView.setWebViewClient(new WebViewClient());
    webView.canGoBack();

    webView.setOnKeyListener(new View.OnKeyListener() {
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            if (keyCode == KeyEvent.KEYCODE_BACK
                    && event.getAction() == MotionEvent.ACTION_UP
                    && webView.canGoBack()) {
                webView.goBack();
                return true;
            }
            return false;
        }
    });

    webView.setWebViewClient(new WebViewClient() {
        public void onReceivedError(WebView webView, int errorCode, String description, String failingUrl) {
            try {
                webView.stopLoading();
            } catch (Exception e) {
            }

            if (webView.canGoBack()) {
                webView.goBack();
            }

            webView.loadUrl("about:blank");
            AlertDialog alertDialog = new AlertDialog.Builder(getContext()).create();
            alertDialog.setTitle("Erreur !");
            alertDialog.setMessage("Veuillez vérifier votre connexion internet et réessayer");
            alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, "Réessayer", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int which) {
                    getActivity().finish();
                    startActivity(getActivity().getIntent());
                }
            });

            alertDialog.show();
            super.onReceivedError(webView, errorCode, description, failingUrl);
        }
    });

    return v;
}    

Can you help me please?

Why does my VBA code crash when cycling through workbooks with links?

$
0
0

The code below is intended to update a specific link (the B2 ref) for all Excel files in a given folder (the B1 ref). There's an additional condition that it will only save the file down if the number of errors is the same before and afterwards.

However, when I run this it crashes Excel without any indication of why:

Sub UpdateLinksWS()

    Application.ScreenUpdating = False

    Dim locWS, locWB As String
    Dim wb, ThisWB As Workbook
    Dim oFSO, oFolder, oFiles, oFile As Object
    Dim noErrors, i, j As Integer
    Dim Links As Variant

    'Access the file location with VBA objects
    locWS = Worksheets("Sheet").Range("B1").Value
    Set oFSO = CreateObject("Scripting.FileSystemObject")
    Set oFolder = oFSO.GetFolder(locWS)
    Set oFiles = oFolder.Files
    i = 0
    Set ThisWB = ThisWorkbook

    'For each file in the path ...
    For Each oFile In oFiles
        'Set the pathname
        locWB = locWS & oFile.Name
        Set wb = Workbooks.Open(locWB)

        'Counts the number of errors in the workbook before updates
        noErrors = ErrorCount(wb)

        'Update links and calculate workbook - first checking the link to update or update all links
        If ThisWB.Worksheets("Sheet").Range("B2").Value = "" Then
            wb.UpdateLink Type:=xlExcelLinks
        Else
            'Check if the sheet is actually there
            Links = wb.LinkSources(xlExcelLinks) 'getLinks(wb)
            If Links <> Empty Then
                For j = 1 To UBound(Links)
                    If Links(j) = ThisWB.Worksheets("Sheet").Range("B2").Value Then
                        wb.UpdateLink Name:=Worksheets("Sheet").Range("B2").Value, Type:=xlExcelLinks
                    End If
                Next j
            End If
        End If
        Application.CalculateFull


        'If there's a different number of errors after the updates, close, list the workbook in Errors and don't save, otherwise save
        If ErrorCount(wb) = noErrors Then
        'Exit and save the changes
            Workbooks(oFile.Name).Close SaveChanges:=True
        Else
            Worksheets("Errors").Cells(2 + i, 2).Value = wb.Name
            Workbooks(oFile.Name).Close SaveChanges:=False
            i = i + 1
        End If
    Next

    Application.ScreenUpdating = True

End Sub


Function ErrorCount(ByVal wb As Workbook) As Integer
    Dim nbErrors As Integer
    Dim ws As Worksheet

    nbErrors = 0

    For Each ws In wb.Worksheets
        On Error GoTo NoErrs
        nbErrors = nbErrors + ws.Cells.SpecialCells(xlCellTypeFormulas, xlErrors).Count
    Next

    ErrorCount = nbErrors

NoErrs:
    Resume Next

End Function

Any ideas are appreciated. Thanks in advance.

App crash while creating input pipe in Swift iOS

$
0
0

My app got crash with error Terminated due to signal 13.

I am creating input pipe and on that line app got crash with above reason.

 public func openConsolePipe() {

        inputPipe = Pipe()

        outputPipe = Pipe()
        let pipeReadHandle = inputPipe.fileHandleForReading

        dup2(STDOUT_FILENO, outputPipe.fileHandleForWriting.fileDescriptor)
        dup2(STDERR_FILENO, outputPipe.fileHandleForWriting.fileDescriptor)

        dup2(inputPipe.fileHandleForWriting.fileDescriptor, STDOUT_FILENO)
        dup2(inputPipe.fileHandleForWriting.fileDescriptor, STDERR_FILENO)

        NotificationCenter.default.addObserver(self, selector: #selector(self.handlePipeNotification), name: FileHandle.readCompletionNotification, object: pipeReadHandle)

        pipeReadHandle.readInBackgroundAndNotify()
}

I am following This Link for implement this.

Now above tutorial working fine in regular project.

But I am creating framework of this demo and use it another app code.

At that time app got crash on Line.

dup2(inputPipe.fileHandleForWriting.fileDescriptor, STDERR_FILENO)

This is below method in that I am getting all logs from pipe.

@objc func handlePipeNotification(notification: Notification)
{
        inputPipe.fileHandleForReading.readInBackgroundAndNotify()

        if let data = notification.userInfo![NSFileHandleNotificationDataItem] as? Data,
        let str = String(data: data, encoding: String.Encoding.ascii) {

            outputPipe.fileHandleForWriting.write(data)
        }
}

GoogleMaps SDK crashing app after modularization of project

$
0
0

I have a working project with GoogleMaps in it that works fine. I made a copy of that project to make the project modular and now I get an EXC_BAD_ACCESS error when I try to open the map.

here is my pod configuration:

def shared_pods
    ...
end

def application_pods
    ...
    pod 'GoogleMaps'#, :modular_headers => true
    pod 'GooglePlaces', :modular_headers => true
end


def core_application_pods
...
    pod 'GooglePlaces', :modular_headers => true
end


target 'Application' do

  project 'Application/Application.xcodeproj'

  # Pods for Application

  shared_pods
  application_pods

  target 'ApplicationTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'ApplicationUITests' do
    # Pods for testing
  end
end

target 'Core' do

    project 'Core/Core.xcodeproj'

    # Pods for Core

    shared_pods
    core_application_pods

    target 'CoreTests' do
      inherit! :search_paths
      # Pods for testing
    end
end

I even tried putting both pods in shared_pods, enable/disable modular_headers and there is no difference in the outcome.

Here is some of the code which creates the UIGMapsView object. The object is created successfully and Maps delegates are fired before the crash..

final fileprivate func setupMapViewConstraints() {
        if self.mapView == nil {
            let mapView = UIGMapsView(frame: CGRect(x: 0, y: 0, width: 0, height: 0))
            mapView.gmapDelegate = self
            mapView.translatesAutoresizingMaskIntoConstraints = false
            mapView.settings.myLocationButton = false
            self.mapView = mapView
        }

        if let mapView = self.mapView {

            self.view.addSubview(mapView)
                self.view.sendSubviewToBack(mapView)

            let views : [String: UIView] = ["mapView": mapView]
            let vertical = NSLayoutConstraint.constraints(withVisualFormat: "V:|[mapView]|", options: [], metrics: nil, views: views)
            let horizontal = NSLayoutConstraint.constraints(withVisualFormat: "H:|[mapView]|", options: [], metrics: nil, views: views)

            NSLayoutConstraint.activate(vertical + horizontal)

            autoreleasepool {
                mapView.startMonitoringLocation()
                mapView.backToMyPosition()
            }
        }
    }

The screen opens up and about 1 second in that screen the crash appears. (I can even see the blue dot in the middle of the map but the map is all grey...)

I even tried enabling Zombie to try to catch whats is causing this but not much of help there too... here is the screenshot:

crash screenshot

Does anyone know what might be causing this crash?

Thanks in advance!

Viewing all 7196 articles
Browse latest View live


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