4.4.2を搭載したNexus10でアプリを実行しようとすると、致命的なシグナル6(SIGABRT)エラーが発生します。
Nexus 7(2)と4.4.2を含め、試した他のすべてのデバイスで動作します
コードの最初にブレークポイントとログを配置しようとしたので(以下を参照)、コードに問題はないと思いますが、ブレークポイントとログは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();
}
私がインストールしたライブラリは次のとおりです。
これは私が私の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)
この場合、それは私に起こります:
ビューはいつかnullになる可能性があります!!!
onCreateにロードするすべてのビューを検索し、次のように記述します。
if(view!=null){
//DO Whatever
}else{
Log.e(TAG,"Android BUG");
}
編集:関数が非常に高速に呼び出されたためではないことに気付きました。リスナーがあり、OnDestroy()のときに登録を解除しなかったためです。そして、OnCreateの場合、リスナーが2つありました。 NULLの結果ともう1つはOKです。
@Override
public void onDestroy() {
super.onDestroy();
if (mSensorManager!=null){mSensorManager.unregisterListener(listener);}
}
これが誰かに役立つことを願っています:)