I am running my app on Eclipse, after successfully setup my project with latest android-support-v7-appcompat library i am facing this issue, don't know how to rectify it, my error log is below
08-12 14:34:09.335: E/AndroidRuntime(7681): java.lang.NoClassDefFoundError: android.support.v7.app.AppCompatDelegateImplV14
08-12 14:34:09.335: E/AndroidRuntime(7681): at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:93)
08-12 14:34:09.335: E/AndroidRuntime(7681): at android.support.v7.app.AppCompatDelegate.create(AppCompatDelegate.java:77)
08-12 14:34:09.335: E/AndroidRuntime(7681): at android.support.v7.app.AppCompatActivity.getDelegate(AppCompatActivity.java:429)
08-12 14:34:09.335: E/AndroidRuntime(7681): at android.support.v7.app.AppCompatActivity.onCreate(AppCompatActivity.java:57)
08-12 14:34:09.335: E/AndroidRuntime(7681): at com.fleetjack.android.apps.viewer.FleetLanding.onCreate(FleetLanding.java:125)
08-12 14:34:09.335: E/AndroidRuntime(7681): at android.app.Activity.performCreate(Activity.java:5283)
08-12 14:34:09.335: E/AndroidRuntime(7681): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1097)
08-12 14:34:09.335: E/AndroidRuntime(7681): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2209)
08-12 14:34:09.335: E/AndroidRuntime(7681): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2299)
08-12 14:34:09.335: E/AndroidRuntime(7681): at android.app.ActivityThread.access$700(ActivityThread.java:150)
08-12 14:34:09.335: E/AndroidRuntime(7681): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1280)
08-12 14:34:09.335: E/AndroidRuntime(7681): at android.os.Handler.dispatchMessage(Handler.java:99)
08-12 14:34:09.335: E/AndroidRuntime(7681): at android.os.Looper.loop(Looper.java:137)
08-12 14:34:09.335: E/AndroidRuntime(7681): at android.app.ActivityThread.main(ActivityThread.java:5283)
08-12 14:34:09.335: E/AndroidRuntime(7681): at java.lang.reflect.Method.invokeNative(Native Method)
08-12 14:34:09.335: E/AndroidRuntime(7681): at java.lang.reflect.Method.invoke(Method.java:511)
08-12 14:34:09.335: E/AndroidRuntime(7681): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102)
08-12 14:34:09.335: E/AndroidRuntime(7681): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869)
08-12 14:34:09.335: E/AndroidRuntime(7681): at dalvik.system.NativeStart.main(Native Method)
In my libs folder i have added three jar files -> support design, supportV4, supportV7-appcompact, gcm(i have removed libraries in appcompact project library )
As well in my manifest i have changed my app theme to android:theme="#style/Theme.AppCompat" changed activity to AppCompatActivity, Now when i try to run my application it always through an exception.
Kindly help me to fix this issue
Searched through google but all the solution is for Android-Studio i am using eclipse
Thanks in advance
import android-support-* jar files in libs, may causes error.
each library is android-project structure, jar file is not contain android-project structure (res, assets, etc).
import libraries projects and add reference.
check your project settings.
import 'android-support-v7-appcompat library' as project?
clean android-support-v7-appcompat library and your project.
check your project, referencing appcompat library.
check build path
if you still facing error, please comment.
Related
I've to include in my Android studio project a lib for managing audio streams from urls. I'm tying to use this, but when I try to run the app and it reach the point where have to instantiate a FFmpegMediaPlayer object, it crush with the error
31444-31444/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.ExceptionInInitializerError
These the steps I've done to integrate the lib in my project:
I've copied all .so, gdb.setup and gdbserver files from demo project and put them into my jniLibs replicating the exact folder structure
I've copied fmp.jar from demo my libs forlder
I've changed all paths in gdb.setup files accordingly with my project folder structure
synch with gradle
I'm not an expert of Android specially for tasks like this, am I missing something important? If you need it I can give a test app
Thankyou
Edit 1
This is the complete error
08-19 10:20:42.066 31444-31444/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.ExceptionInInitializerError
at com.example.lucabrognara.radiostreamprova.RadioActivity.onCreate(RadioActivity.java:126)
at android.app.Activity.performCreate(Activity.java:5206)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
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:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1892]: 1836 could not load needed library 'libswresample.so' for 'libavcodec.so' (load_library[1094]: Library 'libswresample.so' not found)
at java.lang.Runtime.load(Runtime.java:340)
at java.lang.System.load(System.java:521)
at wseemann.media.FFmpegMediaPlayer.<clinit>(FFmpegMediaPlayer.java:604)
at com.example.lucabrognara.radiostreamprova.RadioActivity.onCreate(RadioActivity.java:126)
at android.app.Activity.performCreate(Activity.java:5206)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
at android.app.ActivityThread.access$700(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4921)
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:1027)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
at dalvik.system.NativeStart.main(Native Method)
Obviously, it was sufficient read carefully the documentation:
If you don't want to build the modules you can simple unzip the prebuilt ones and copy them to your projects "libs" folder
These the right steps:
Create an android studio project
unzip the prebuilt modules in jniLibs folder
put the fmp.jar file in libs folder
obviously include the android.permission.INTERNET in your manifest
I successfully built a map-fragment with android maps v2 and it works fine on my smartphone. now i plugged in my tablet and i get a NPE when i try to launch the map-activity. I am totally clueless at the moment; not even knowing what the source of the error may be. can anyone help? thx
OnCreate of map-activity:
FragmentManager myFragmentManager = getSupportFragmentManager();
SupportMapFragment mySupportMapFragment = (SupportMapFragment)myFragmentManager.findFragmentById(R.id.customer_map_fragment);
mMap = mySupportMapFragment.getMap();
mMap.setMyLocationEnabled(true); <-- line 103 with the NPE
mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);
customer_map_activity.xml:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment
android:id="#+id/customer_map_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"/>
</FrameLayout>
Logcat:
08-12 11:08:27.449: E/AndroidRuntime(3562): FATAL EXCEPTION: main
08-12 11:08:27.449: E/AndroidRuntime(3562): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.cocus.salesapp/com.cocus.salesapp.TestCustomerMapActivity}: java.lang.NullPointerException
08-12 11:08:27.449: E/AndroidRuntime(3562): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2185)
08-12 11:08:27.449: E/AndroidRuntime(3562): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2210)
08-12 11:08:27.449: E/AndroidRuntime(3562): at android.app.ActivityThread.access$600(ActivityThread.java:142)
08-12 11:08:27.449: E/AndroidRuntime(3562): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1208)
08-12 11:08:27.449: E/AndroidRuntime(3562): at android.os.Handler.dispatchMessage(Handler.java:99)
08-12 11:08:27.449: E/AndroidRuntime(3562): at android.os.Looper.loop(Looper.java:137)
08-12 11:08:27.449: E/AndroidRuntime(3562): at android.app.ActivityThread.main(ActivityThread.java:4931)
08-12 11:08:27.449: E/AndroidRuntime(3562): at java.lang.reflect.Method.invokeNative(Native Method)
08-12 11:08:27.449: E/AndroidRuntime(3562): at java.lang.reflect.Method.invoke(Method.java:511)
08-12 11:08:27.449: E/AndroidRuntime(3562): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
08-12 11:08:27.449: E/AndroidRuntime(3562): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:558)
08-12 11:08:27.449: E/AndroidRuntime(3562): at dalvik.system.NativeStart.main(Native Method)
08-12 11:08:27.449: E/AndroidRuntime(3562): Caused by: java.lang.NullPointerException
08-12 11:08:27.449: E/AndroidRuntime(3562): at com.fghj.salesapp.TestCustomerMapActivity.onCreate(TestCustomerMapActivity.java:103)
edit:
on phone its running on portrait only. on tablet it is forced to use landscape.
You may learn about the reason via call to GooglePlayServicesUtil.isGooglePlayServicesAvailable.
It will return you an int value which you can compare with ConnectionResult constants.
I'm building an Android app with Eclipse and it all went well until I added a particular KeyEvent code. Once I tried to emulate my app, it crashed and died. I tried to clean it multiple times, but it is not being resolved. Also, when I try to edit the source path, the sources are shown for a split second but disappear. Here are the sources that are not being found:
ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2159
ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2189
ActivityThread.access$600(ActivityThread, ActivityThread$ActivityClientRecord, Intent) line: 139
ActivityThread$H.handleMessage(Message) line: 1261
ActivityThread.main(String[]) line: 4894
ZygoteInit$MethodAndArgsCaller.run() line: 784
ZygoteInit.main(String[]) line: 551
NativeStart.main(String[]) line: not available [native method]
How can I make them become able to use? I am so close to my app being ready. This is the only setback in my app.
EDIT: Here's the logcat output:
08-12 10:52:02.359: E/AndroidRuntime(23219): FATAL EXCEPTION: main
08-12 10:52:02.359: E/AndroidRuntime(23219): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mshaw.avanos/com.mshaw.avanos.AvanosActivity}: java.lang.NullPointerException
08-12 10:52:02.359: E/AndroidRuntime(23219): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2075)
08-12 10:52:02.359: E/AndroidRuntime(23219): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2189)
08-12 10:52:02.359: E/AndroidRuntime(23219): at android.app.ActivityThread.access$600(ActivityThread.java:139)
08-12 10:52:02.359: E/AndroidRuntime(23219): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
08-12 10:52:02.359: E/AndroidRuntime(23219): at android.os.Handler.dispatchMessage(Handler.java:99)
08-12 10:52:02.359: E/AndroidRuntime(23219): at android.os.Looper.loop(Looper.java:154)
08-12 10:52:02.359: E/AndroidRuntime(23219): at android.app.ActivityThread.main(ActivityThread.java:4894)
08-12 10:52:02.359: E/AndroidRuntime(23219): at java.lang.reflect.Method.invokeNative(Native Method)
08-12 10:52:02.359: E/AndroidRuntime(23219): at java.lang.reflect.Method.invoke(Method.java:511)
08-12 10:52:02.359: E/AndroidRuntime(23219): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
08-12 10:52:02.359: E/AndroidRuntime(23219): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
08-12 10:52:02.359: E/AndroidRuntime(23219): at dalvik.system.NativeStart.main(Native Method)
08-12 10:52:02.359: E/AndroidRuntime(23219): Caused by: java.lang.NullPointerException
08-12 10:52:02.359: E/AndroidRuntime(23219): at com.mshaw.avanos.SimpleEula.getPackageInfo(SimpleEula.java:25)
08-12 10:52:02.359: E/AndroidRuntime(23219): at com.mshaw.avanos.SimpleEula.show(SimpleEula.java:33)
08-12 10:52:02.359: E/AndroidRuntime(23219): at com.mshaw.avanos.AvanosActivity.<init>(AvanosActivity.java:36)
08-12 10:52:02.359: E/AndroidRuntime(23219): at java.lang.Class.newInstanceImpl(Native Method)
08-12 10:52:02.359: E/AndroidRuntime(23219): at java.lang.Class.newInstance(Class.java:1319)
08-12 10:52:02.359: E/AndroidRuntime(23219): at android.app.Instrumentation.newActivity(Instrumentation.java:1039)
08-12 10:52:02.359: E/AndroidRuntime(23219): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2066)
08-12 10:52:02.359: E/AndroidRuntime(23219): ... 11 more
Follow these steps
1) Goto your debug view
2) under Breakpoint Tab you will see NullPointerException
3) Right click and uncheck caught.
4) Debug your Project again
Hope this will help you. Thanks
I got error on device and emulator with android version 2.3.3, but on device and emulator with Android version 4 - no error...
LogCat say:
08-12 19:07:45.182: E/AndroidRuntime(352): FATAL EXCEPTION: main
08-12 19:07:45.182: E/AndroidRuntime(352): java.lang.NullPointerException
08-12 19:07:45.182: E/AndroidRuntime(352): at android.app.WallpaperManager.setBitmap(WallpaperManager.java:484)
08-12 19:07:45.182: E/AndroidRuntime(352): at com.zznob.lwpchanger.SWpJob$ParseSite.onPostExecute(SWpJob.java:96)
08-12 19:07:45.182: E/AndroidRuntime(352): at com.zznob.lwpchanger.SWpJob$ParseSite.onPostExecute(SWpJob.java:1)
08-12 19:07:45.182: E/AndroidRuntime(352): at android.os.AsyncTask.finish(AsyncTask.java:417)
08-12 19:07:45.182: E/AndroidRuntime(352): at android.os.AsyncTask.access$300(AsyncTask.java:127)
08-12 19:07:45.182: E/AndroidRuntime(352): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
08-12 19:07:45.182: E/AndroidRuntime(352): at android.os.Handler.dispatchMessage(Handler.java:99)
08-12 19:07:45.182: E/AndroidRuntime(352): at android.os.Looper.loop(Looper.java:123)
08-12 19:07:45.182: E/AndroidRuntime(352): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-12 19:07:45.182: E/AndroidRuntime(352): at java.lang.reflect.Method.invokeNative(Native Method)
08-12 19:07:45.182: E/AndroidRuntime(352): at java.lang.reflect.Method.invoke(Method.java:507)
08-12 19:07:45.182: E/AndroidRuntime(352): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-12 19:07:45.182: E/AndroidRuntime(352): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-12 19:07:45.182: E/AndroidRuntime(352): at dalvik.system.NativeStart.main(Native Method)
Code with error:
protected void onPostExecute(Bitmap bitmap)
{
if(!isCancelled()){
try{
wallpaperManager.setBitmap(bitmap); <- Error on Android version 2.2-2.3
}
catch(IOException e){
e.printStackTrace();
}
}
super.onPostExecute(bitmap);
}
Build with API version 8... Any idea?
Class full code - http://pastebin.com/iwgYbPfb
Im trying to inflate a view which serves as a loading screen for my glSurfaceView while it swaps out textures during runtime (i know how to do it during my onCreate just fine). Its just a RelativeLayout with a progress bar in the middle and when its done with the swap it disappears, but its not inflating correctly.
inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
loading = inflater.inflate(R.layout.loading,null);
RelativeLayout loadingScreen = (RelativeLayout) findViewById(R.id.loadingScreen);
where loadingScreen is the id of the relative layout.
xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/loadingScreen"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:visibility="visible" >
<ProgressBar
android:id="#+id/progressBar1"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" >
</ProgressBar>
<EditText
android:id="#+id/editText android:layout_height="
android:layout_width="wrap_content"
wrap_content="" >
</EditText>
</RelativeLayout>
For a test, I added an EditText above the following additional code to test it out:
EditText tester = (EditText) findViewById(R.id.editText); //Now we have an object
tester.setText("dfdfds");
and the error log:
08-12 15:07:35.630: ERROR/ActivityThread(2502): Failed to inflate
08-12 15:07:35.630: ERROR/ActivityThread(2502): android.view.InflateException: Binary XML file line #5: Error inflating class com.huskybus.CampusMapOpenGL
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:212)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.app.Activity.setContentView(Activity.java:1657)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at com.huskybus.Main.onCreate(Main.java:91)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.os.Handler.dispatchMessage(Handler.java:99)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.os.Looper.loop(Looper.java:130)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.app.ActivityThread.main(ActivityThread.java:3835)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at java.lang.reflect.Method.invokeNative(Native Method)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at java.lang.reflect.Method.invoke(Method.java:507)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at dalvik.system.NativeStart.main(Native Method)
08-12 15:07:35.630: ERROR/ActivityThread(2502): Caused by: java.lang.reflect.InvocationTargetException
08-12 15:07:35.630: ERROR/ActivityThread(2502): at java.lang.reflect.Constructor.constructNative(Native Method)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
08-12 15:07:35.630: ERROR/ActivityThread(2502): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
08-12 15:07:35.630: ERROR/ActivityThread(2502): ... 21 more
08-12 15:07:35.630: ERROR/ActivityThread(2502): Caused by: java.lang.NullPointerException
08-12 15:07:35.630: ERROR/ActivityThread(2502): at com.huskybus.CampusMapOpenGL.<init>(CampusMapOpenGL.java:101)
08-12 15:07:35.630: ERROR/ActivityThread(2502): ... 24 more
08-12 15:07:35.637: DEBUG/AndroidRuntime(2502): Shutting down VM
08-12 15:07:35.637: WARN/dalvikvm(2502): threadid=1: thread exiting with uncaught exception (group=0x40015560)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): FATAL EXCEPTION: main
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.huskybus/com.huskybus.Main}: android.view.InflateException: Binary XML file line #5: Error inflating class com.huskybus.CampusMapOpenGL
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1768)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1784)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.app.ActivityThread.access$1500(ActivityThread.java:123)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:939)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.os.Handler.dispatchMessage(Handler.java:99)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.os.Looper.loop(Looper.java:130)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.app.ActivityThread.main(ActivityThread.java:3835)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at java.lang.reflect.Method.invokeNative(Native Method)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at java.lang.reflect.Method.invoke(Method.java:507)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at dalvik.system.NativeStart.main(Native Method)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): Caused by: android.view.InflateException: Binary XML file line #5: Error inflating class com.huskybus.CampusMapOpenGL
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:212)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.app.Activity.setContentView(Activity.java:1657)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at com.huskybus.Main.onCreate(Main.java:91)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1722)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): ... 11 more
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): Caused by: java.lang.reflect.InvocationTargetException
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at java.lang.reflect.Constructor.constructNative(Native Method)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): ... 21 more
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): Caused by: java.lang.NullPointerException
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): at com.huskybus.CampusMapOpenGL.<init>(CampusMapOpenGL.java:101)
08-12 15:07:35.653: ERROR/AndroidRuntime(2502): ... 24 more
Try loading.findViewById(...) instead of just findViewById(...)
i also have these kind of errors.i found that the error is come because of my text editor name is not match with the my text editor id.
When you have inflatet the View you need to use that view when finding child views like this
inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
loading = inflater.inflate(R.layout.loading,null);
RelativeLayout loadingScreen = (RelativeLayout) loading.findViewById(R.id.loadingScreen);