私はアンドロイド開発の一種です。なぜ私のアプリがクラッシュし続けているのか分かりませんが、gradleはエラーを表示しませんが、logcatには多くの例外があります。そして、正直言って、私はlogcatの詳細のほとんどを理解していません。私は空白のアクティビティしか作成せず、アプリケーションはクラッシュし続けます。 logcatはいくつかの致命的な除外を示しています
アプリのクラッシュを停止するにはどうすればよいですか?何がクラッシュする原因になっていますか? これは、logcatの詳細です:
10-25 11:56:32.870 3126-3126/? I/art: Not late-enabling -Xcheck:jni (already on)
10-25 11:56:32.870 3126-3126/? I/art: Late-enabling JIT
10-25 11:56:32.896 3126-3126/? I/art: JIT created with code_cache_capacity=2MB compile_threshold=1000
10-25 11:56:33.050 3126-3133/? I/art: Debugger is no longer active
10-25 11:56:33.372 3126-3126/? W/System: ClassLoader referenced unknown path: /data/app/com.example.subinasharma.myapplication-2/lib/x86
10-25 11:56:35.029 3126-3133/com.example.subinasharma.myapplication W/art: Suspending all threads took: 15.151ms
10-25 11:56:35.071 3126-3126/com.example.subinasharma.myapplication D/AndroidRuntime: Shutting down VM
10-25 11:56:35.075 3126-3126/com.example.subinasharma.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.subinasharma.myapplication, PID: 3126
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.subinasharma.myapplication/com.example.subinasharma.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #15: Failed to resolve attribute at index 6: TypedValue{t=0x1d/d=0xff3f51b5 a=2 r=0x7f0b0013}
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.view.InflateException: Binary XML file line #15: Failed to resolve attribute at index 6: TypedValue{t=0x1d/d=0xff3f51b5 a=2 r=0x7f0b0013}
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
at com.example.subinasharma.myapplication.MainActivity.onCreate(MainActivity.java:17)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 6: TypedValue{t=0x1d/d=0xff3f51b5 a=2 r=0x7f0b0013}
at android.content.res.TypedArray.getLayoutDimension(TypedArray.java:705)
at android.view.ViewGroup$LayoutParams.setBaseAttributes(ViewGroup.java:6890)
at android.view.ViewGroup$MarginLayoutParams.<init>(ViewGroup.java:7071)
at android.widget.LinearLayout$LayoutParams.<init>(LinearLayout.java:1911)
at android.support.design.widget.AppBarLayout$LayoutParams.<init>(AppBarLayout.java:554)
at android.support.design.widget.AppBarLayout.generateLayoutParams(AppBarLayout.java:284)
at android.support.design.widget.AppBarLayout.generateLayoutParams(AppBarLayout.java:97)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:838)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:798)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
at com.example.subinasharma.myapplication.MainActivity.onCreate(MainActivity.java:17)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
10-25 11:56:35.883 3126-3133/com.example.subinasharma.myapplication W/art: Suspending all threads took: 35.182ms
10-25 11:56:43.252 3126-3126/com.example.subinasharma.myapplication I/Process: Sending signal. PID: 3126 SIG: 9
とAndroidメーカー自体、 によって作成された2つのレイアウトがあるActivity_Main.xml:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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:fitsSystemWindows="true"
tools:context="com.example.subinasharma.myapplication.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/fab_margin"
android:src="@android:drawable/ic_dialog_email" />
</android.support.design.widget.CoordinatorLayout>
と別のContent_Main.xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.subinasharma.myapplication.MainActivity"
tools:showIn="@layout/activity_main">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
</RelativeLayout>
グレードファイル:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.subinasharma.myapplication2"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
}
そのアクティビティのレイアウトファイルを投稿できますか? – himanshu1496
レイアウトXMLファイルでタイプミスを起こしたと思います –
エラー「バイナリXMLファイルライン#15:失敗」xmlを15行目でチェックしてください。 –