Question

My app is working fine on emulator and then I started to implement startapp sdk elements one by one. First I added the jar. Then I added permissions. Then I added their activities. Everything was fine. The app was still working. The next step was adding this code in onCreate method just before setContentView().

      StartAppAd.init(this, "developer id" , "app id");

I modified the line with my app id and developer id. And then I realised the app crashes. When I run my app it doesn't open and says unexpectedly closed. I checked the logcat .

It says ; Java.Lang.noClassDefFoundError: com.startapp.android.publish.StartappAd.

What is the problem?

Was it helpful?

Solution 2

I solved the problem. I deleted the jar and then bin file and then cleaned the project. The bin folder is automatically created again without the startapp jar. I also removed it by following Properties>Java Build Path. Then in this section i created a lib folder in project. Then i copied to jar in it. Then i added jar to the project.Now it works.As a result there is no need to add jar to lib folder in bin folder. A seperate lib folder is ok.

OTHER TIPS

It seems like an issue with the SDK jar export.
Please make sure you add the SDK jar to the 'libs' directory of your application project, and not as a library in the build path.
Please also do the following (assuming you are using Eclipse):

  1. Right click on your project and choose 'Properties'
  2. Choose 'Java Build Path' in the menu on the left and go to 'Order and Export' tab
  3. Make sure 'Android Private Libraries' is checked. If the StartAppInApp jar also appears there, make sure it is also checked.
  4. Clean and re-build your project ('Project' -> 'Clean...')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top