web-dev-qa-db-fra.com

Signal fatal 6 (SIGABRT) code = -6 au premier lancement

Je reçois une erreur de signal fatal 6 (SIGABRT) en essayant d'exécuter mon application sur un Nexus 10 avec 4.4.2.

Cela fonctionne sur tous les autres appareils que j'ai essayés, y compris mon Nexus 7 (4.4) avec 4.4.2

Je ne pense pas que ce soit un problème avec le code car j'ai essayé de mettre des points d'arrêt et des journaux au tout début de mon code (voir ci-dessous), mais cela ne semble pas aller aussi loin car il ne s'arrêtera pas au point d'arrêt et le log n'apparaît pas dans le logcat.

package com.immediate.imcreader;

import Android.app.Activity;
import Android.app.Fragment;
import Android.app.FragmentManager;
import Android.content.Intent;
import Android.graphics.Bitmap;
import Android.graphics.BitmapFactory;
import Android.graphics.Color;
import Android.os.Bundle;
import Android.support.v13.app.FragmentPagerAdapter;
import Android.util.Log;
import Android.util.TypedValue;
import Android.view.MenuItem;
import Android.view.View;
import Android.view.animation.AlphaAnimation;
import Android.view.animation.Animation;
import Android.widget.ImageView;
import Android.widget.LinearLayout;
import Android.widget.PopupMenu;
import Android.widget.RelativeLayout;
import Android.widget.TextView;

import com.google.analytics.tracking.Android.EasyTracker;
import com.immediate.imcreader.data.Issue;
import com.immediate.imcreader.data.OrmLiteCarouselMediaDAO;
import com.immediate.imcreader.data.OrmLiteDataCaptureFormDataDAO;
import com.immediate.imcreader.data.OrmLiteIssueDAO;
import com.immediate.imcreader.data.OrmLiteIssueScreenshotsDAO;
import com.immediate.imcreader.data.OrmLitePreferenceDAO;
import com.immediate.imcreader.data.OrmLitePurchasedReceiptDAO;
import com.immediate.imcreader.data.OrmLiteSubscriptionDAO;
import com.immediate.imcreader.purchasing.PurchaseFinishedListener;
import com.immediate.imcreader.purchasing.StoreUtilities;
import com.immediate.imcreader.renderer.RendererActivity;
import com.immediate.imcreader.storefront.AllIssuesFragment;
import com.immediate.imcreader.storefront.DataCapture;
import com.immediate.imcreader.storefront.ErrorFeedbackHandler;
import com.immediate.imcreader.storefront.MoreFromUsFragment;
import com.immediate.imcreader.storefront.NonSwipeableViewPager;
import com.immediate.imcreader.storefront.SimpleWebView;
import com.immediate.imcreader.storefront.SubscribeFragment;
import com.immediate.imcreader.tasks.DownloadJsonTask;
import com.immediate.imcreader.util.FileHelper;
import com.immediate.imcreader.util.JsonCallbackInterface;
import com.immediate.imcreader.util.SupportUtilities;

import Java.util.Locale;

/**
 * Entry point
 * Just launches the AllIssues activity at the minute
 * @author scottdouglass
 */
public class MainActivity extends Activity implements PurchaseFinishedListener, JsonCallbackInterface {

    public static final String TAG = "IMCReader";

    public static final int SUBSCRIBE_TAB = 0;
    public static final int ISSUES_TAB = 1;
    public static final int MORETITLES_TAB = 2;

    SectionsPagerAdapter mSectionsPagerAdapter;
    NonSwipeableViewPager mViewPager;

    private StoreUtilities storeUtilities;
    private Boolean buildAppStoreFront = false;
    private Boolean getProductDetails = false;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.v(TAG, "onCreate started");
        initSplashScreen();
        setTheme(R.style.AppTheme);
        if (getActionBar() != null) {
            getActionBar().hide();
        }

Les bibliothèques que j'ai installées sont:

  • Android-support-v13.jar
  • achat in-app-1.0.3.jar
  • libGoogleAnalyticsServices.jar
  • ormlite-Android-4.47.jar
  • omrlite-core-4.45.jar 
  • picasso-2.1.1.jar 
  • urbanairship-lib-3.3.0.jar

C'est ce que je retrouve dans mon logcat:

05-08 12:57:35.956  13079-13079/com.immediate.imcreader W/dalvikvm﹕ JNI WARNING: NewStringUTF input is not valid Modified UTF-8: illegal start byte 0xff
05-08 12:57:35.956  13079-13079/com.immediate.imcreader W/dalvikvm﹕ string: 'en_Latn_US_�_GB'
05-08 12:57:35.956  13079-13079/com.immediate.imcreader W/dalvikvm﹕ in Llibcore/icu/ICU;.addLikelySubtags:(Ljava/lang/String;)Ljava/lang/String; (NewStringUTF)
05-08 12:57:35.961  13079-13079/com.immediate.imcreader I/dalvikvm﹕ "main" prio=5 tid=1 NATIVE
05-08 12:57:35.961  13079-13079/com.immediate.imcreader I/dalvikvm﹕ | group="main" sCount=0 dsCount=0 obj=0x41567ca8 self=0x414a1408
05-08 12:57:35.961  13079-13079/com.immediate.imcreader I/dalvikvm﹕ | sysTid=13079 Nice=0 sched=0/0 cgrp=apps handle=1074114900
05-08 12:57:35.961  13079-13079/com.immediate.imcreader I/dalvikvm﹕ | state=R schedstat=( 15667415 6358417 55 ) utm=1 stm=0 core=1
05-08 12:57:35.981  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #00  pc 000012f6  /system/lib/libcorkscrew.so (unwind_backtrace_thread+29)
05-08 12:57:35.986  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #01  pc 00060576  /system/lib/libdvm.so (dvmDumpNativeStack(DebugOutputTarget const*, int)+33)
05-08 12:57:35.986  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #02  pc 00054578  /system/lib/libdvm.so (dvmDumpThreadEx(DebugOutputTarget const*, Thread*, bool)+395)
05-08 12:57:35.986  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #03  pc 000545e6  /system/lib/libdvm.so (dvmDumpThread(Thread*, bool)+25)
05-08 12:57:35.986  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #04  pc 00038770  /system/lib/libdvm.so
05-08 12:57:35.986  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #05  pc 00039ba8  /system/lib/libdvm.so
05-08 12:57:35.986  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #06  pc 0003bf7a  /system/lib/libdvm.so
05-08 12:57:35.986  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #07  pc 000143da  /system/lib/libjavacore.so
05-08 12:57:35.986  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #08  pc 00014bbe  /system/lib/libjavacore.so
05-08 12:57:35.986  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #09  pc 0001db4c  /system/lib/libdvm.so (dvmPlatformInvoke+112)
05-08 12:57:35.986  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #10  pc 0004e082  /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const*, JValue*, Method const*, Thread*)+397)
05-08 12:57:35.986  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #11  pc 00026f60  /system/lib/libdvm.so
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #12  pc 0002df78  /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #13  pc 0002b5dc  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #14  pc 00060788  /system/lib/libdvm.so (dvmInvokeMethod(Object*, Method const*, ArrayObject*, ArrayObject*, ClassObject*, bool)+391)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #15  pc 000686f6  /system/lib/libdvm.so
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #16  pc 00026f60  /system/lib/libdvm.so
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #17  pc 0002df78  /system/lib/libdvm.so (dvmMterpStd(Thread*)+76)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #18  pc 0002b5dc  /system/lib/libdvm.so (dvmInterpret(Thread*, Method const*, JValue*)+184)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #19  pc 000604a4  /system/lib/libdvm.so (dvmCallMethodV(Thread*, Method const*, Object*, bool, JValue*, std::__va_list)+335)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #20  pc 00049c6a  /system/lib/libdvm.so
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #21  pc 0004cd34  /system/lib/libandroid_runtime.so
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #22  pc 0004da5a  /system/lib/libandroid_runtime.so (Android::AndroidRuntime::start(char const*, char const*)+353)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #23  pc 0000105a  /system/bin/app_process
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ #24  pc 0000e3e4  /system/lib/libc.so (__libc_init+47)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at libcore.icu.ICU.addLikelySubtags(Native Method)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.text.TextUtils.getLayoutDirectionFromLocale(TextUtils.Java:1740)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.content.res.Configuration.setLayoutDirection(Configuration.Java:1295)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.content.res.Configuration.updateFrom(Configuration.Java:820)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.content.res.Resources.updateConfiguration(Resources.Java:1557)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.content.res.Resources.updateConfiguration(Resources.Java:1511)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.content.res.Resources.<init>(Resources.Java:202)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.app.ResourcesManager.getTopLevelResources(ResourcesManager.Java:199)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.app.ActivityThread.getTopLevelResources(ActivityThread.Java:1534)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.app.LoadedApk.getResources(LoadedApk.Java:488)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.app.ContextImpl.init(ContextImpl.Java:2025)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.app.ContextImpl.init(ContextImpl.Java:2004)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.app.ActivityThread.handleBindApplication(ActivityThread.Java:4166)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.app.ActivityThread.access$1500(ActivityThread.Java:135)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.app.ActivityThread$H.handleMessage(ActivityThread.Java:1256)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.os.Handler.dispatchMessage(Handler.Java:102)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.os.Looper.loop(Looper.Java:136)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Android.app.ActivityThread.main(ActivityThread.Java:5017)
05-08 12:57:35.991  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Java.lang.reflect.Method.invokeNative(Native Method)
05-08 12:57:35.996  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at Java.lang.reflect.Method.invoke(Method.Java:515)
05-08 12:57:35.996  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at com.Android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.Java:779)
05-08 12:57:35.996  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at com.Android.internal.os.ZygoteInit.main(ZygoteInit.Java:595)
05-08 12:57:35.996  13079-13079/com.immediate.imcreader I/dalvikvm﹕ at dalvik.system.NativeStart.main(Native Method)
05-08 12:57:35.996  13079-13079/com.immediate.imcreader I/dalvikvm﹕ [ 05-08 12:57:35.996 13079:13079 E/dalvikvm ]
    VM aborting
05-08 12:57:35.996  13079-13079/com.immediate.imcreader A/libc﹕ Fatal signal 6 (SIGABRT) at 0x00003317 (code=-6), thread 13079 (diate.imcreader)
18
danieltnbaker

... un peu tard pour la fête, mais je me suis retrouvé dans une situation similaire en ajoutant le support KitKat à l'une de nos anciennes applications 3.x.

Apparemment, il existe un bogue Android lié au codage UTF.

Ce post nous a conduit dans la bonne direction et ici est la question.

1
CountZachula

Cela m'arrive dans ce cas:

  • Je charge une vue onCreate et après, une fonction est appelée très rapidement et l'accès à cette vue.

La vue peut être nulle en un instant !!!

recherchez toutes les vues que vous avez chargées dans OnCreate et écrivez ceci:

if(view!=null){
   //DO Whatever
}else{
   Log.e(TAG,"Android BUG");
}

EDIT: J'ai réalisé que ce n'était pas parce que la fonction a appelé très rapidement. C'est parce que j'ai un auditeur et que je ne me suis pas désinscrit quand OnDestroy (). Et quand OnCreate, j'ai eu deux auditeur. Un résultat NULL et l'autre OK.

@Override
public void onDestroy() {                       
    super.onDestroy();
    if (mSensorManager!=null){mSensorManager.unregisterListener(listener);}
}

J'espère que cela aide quelqu'un :)

1
toni