The exception is "java.lang.IllegalAccessException: access to class not allowed." That means the class was found and an attempt to instantiate it made, but there is no empty public constructor that can be called. This is well past it being declared in the manifest. Make sure the class is declared public, and it has a public empty constructor. (Normally an activity should not declare any constructors, which gives it an empty public constructor by default.)
On Sat, Jun 4, 2011 at 12:38 AM, Halsafar <[email protected]> wrote: > I have checked diff logs. I have reverted to older versions. I am > suddenly getting this error everytime I start an Activity from within > my app. I've uninstalled it off the device and completely cleaned/ > rebuilt the project multiple times. > > D/dalvikvm(13381): newInstance failed: Lca/foo/bar/TroubleClass; not > accessible to Landroid/app/Instrumentation; > D/AndroidRuntime(13381): Shutting down VM > W/dalvikvm(13381): threadid=1: thread exiting with uncaught exception > (group=0x40025a70) > E/AndroidRuntime(13381): FATAL EXCEPTION: main > E/AndroidRuntime(13381): java.lang.RuntimeException: Unable to > instantiate activity ComponentInfo{ca.foo.bar/ > ca.foo.bar.TroubleClass}: java.lang.IllegalAccessException: access to > class not allowed > > // crash happens when activity is started like so: > Intent intent = new Intent(CallerClass.this, > TroubleClass.class); > final int result = 1; > startActivityForResult(intent, result); > > I see the exception, probably the culprit but dalvik is throwing it. > I tried debugging and stepping through it. After I create the Intent > and start it up the debugger steps through dalvik code and crashes. > The only other odd thing I see is the path in ComponentInfo, but maybe > that is normal. I've taken the the TroubleClass Activity down to > nothing but an onCreate() which calls its super.onCreate(). The error > still occurs. The activity is definitely declared in > AndroidManifest.xml. This continues to happen regardless of what I > do. Even if I install older well tested versions of the app. > > Is there some way to purge an app? Maybe some .class file got locked > or something and won't delete? > > > Thanks! > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

