私はアンドロイドの新機能です。 私は4つのテキストビューと1つの相対レイアウトでレイアウトを作成しました。しかし、私はそれを実行すると、エラーが表示されますandroid.view.InflateException:バイナリXMLファイル行#20:エラークラスlogatのRelativelayoutを膨張させる。その私のコードandroid.view.InflateException:バイナリXMLファイルの行#20:Emerging class Relativelayout
XMLコード
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.gpsaja.GPSMainActivity" >
<TextView
android:id="@+id/tvAddress"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world"
android:layout_gravity="center"
android:textStyle="bold"/>
<Relativelayout
android:id="@+id/cantainer_layout"
android:layout_width="match_parent"
android:layout_height="260dp"
android:background="#ffffff"
android:layout_gravity="center">
</Relativelayout>
<TextView
android:id="@+id/tvDegree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/idDegree"
android:textSize="20sp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="horizontal"
>
<TextView
android:id="@+id/tvLat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/idLat"
android:gravity="center"/>
<TextView
android:id="@+id/tvLong"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/idLon" />
</LinearLayout>
logcat
11-24 01:24:51.056: E/AndroidRuntime(1792): FATAL EXCEPTION: main
11-24 01:24:51.056: E/AndroidRuntime(1792): Process: com.gpsaja, PID: 1792
11-24 01:24:51.056: E/AndroidRuntime(1792): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.gpsaja/com.gpsaja.GPSMainActivity}: android.view.InflateException: Binary XML file line #20: Error inflating class Relativelayout
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2184)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.app.ActivityThread.access$800(ActivityThread.java:135)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.os.Handler.dispatchMessage(Handler.java:102)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.os.Looper.loop(Looper.java:136)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.app.ActivityThread.main(ActivityThread.java:5001)
11-24 01:24:51.056: E/AndroidRuntime(1792): at java.lang.reflect.Method.invokeNative(Native Method)
11-24 01:24:51.056: E/AndroidRuntime(1792): at java.lang.reflect.Method.invoke(Method.java:515)
11-24 01:24:51.056: E/AndroidRuntime(1792): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
11-24 01:24:51.056: E/AndroidRuntime(1792): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
11-24 01:24:51.056: E/AndroidRuntime(1792): at dalvik.system.NativeStart.main(Native Method)
11-24 01:24:51.056: E/AndroidRuntime(1792): Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class Relativelayout
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
11-24 01:24:51.056: E/AndroidRuntime(1792): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.app.Activity.setContentView(Activity.java:1929)
11-24 01:24:51.056: E/AndroidRuntime(1792): at com.gpsaja.GPSMainActivity.onCreate(GPSMainActivity.java:43)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.app.Activity.performCreate(Activity.java:5231)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
11-24 01:24:51.056: E/AndroidRuntime(1792): ... 11 more
11-24 01:24:51.056: E/AndroidRuntime(1792): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.Relativelayout" on path: DexPathList[[zip file "/data/app/com.gpsaja-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.gpsaja-1, /system/lib]]
11-24 01:24:51.056: E/AndroidRuntime(1792): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
11-24 01:24:51.056: E/AndroidRuntime(1792): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
11-24 01:24:51.056: E/AndroidRuntime(1792): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.view.LayoutInflater.createView(LayoutInflater.java:559)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:652)
11-24 01:24:51.056: E/AndroidRuntime(1792): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:669)
11-24 01:24:51.056: E/AndroidRuntime(1792): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:694)
11-24 01:24:51.056: E/AndroidRuntime(1792): ... 21 more
それを修正するために私を助けて。
最近あなたのgradle依存関係を変更しましたか? –
** RelativeLayout ** –