I know that questions like this have been asked before, and I have been sifting through them. So here is my situation: I have a decent amount of experience using Java, specifically Eclipse. I just tried to run my hello world app without any modifications. And it couldn't start though emulator started normally.logcat shows following errors:
07-04 17:40:07.430: E/AndroidRuntime(862): FATAL EXCEPTION: main
07-04 17:40:07.430: E/AndroidRuntime(862): Process: com.trial.first, PID: 862
07-04 17:40:07.430: E/AndroidRuntime(862): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.trial.first/com.trial.first.MainActivity}: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
07-04 17:40:07.430: E/AndroidRuntime(862): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197)
07-04 17:40:07.430: E/AndroidRuntime(862): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
07-04 17:40:07.430: E/AndroidRuntime(862): at android.app.ActivityThread.access$800(ActivityThread.java:138)
07-04 17:40:07.430: E/AndroidRuntime(862): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
07-04 17:40:07.430: E/AndroidRuntime(862): at android.os.Handler.dispatchMessage(Handler.java:102)
07-04 17:40:07.430: E/AndroidRuntime(862): at android.os.Looper.loop(Looper.java:136)
07-04 17:40:07.430: E/AndroidRuntime(862): at android.app.ActivityThread.main(ActivityThread.java:5026)
07-04 17:40:07.430: E/AndroidRuntime(862): at java.lang.reflect.Method.invokeNative(Native Method)
07-04 17:40:07.430: E/AndroidRuntime(862): at java.lang.reflect.Method.invoke(Method.java:515)
07-04 17:40:07.430: E/AndroidRuntime(862): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
07-04 17:40:07.430: E/AndroidRuntime(862): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
07-04 17:40:07.430: E/AndroidRuntime(862): at dalvik.system.NativeStart.main(Native Method)
07-04 17:40:07.430: E/AndroidRuntime(862): Caused by: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
07-04 17:40:07.430: E/AndroidRuntime(862): at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:275)
07-04 17:40:07.430: E/AndroidRuntime(862): at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2872)
07-04 17:40:07.430: E/AndroidRuntime(862): at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3129)
07-04 17:40:07.430: E/AndroidRuntime(862): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:303)
07-04 17:40:07.430: E/AndroidRuntime(862): at android.app.Activity.setContentView(Activity.java:1930)
07-04 17:40:07.430: E/AndroidRuntime(862): at android.support.v7.app.ActionBarActivity.superSetContentView(ActionBarActivity.java:217)
07-04 17:40:07.430: E/AndroidRuntime(862): at android.support.v7.app.ActionBarActivityDelegateICS.setContentView(ActionBarActivityDelegateICS.java:110)
07-04 17:40:07.430: E/AndroidRuntime(862): at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:77)
07-04 17:40:07.430: E/AndroidRuntime(862): at com.trial.first.MainActivity.onCreate(MainActivity.java:14)
07-04 17:40:07.430: E/AndroidRuntime(862): at android.app.Activity.performCreate(Activity.java:5242)
07-04 17:40:07.430: E/AndroidRuntime(862): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
07-04 17:40:07.430: E/AndroidRuntime(862): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
07-04 17:40:07.430: E/AndroidRuntime(862): ... 11 more
07-04 17:40:11.080: I/Process(862): Sending signal. PID: 862 SIG: 9
manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.trial.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".TestActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Use the Android Virtual Device with API Level 19
In your Manifest.xml
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" /
Change android:targetSdkVesion to 19
Related
Ok, so I've got my Android application and it wont boot with a "unable to instantiate activity ComponentInfo{}" error, basically theres something wrong in my manifest file that won't let the application launch the first activity. I made a new but essentially duplicated project (manually copying across the Java+XML code for Main, second + third 'tester' activities, and of course Strings). I left the manifest of the new project as it is but added the activity lines for the tester. I wanted everything as stock basically so nothing could go wrong, and nothing did, the application loaded on emulator and my phone alright.
So I copy the new manifest to my old project in an effort to 'default' it, and I copy and pasted the tester activity code that was already there and worked, for the other 3 activity's. Suddenly it doesn't want to work. Everything is there, but what's the problem? (note the icon drawable is changed but that's nothing to do with it). All the activity names match up to package names and whatnot. Could this be a bug? I honestly cannot find anything wrong.
Duplicate (+ working) code
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/logo3"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.ollygrov.bakerspride.Main"
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="com.ollygrov.bakerspride.Cal"
android:label="#string/title_activity_cal" >
</activity>
<activity
android:name="com.ollygrov.bakerspride.Breads"
android:label="#string/title_activity_breads" >
</activity>
</application>
Old (+ not working) code
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.ollygrov.bakerspride.Main"
android:label="#string/app_title" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.ollygrov.bakerspride.Cal"
android:label="#string/title_activity_cal" >
</activity>
<activity
android:name="com.ollygrov.bakerspride.Breads"
android:label="#string/title_activity_breads" >
</activity>
<activity
android:name="com.ollygrov.bakerspride.Gal"
android:label="#string/title_activity_gal" >
</activity>
<activity
android:name="com.ollygrov.bakerspride.Tut"
android:label="#string/title_activity_tut" >
</activity>
<activity
android:name="com.ollygrov.bakerspride.Rec"
android:label="#string/title_activity_rec" >
</activity>
</application>
EDIT: I just copied and pasted the codes into the search bar on Chrome (changing the droid:icon and droid:label to fit) and they are exactly the same!! What?! Am I not allowed to have 6 activities or something?
Errors:
09-04 11:33:04.895: E/AndroidRuntime(717): FATAL EXCEPTION: main
09-04 11:33:04.895: E/AndroidRuntime(717): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ollygrov.bakerspride/com.ollygrov.bakerspride.Main}: java.lang.NullPointerException
09-04 11:33:04.895: E/AndroidRuntime(717): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
09-04 11:33:04.895: E/AndroidRuntime(717): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
09-04 11:33:04.895: E/AndroidRuntime(717): at android.app.ActivityThread.access$600(ActivityThread.java:130)
09-04 11:33:04.895: E/AndroidRuntime(717): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
09-04 11:33:04.895: E/AndroidRuntime(717): at android.os.Handler.dispatchMessage(Handler.java:99)
09-04 11:33:04.895: E/AndroidRuntime(717): at android.os.Looper.loop(Looper.java:137)
09-04 11:33:04.895: E/AndroidRuntime(717): at android.app.ActivityThread.main(ActivityThread.java:4745)
09-04 11:33:04.895: E/AndroidRuntime(717): at java.lang.reflect.Method.invokeNative(Native Method)
09-04 11:33:04.895: E/AndroidRuntime(717): at java.lang.reflect.Method.invoke(Method.java:511)
09-04 11:33:04.895: E/AndroidRuntime(717): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
09-04 11:33:04.895: E/AndroidRuntime(717): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-04 11:33:04.895: E/AndroidRuntime(717): at dalvik.system.NativeStart.main(Native Method)
09-04 11:33:04.895: E/AndroidRuntime(717): Caused by: java.lang.NullPointerException
09-04 11:33:04.895: E/AndroidRuntime(717): at android.app.Activity.findViewById(Activity.java:1825)
09-04 11:33:04.895: E/AndroidRuntime(717): at com.ollygrov.bakerspride.Main.<init>(Main.java:19)
09-04 11:33:04.895: E/AndroidRuntime(717): at java.lang.Class.newInstanceImpl(Native Method)
09-04 11:33:04.895: E/AndroidRuntime(717): at java.lang.Class.newInstance(Class.java:1319)
09-04 11:33:04.895: E/AndroidRuntime(717): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
09-04 11:33:04.895: E/AndroidRuntime(717): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
09-04 11:33:04.895: E/AndroidRuntime(717): ... 11 more
09-04 11:34:58.665: E/Trace(765): error opening trace file: No such file or directory (2)
09-04 11:34:59.095: D/AndroidRuntime(765): Shutting down VM
09-04 11:34:59.095: W/dalvikvm(765): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
09-04 11:34:59.114: E/AndroidRuntime(765): FATAL EXCEPTION: main
09-04 11:34:59.114: E/AndroidRuntime(765): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ollygrov.bakerspride/com.ollygrov.bakerspride.Main}: java.lang.NullPointerException
09-04 11:34:59.114: E/AndroidRuntime(765): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
09-04 11:34:59.114: E/AndroidRuntime(765): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
09-04 11:34:59.114: E/AndroidRuntime(765): at android.app.ActivityThread.access$600(ActivityThread.java:130)
09-04 11:34:59.114: E/AndroidRuntime(765): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
09-04 11:34:59.114: E/AndroidRuntime(765): at android.os.Handler.dispatchMessage(Handler.java:99)
09-04 11:34:59.114: E/AndroidRuntime(765): at android.os.Looper.loop(Looper.java:137)
09-04 11:34:59.114: E/AndroidRuntime(765): at android.app.ActivityThread.main(ActivityThread.java:4745)
09-04 11:34:59.114: E/AndroidRuntime(765): at java.lang.reflect.Method.invokeNative(Native Method)
09-04 11:34:59.114: E/AndroidRuntime(765): at java.lang.reflect.Method.invoke(Method.java:511)
09-04 11:34:59.114: E/AndroidRuntime(765): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
09-04 11:34:59.114: E/AndroidRuntime(765): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
09-04 11:34:59.114: E/AndroidRuntime(765): at dalvik.system.NativeStart.main(Native Method)
09-04 11:34:59.114: E/AndroidRuntime(765): Caused by: java.lang.NullPointerException
09-04 11:34:59.114: E/AndroidRuntime(765): at android.app.Activity.findViewById(Activity.java:1825)
09-04 11:34:59.114: E/AndroidRuntime(765): at com.ollygrov.bakerspride.Main.<init>(Main.java:19)
09-04 11:34:59.114: E/AndroidRuntime(765): at java.lang.Class.newInstanceImpl(Native Method)
09-04 11:34:59.114: E/AndroidRuntime(765): at java.lang.Class.newInstance(Class.java:1319)
09-04 11:34:59.114: E/AndroidRuntime(765): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
09-04 11:34:59.114: E/AndroidRuntime(765): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
The problem is your Main Constructor:
09-04 11:33:04.895: E/AndroidRuntime(717): Caused by: java.lang.NullPointerException
09-04 11:33:04.895: E/AndroidRuntime(717): at android.app.Activity.findViewById(Activity.java:1825)
09-04 11:33:04.895: E/AndroidRuntime(717): at com.ollygrov.bakerspride.Main.<init>(Main.java:19)
In line 19 of Main.java you are trying to call findViewById() which will obviously not work. It is way to early to call such code in the constructor.
My best guess is, that you need to move EVERYTHING from the cronstructor to onCreate() of the Activity.
Normally you don't need a custom constructor in Activities or Fragments.
I'm getting a force close every time I try to start a FragmentActivity from an Activity using an Intent. Here's the code from the Activity:
Intent intent = new Intent(getApplicationContext(), OrgHome.class);
intent.putExtra("Username", organization_name.getText().toString());
startActivity(intent);
And here's the logcat:
08-01 16:52:45.823: E/AndroidRuntime(600): FATAL EXCEPTION: main
08-01 16:52:45.823: E/AndroidRuntime(600): java.lang.NoClassDefFoundError: com.project3.organizations.OrgHome
08-01 16:52:45.823: E/AndroidRuntime(600): at com.project3.organizations.MainActivity$1$1.mobDBResponse(MainActivity.java:76)
08-01 16:52:45.823: E/AndroidRuntime(600): at com.mobdb.android.MobDBRequest.onPostExecute(MobDBRequest.java:78)
08-01 16:52:45.823: E/AndroidRuntime(600): at com.mobdb.android.MobDBRequest.onPostExecute(MobDBRequest.java:1)
08-01 16:52:45.823: E/AndroidRuntime(600): at android.os.AsyncTask.finish(AsyncTask.java:417)
08-01 16:52:45.823: E/AndroidRuntime(600): at android.os.AsyncTask.access$300(AsyncTask.java:127)
08-01 16:52:45.823: E/AndroidRuntime(600): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:429)
08-01 16:52:45.823: E/AndroidRuntime(600): at android.os.Handler.dispatchMessage(Handler.java:99)
08-01 16:52:45.823: E/AndroidRuntime(600): at android.os.Looper.loop(Looper.java:123)
08-01 16:52:45.823: E/AndroidRuntime(600): at android.app.ActivityThread.main(ActivityThread.java:3683)
08-01 16:52:45.823: E/AndroidRuntime(600): at java.lang.reflect.Method.invokeNative(Native Method)
08-01 16:52:45.823: E/AndroidRuntime(600): at java.lang.reflect.Method.invoke(Method.java:507)
08-01 16:52:45.823: E/AndroidRuntime(600): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
08-01 16:52:45.823: E/AndroidRuntime(600): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
08-01 16:52:45.823: E/AndroidRuntime(600): at dalvik.system.NativeStart.main(Native Method)
08-01 16:52:48.053: I/Process(600): Sending signal. PID: 600 SIG: 9
OrgHome.class is defined in the manifest correctly. What's going on here?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.project3.organizations"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="OrgHome"></activity>
</application>
</manifest>
Change the manifest:
Use this if OrgHome is in the same place as MainActivity
<activity android:name=".OrgHome" />
Use this if it's in a sub-folder
<activity android:name=".sub.path.to.OrgHome" />
Or specify the whole path
<activity android:name="entire.path.to.OrgHome" />
for addressing the Fragment activities you should write (getactivity(),nameofOtherActivity.class); and you should be all right.
I made an App. and since I just wanted to test some functions before adding them to the App,
I decided to copy my project into a new Project. When I tried to run the new project, the app crashes and the log-cat output is as follows.
Manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.androidbook.MP"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.CAMERA"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" android:debuggable="true">
<activity
android:name=".MPActivity"
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="AddLocationActivity"></activity>
<activity android:name="MPData"></activity>
<activity android:name="MyLocations"></activity>
<activity android:name="MPInfo"></activity>
<activity android:name="Navigation"></activity>
</application>
LogCat:
05-21 15:30:03.710: E/AndroidRuntime(11294): FATAL EXCEPTION: main
05-21 15:30:03.710: E/AndroidRuntime(11294): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.androidbook.MP/com.androidbook.MP.MPActivity}:
java.lang.ClassNotFoundException: com.androidbook.MP.MPActivity in loader
dalvik.system.PathClassLoader[/data/app/com.androidbook.MP-1.apk]
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.os.Handler.dispatchMessage(Handler.java:99)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.os.Looper.loop(Looper.java:130)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.ActivityThread.main(ActivityThread.java:3691)
05-21 15:30:03.710: E/AndroidRuntime(11294): at java.lang.reflect.Method.invokeNative(Native Method)
05-21 15:30:03.710: E/AndroidRuntime(11294): at java.lang.reflect.Method.invoke(Method.java:507)
05-21 15:30:03.710: E/AndroidRuntime(11294): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
05-21 15:30:03.710: E/AndroidRuntime(11294): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
05-21 15:30:03.710: E/AndroidRuntime(11294): at dalvik.system.NativeStart.main(Native Method)
05-21 15:30:03.710: E/AndroidRuntime(11294): Caused by: java.lang.ClassNotFoundException: com.androidbook.MP.MPActivity in loader dalvik.system.PathClassLoader[/data/app/com.androidbook.MP-1.apk]
05-21 15:30:03.710: E/AndroidRuntime(11294): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
05-21 15:30:03.710: E/AndroidRuntime(11294): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
05-21 15:30:03.710: E/AndroidRuntime(11294): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-21 15:30:03.710: E/AndroidRuntime(11294): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
05-21 15:30:03.710: E/AndroidRuntime(11294): ... 11 more
Check your Manifest file, if the activity is to be declared.
for Ex:
<application>
<activity android:name=".MyActivity" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Look through all the files in your new project and make sure they aren't referencing classes from the old project.
I think I found the solution, i should have checked that, the package name of the new project is included in the manifest file as for an example
"package="com.androidbook.MPTest" ..
my mistake is the i used the package name of the old project as a package name of the new project.
Whenever I run my android application I get an exception:
05-07 12:03:55.356: E/AndroidRuntime(589): FATAL EXCEPTION: main
05-07 12:03:55.356: E/AndroidRuntime(589): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{packgname/de.fau.fsahoy.android.api15.Activities.LoginActivity}: java.lang.ClassNotFoundException: de.fau.fsahoy.android.api15.Activities.LoginActivity
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.ActivityThread.access$600(ActivityThread.java:123)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.os.Handler.dispatchMessage(Handler.java:99)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.os.Looper.loop(Looper.java:137)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-07 12:03:55.356: E/AndroidRuntime(589): at java.lang.reflect.Method.invokeNative(Native Method)
05-07 12:03:55.356: E/AndroidRuntime(589): at java.lang.reflect.Method.invoke(Method.java:511)
05-07 12:03:55.356: E/AndroidRuntime(589): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-07 12:03:55.356: E/AndroidRuntime(589): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-07 12:03:55.356: E/AndroidRuntime(589): at dalvik.system.NativeStart.main(Native Method)
05-07 12:03:55.356: E/AndroidRuntime(589): Caused by: java.lang.ClassNotFoundException: packgname.Activities.LoginActivity
05-07 12:03:55.356: E/AndroidRuntime(589): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
05-07 12:03:55.356: E/AndroidRuntime(589): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-07 12:03:55.356: E/AndroidRuntime(589): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
05-07 12:03:55.356: E/AndroidRuntime(589): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871)
05-07 12:03:55.356: E/AndroidRuntime(589): ... 11 more
However, in my AndroidManifest.xml there imho nothing wrong:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.fau.fsahoy.android.api15"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="15"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<application
android:icon="#drawable/fsa_launcher"
android:label="#string/AppName">
<activity
android:name=".Activities.LoginActivity"
android:label="#string/AppName">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Activities.MainMenuActivity"></activity>
<activity android:name=".Activities.ProfileActivity"></activity>
</application>
</manifest>
I'm going crazy about that issue and trying to resolve it for the last 3 hours or so :<
Currently I am rebuilding the app by copy and pasting the code over to another clean project. I hope that works. Anyway, I see that many people have that issue. What is it?
I solved the problem by creating a new Android Project and manually copy and pasted the code from the old project.
Magically then - it worked :)
Might not be the best solution - especially for large projects with a huge codebase. Yet, it worked for me :)
I had a similar "poltergeist" in my code. I don't understand the reason but it seems to be related with my activity extending FragmentActivity and having a method with the following signature: public boolean isResumed().
I renamed the method and it worked.
I am trying to set transparent panel using this tutorial in my app but whenever i use following xml to my activity it comes up with force to close
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/home_container"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="#+id/city_map_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="0DUEIIn35xtmC6Vk1JkFEF74kwkUjgb7HrUMKfA"/>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:gravity="bottom"
android:paddingLeft="5px"
android:paddingTop="5px"
android:paddingRight="5px">
<com.pocketjourney.view.TransparentPanel
android:id="#+id/transparent_panel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="5px"
android:paddingLeft="5px"
android:paddingBottom="5px"
android:paddingRight="5px">
<Button android:id="#+id/button_click_me"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click Me!"/>
</com.pocketjourney.view.TransparentPanel>
</LinearLayout>
</FrameLayout>
Thanks
logcat
07-04 00:14:09.874: DEBUG/ddm-heap(3005): Got feature list request
07-04 00:14:09.974: DEBUG/dalvikvm(55): GC freed 315 objects / 12176 bytes in 264ms
07-04 00:14:10.004: WARN/dalvikvm(101): disableGcForExternalAlloc: false
07-04 00:14:10.084: WARN/dalvikvm(3005): Unable to resolve superclass of Lcom/droidnova/android/howto/optionmenu/ControlMenu; (69)
07-04 00:14:10.084: WARN/dalvikvm(3005): Link of class 'Lcom/droidnova/android/howto/optionmenu/ControlMenu;' failed
07-04 00:14:10.094: DEBUG/AndroidRuntime(3005): Shutting down VM
07-04 00:14:10.094: WARN/dalvikvm(3005): threadid=3: thread exiting with uncaught exception (group=0x4001e390)
07-04 00:14:10.104: ERROR/AndroidRuntime(3005): Uncaught handler: thread main exiting due to uncaught exception
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.droidnova.android.howto.optionmenu/com.droidnova.android.howto.optionmenu.ControlMenu}: java.lang.ClassNotFoundException: com.droidnova.android.howto.optionmenu.ControlMenu in loader dalvik.system.PathClassLoader#448a0d70
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2497)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.ActivityThread.access$2200(ActivityThread.java:126)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.os.Handler.dispatchMessage(Handler.java:99)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.os.Looper.loop(Looper.java:123)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.ActivityThread.main(ActivityThread.java:4595)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at java.lang.reflect.Method.invokeNative(Native Method)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at java.lang.reflect.Method.invoke(Method.java:521)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at dalvik.system.NativeStart.main(Native Method)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): Caused by: java.lang.ClassNotFoundException: com.droidnova.android.howto.optionmenu.ControlMenu in loader dalvik.system.PathClassLoader#448a0d70
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
07-04 00:14:10.124: ERROR/AndroidRuntime(3005): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2489)
and now i am getting this
07-04 00:28:31.914: ERROR/ActivityManager(101): fail to set top app changed!
the XML declaration
is saying in the packages com/pocketjourney/view there will a class called TransparentPanel
so I assume your package isn't that, you will have named it yourself so you need to update your XML
com.your.package.TransparentPanel