• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Unable to instantiate main activity

 
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I write a android app to download PDf file from link.below is main activity




when i run this below is the error i a getting

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A good developer always pays close attention to the information which the stack trace provides.
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
09-16 10:49:06.791: W/dalvikvm(6723): Link of class 'Lcom/android/pdf/MainActivity;' failed
i don't know how it comes to Lcom.android.pdf. It should be com.android.pdf.

below is my manifest file,Manesh please advice.

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sam liya wrote:09-16 10:49:06.791: W/dalvikvm(6723): Link of class 'Lcom/android/pdf/MainActivity;' failed


That's not the first error message in the stack trace - the root cause is something else.
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why it gives me ClassNotFoundException.I have already declared it on the manifest file.?
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sam liya wrote:why it gives me ClassNotFoundException.I have already declared it on the manifest file.?


Ulf Dittmer wrote:

sam liya wrote:09-16 10:49:06.791: W/dalvikvm(6723): Link of class 'Lcom/android/pdf/MainActivity;' failed


That's not the first error message in the stack trace - the root cause is something else.


Maneesh Godbole wrote:A good developer always pays close attention to the information which the stack trace provides.

 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why it unable to find MainActivity?
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you notice this line

Do you know what it means? Are you curious what it means? Did you google it?
Please ShowSomeEffort instead of just dumping your stack trace and waiting for someone to tell you what you are doing wrong
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i serached internet manesh.BUt those answers did not worked for me.
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which answers did you find on the net that did not work for you?
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)Right Click on your Project then

Goto Build Path-> Configure Build Path -> Order and Export

when you are there you should check the Android Private Libraries and then click OK.

if you still face the problem delete all the files inside your bin folder and rebuilt you project.

Hope this solves your issue

2)
Configure Build Path.
Choose Order and Export Tab,
Select all the listed path or JAR file.
And Try it!
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Instead of searching for Unable to resolve superclass of Activity try Unable to resolve superclass of ActionBarActivity
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I done below thing .but not worked for me

 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

You can add an ActionBar to your activity when running on API level 7 or higher by extending this class for your activity and setting the activity theme to Theme.AppCompat or a similar theme.


https://developer.android.com/reference/android/support/v7/app/ActionBarActivity.html

http://stackoverflow.com/questions/17897247/actionbaractivity-catch-an-error-on-phone

Hint: Theme
 
shawn peter
Ranch Hand
Posts: 1325
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I added the theme to my manifest file as below.




Still i am getting below error.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic