내 앱이지도를 열 예정입니다. 나는 플레이 서비스, 구현 된 단편을 포함하고 모든 것을 할 수있었습니다! 그러나 런타임 동안 "오류를 일으킬 수 없습니다"종류가 있습니다.Android에서 "런타임 오류"를 해결하는 방법은 무엇입니까?
내 매니페스트 파일, 레이아웃 파일 및 로그캣 오류가 있습니다.
매니페스트
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="xyz.xyz"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="21" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<permission
android:name="xyz.xyz.permission.MAPS_RECEIVE"
android:protectionLevel="signature"
/>
<uses-permission android:name="xyz.xyz.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity android:name="Home"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HelloGoogleMaps" android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar"/>
<uses-library android:name="com.google.android.maps"/>
</application>
레이아웃
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
tools:context="xyz.xyz.Home" >
<fragment
android:id="@+id/mapView"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_below="@+id/acceleration"
android:layout_marginTop="20dp"
android:apiKey="GoogleAPIKEY//I Added a Key, I just do not feel comfortable to display it"
android:clickable="true"
android:enabled="true" />
</RelativeLayout>
로그 캣
01-05 04:33:18.003: E/AndroidRuntime(9303): FATAL EXCEPTION: main
01-05 04:33:18.003: E/AndroidRuntime(9303): java.lang.RuntimeException: Unable to start activity ComponentInfo{xyz.xyz/xyz.xyz.Home}: android.view.InflateException: Binary XML file line #20: Error inflating class fragment
01-05 04:33:18.003: E/AndroidRuntime(9303): Caused by: java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
01-05 04:33:18.003: E/AndroidRuntime(9303): at com.google.android.gms.common.GooglePlayServicesUtil.A(Unknown Source)
01-05 04:33:18.003: E/AndroidRuntime(9303): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
더 있었다 그러나이 중요 보였다. 또한 메타 데이터로 추가하라는 내용이 추가되었으며 여전히 예외가 생성됩니다.
여러분의 조각에는 android : layout_below = "@ + id/acceleration"가 있지만 id가 "acceleration"인 구성 요소가 없습니다 –
사실 저는 textview로 사용합니다. 그러나 내 클라이언트의 저작권 문제로 인해 여기에 완전히 표시 할 수는 없습니다. 그는 중요한 정보 만 표시해야한다고 주장합니다. – user2857958
정말 제안과 노력을 감사드립니다. – user2857958