This is my error after I run App. After importing Facebook 4.1.2 project it says that I need Java 1.7, android support v4 and Bolts-Android so I updated my Android tools library from last version and it's showing an error.
05-18 19:05:06.591: E/AndroidRuntime(23525): FATAL EXCEPTION: main
05-18 19:05:06.591: E/AndroidRuntime(23525): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.fbtest/com.example.fbtest.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class com.facebook.login.widget.LoginButton
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2372)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.access$600(ActivityThread.java:169)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1388)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.os.Handler.dispatchMessage(Handler.java:107)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.os.Looper.loop(Looper.java:194)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.main(ActivityThread.java:5433)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.reflect.Method.invokeNative(Native Method)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.reflect.Method.invoke(Method.java:525)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:924)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691)
05-18 19:05:06.591: E/AndroidRuntime(23525): at dalvik.system.NativeStart.main(Native Method)
05-18 19:05:06.591: E/AndroidRuntime(23525): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class com.facebook.login.widget.LoginButton
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.Activity.setContentView(Activity.java:1895)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.example.fbtest.MainActivity.onCreate(MainActivity.java:23)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.Activity.performCreate(Activity.java:5179)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2336)
05-18 19:05:06.591: E/AndroidRuntime(23525): ... 11 more
05-18 19:05:06.591: E/AndroidRuntime(23525): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.login.widget.LoginButton" on path: DexPathList[[zip file "/data/app/com.example.fbtest-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.fbtest-2, /vendor/lib, /system/lib, /data/datalib]]
05-18 19:05:06.591: E/AndroidRuntime(23525): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
Images for xml and manifest are:
XML,MANIFEST
To remove this error, first place your Facebook SDK in your workspace and then import in eclipse.
Related
05-18 19:05:06.591: E/AndroidRuntime(23525): FATAL EXCEPTION: main
05-18 19:05:06.591: E/AndroidRuntime(23525): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.fbtest/com.example.fbtest.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class com.facebook.login.widget.LoginButton
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2372)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.access$600(ActivityThread.java:169)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1388)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.os.Handler.dispatchMessage(Handler.java:107)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.os.Looper.loop(Looper.java:194)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.main(ActivityThread.java:5433)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.reflect.Method.invokeNative(Native Method)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.reflect.Method.invoke(Method.java:525)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:924)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691)
05-18 19:05:06.591: E/AndroidRuntime(23525): at dalvik.system.NativeStart.main(Native Method)
05-18 19:05:06.591: E/AndroidRuntime(23525): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class com.facebook.login.widget.LoginButton
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.Activity.setContentView(Activity.java:1895)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.example.fbtest.MainActivity.onCreate(MainActivity.java:23)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.Activity.performCreate(Activity.java:5179)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2336)
05-18 19:05:06.591: E/AndroidRuntime(23525): ... 11 more
05-18 19:05:06.591: E/AndroidRuntime(23525): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.login.widget.LoginButton" on path: DexPathList[[zip file "/data/app/com.example.fbtest-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.fbtest-2, /vendor/lib, /system/lib, /data/datalib]]
05-18 19:05:06.591: E/AndroidRuntime(23525): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.createView(LayoutInflater.java:552)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
05-18 19:05:06.591: E/AndroidRuntime(23525): ... 21 more
Have you import sdk library into eclipse,have you mark project As Library, and import that to your project?
I'm working on an android application that uses facebook sdk 3.6.0, in android studio 0.5.7, after update to 0.8.1 ... facebook sdk does not work,
the following error appears :
07-14 11:39:59.808 544-544/com.example.testdrawer E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.testdrawer/com.example.testdrawer.LoginActivity}: android.view.InflateException: Binary XML file line #36: Error inflating class com.facebook.widget.LoginButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
at android.app.ActivityThread.access$600(ActivityThread.java:122)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4340)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at comm.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #36: Error inflating class com.facebook.widget.LoginButton
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
at android.app.Activity.setContentView(Activity.java:1835)
at com.example.testdrawer.LoginActivity.onCreate(LoginActivity.java:65)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
at android.app.ActivityThread.access$600(ActivityThread.java:122)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4340)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.facebook.widget.LoginButton
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.view.LayoutInflater.createView(LayoutInflater.java:552)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:739)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:742)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:251)
at android.app.Activity.setContentView(Activity.java:1835)
at com.example.testdrawer.LoginActivity.onCreate(LoginActivity.java:65)
at android.app.Activity.performCreate(Activity.java:4465)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
at android.app.ActivityThread.access$600(ActivityThread.java:122)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4340)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
I also changed gradle from 9 to 12
dependencies {
classpath 'com.android.tools.build:gradle:0.12.+'
}
How to solve this problem?
thank you!
I do not know exactly what I did, but it works !
I cleaned the project (build-clear project) and I changed something in build.grandle
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 10
targetSdkVersion 14
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:+'
compile project(':libraries:facebook')
compile 'com.google.android.gms:play-services:4.2.42'
compile 'com.android.support:appcompat-v7:+'
}
I'm trying to develop some app with Google Maps API.
I'm followed this tutorial step by step and the app crashed!
I tried so many tutorials, even this one, but I get always the same error:
05-18 00:53:16.466: E/AndroidRuntime(17073): FATAL EXCEPTION: main
05-18 00:53:16.466: E/AndroidRuntime(17073): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.googlemaps/com.example.googlemaps.MainActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.ActivityThread.access$700(ActivityThread.java:159)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.os.Handler.dispatchMessage(Handler.java:99)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.os.Looper.loop(Looper.java:137)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.ActivityThread.main(ActivityThread.java:5419)
05-18 00:53:16.466: E/AndroidRuntime(17073): at java.lang.reflect.Method.invokeNative(Native Method)
05-18 00:53:16.466: E/AndroidRuntime(17073): at java.lang.reflect.Method.invoke(Method.java:525)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
05-18 00:53:16.466: E/AndroidRuntime(17073): at dalvik.system.NativeStart.main(Native Method)
05-18 00:53:16.466: E/AndroidRuntime(17073): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:719)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:361)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.Activity.setContentView(Activity.java:1956)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.example.googlemaps.MainActivity.onCreate(MainActivity.java:20)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.Activity.performCreate(Activity.java:5372)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257)
05-18 00:53:16.466: E/AndroidRuntime(17073): ... 11 more
05-18 00:53:16.466: E/AndroidRuntime(17073): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4132500 but found 0. 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" />
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.maps.internal.q.v(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.maps.internal.q.u(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.maps.MapFragment$b.eb(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.maps.MapFragment$b.a(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.dynamic.a.a(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.Activity.onCreateView(Activity.java:4965)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:695)
05-18 00:53:16.466: E/AndroidRuntime(17073): ... 21 more
Can someone help?
Replace #integer/google_play_services_version with 4132500
see this
google-play-services_lib --> res --> values --> version.xml
for the correct version of your google play services
I tried alot added all libraries with no use and followed documentation to make it work any help would be appreciated
Here's what appear at my logcat:
05-18 17:26:50.480: E/dalvikvm(5818): Could not find class 'com.google.maps.android.utils.demo.ClusteringDemoActivity', referenced from method com.google.maps.android.utils.demo.MainActivity.onCreate
05-18 17:26:50.552: E/AndroidRuntime(5818): FATAL EXCEPTION: main
05-18 17:26:50.552: E/AndroidRuntime(5818): java.lang.NoClassDefFoundError: com.google.maps.android.utils.demo.ClusteringDemoActivity
05-18 17:26:50.552: E/AndroidRuntime(5818): at com.google.maps.android.utils.demo.MainActivity.onCreate(MainActivity.java:22)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.Activity.performCreate(Activity.java:5133)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.ActivityThread.access$600(ActivityThread.java:141)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.os.Handler.dispatchMessage(Handler.java:99)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.os.Looper.loop(Looper.java:137)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.ActivityThread.main(ActivityThread.java:5103)
05-18 17:26:50.552: E/AndroidRuntime(5818): at java.lang.reflect.Method.invokeNative(Native Method)
05-18 17:26:50.552: E/AndroidRuntime(5818): at java.lang.reflect.Method.invoke(Method.java:525)
05-18 17:26:50.552: E/AndroidRuntime(5818): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
05-18 17:26:50.552: E/AndroidRuntime(5818): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
05-18 17:26:50.552: E/AndroidRuntime(5818): at dalvik.system.NativeStart.main(Native Method)
selectQType a simple spinner. The values are getting populated from the DB and they are fine.
ArrayAdapter<String> spinnerArrayAdapter1 =
new ArrayAdapter<String>(SpotlighterBasicActivity.this,
android.R.layout.simple_spinner_item, spinnerQTypeList);
spinnerArrayAdapter1.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item);
Spinner selectQType=(Spinner) findViewById(R.id.spinnerInputQType);
selectQType.setPrompt("QType");// logcat points warning on this line.
selectQType.setAdapter(spinnerArrayAdapter1);
selectQType.setSelection(QTypeIndex);
selectQType.setOnItemSelectedListener(new OnItemSelectedListener() {
...
}
This is the output i get for Tablet:
Strange part is that it is working perfectly fine for mobile category of emulators and devices, but giving warning for tablet category of emulators and devices.
Following is the logcat detail:
05-18 16:47:29.284: E/SpotlighterBasicActivity(481): QTypeIndex=0
05-18 16:47:29.284: E/SpotlighterBasicActivity(481): spinnerArrayList[1]=Type 1, spinnerQTypeID=5853, defaultQType=6307
05-18 16:47:29.294: E/SpotlighterBasicActivity(481): spinnerArrayList[2]=Type 2, spinnerQTypeID=6308, defaultQType=6307
05-18 16:47:29.304: W/System.err(481): java.lang.NullPointerException
05-18 16:47:29.304: W/System.err(481): at in.varit.spotlighter.basic.SpotlighterBasicActivity.loadQTypeSpinners(SpotlighterBasicActivity.java:334)
05-18 16:47:29.304: W/System.err(481): at in.varit.spotlighter.basic.SpotlighterBasicActivity.onCreate(SpotlighterBasicActivity.java:203)
05-18 16:47:29.304: W/System.err(481): at android.app.Activity.performCreate(Activity.java:4397)
05-18 16:47:29.304: W/System.err(481): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
05-18 16:47:29.313: W/System.err(481): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
05-18 16:47:29.313: W/System.err(481): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
05-18 16:47:29.313: W/System.err(481): at android.app.ActivityThread.access$500(ActivityThread.java:122)
05-18 16:47:29.313: W/System.err(481): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
05-18 16:47:29.325: W/System.err(481): at android.os.Handler.dispatchMessage(Handler.java:99)
05-18 16:47:29.325: W/System.err(481): at android.os.Looper.loop(Looper.java:132)
05-18 16:47:29.325: W/System.err(481): at android.app.ActivityThread.main(ActivityThread.java:4123)
05-18 16:47:29.325: W/System.err(481): at java.lang.reflect.Method.invokeNative(Native Method)
05-18 16:47:29.325: W/System.err(481): at java.lang.reflect.Method.invoke(Method.java:491)
05-18 16:47:29.334: W/System.err(481): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
05-18 16:47:29.334: W/System.err(481): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
05-18 16:47:29.334: W/System.err(481): at dalvik.system.NativeStart.main(Native Method)
selectQType is null And
check using if(null!=selectQType)
and also check id of selectQType is it right from layout.xml?