Could not find com.slidingmenu.lib.SlidingMenuActivity.apk - android

I am trying to make use of the SlidingMenu Library for Android but I get these errors:
Could not find com.slidingmenu.lib.SlidingMenuActivity.apk
and another error:
E/AndroidRuntime(24767): java.lang.NoClassDefFoundError: com.slidingmenu.lib.SlidingMenu
I have properly added the com.slidingmenu.lib.SlidingMenuActivity to the Java Build section.

What I found is that some time between June 2012 and now (August 2013) the package name changed. Performing a global search-and-replace of com.slidingmenu.lib to com.jeremyfeinstein.slidingmenu.lib fixed the problem.

Troubleshoot Android 'Could not find somelibrary.apk'
Could not find Library.apk!
Troubleshoot Android 'java.lang.NoClassDefFoundError com.somelibrary.mylibrary'
Troubleshoot NoClassDefFoundError in Java

Related

NativeScript Build - Error executing Static Binding Generator: Class not found android.support.v4.view.ViewPager.OnPageChangeListener

I'm new to NativeScript and took over a project recently upgraded from NativeScript 4 to 6. Here is my environment detials:
Windows 10
Node v16.6.1
NativeScript 8.0.2
Android Studio 11 (with al
the recommended updates to date)
VS Code 1.58.2
I can create a new Native script project with "tns create" and build/run it in the simulator just fine. However, when I try to run the project the build throws the following error:
java.lang.RuntimeException: Class not found android.support.v4.view.ViewPager.OnPageChangeListener
at org.nativescript.staticbindinggenerator.Generator.getClass(Generator.java:551)
at org.nativescript.staticbindinggenerator.Generator.getInterfacesFromCache(Generator.java:534)
at org.nativescript.staticbindinggenerator.Generator.writeBinding(Generator.java:283)
at org.nativescript.staticbindinggenerator.Generator.generateBinding(Generator.java:171)
at org.nativescript.staticbindinggenerator.Generator.processRows(Generator.java:234)
at org.nativescript.staticbindinggenerator.Generator.generateBindings(Generator.java:121)
at org.nativescript.staticbindinggenerator.Generator.writeBindings(Generator.java:97)
at org.nativescript.staticbindinggenerator.Main.main(Main.java:55)
Here is the run command I'm using: "tns run android --emulator"
I have tried tons of things and searches but no luck resolving this issue.
So I had an idea and searched with a different search engine than I normally use. I did find some ideas which helped me resolved the issue.
I had previously searched in VSCode for variations on "android.support.v4.view.ViewPager.OnPageChangeListener", but only found the log file with the error. Then I learned you have to change the filter options of the find in file search otherwise the files you are looking for can be excluded from the search results. I also used Baregrep to confirm I was getting everything.
I fixed the issue by replacing all occurrences of:
android.support.v4.view.ViewPager with androidx.viewpager.widget.ViewPager
Also you may need to install widgets:npm i tns-core-modules-widgets
Since the files where I made the changes were all non-project files (many of them in the node_modules directory) there is probably something else that involves updating Node or NativeScript that may solve this as well.
If someone else figures that out, I'll be watching this thread for updates, and thanks in advance!
Fissh

How to use EasyMock in android

I use easymock-3.2.jar in my android test project.
I find it in its Home:
2013-07-11: EasyMock 3.2 is available. Add #Mock annotations and Android support.
However , I got exception when I use it.
java.lang.NoClassDefFoundError: org.easymock.EasyMock
I googled a lot , and add
dexmaker-1.0.jar
objenesis-1.2.jar
cglib-nodep-2.2.2.jar or cglib-2.2.jar
But the exception still be there.Who can help me?
Thanks a lot.
Put the library
easymock-3.2.jar
dexmaker-1.0.jar
dexmaker-mockito-1.0.jar
in tests/libs. And it will work.
Be careful , it's in tests/libs , not in tests/lib.
It will throw
java.lang.NoClassDefFoundError: org.easymock.EasyMock
if you position them in tests/lib.
The first step is to get EasyMock. You can get the latest version from Easymock’s download page. Choose the latest version and you will get a zip file. You only need easymock-3.2.jar (3.2 will change depending on the version you choose). You will also need dexmaker for Easymock to work on Android. You can get the jar from Dexmaker’s website. Once you have both jar files put them in /tests/libs. Now you have EasyMock available in your tests.
for more detail follow below link
http://ncona.com/2013/11/writing-unit-test-for-android-with-easymock/

Error when compiling a Cocos2d-x project on Android platform

Description Resource Path Location Type
The declared package "org.cocos2dx.lib" does not match the expected package "src.org.cocos2dx.lib" Cocos2dxMusic.java /java/src/org/cocos2dx/lib line 24 Java Problem
Someone said that cocos2d-x 2.0.3 has a bug that will not create cocos2dx.lib.
Anybody know how to solve this?

NoClassDefFoundError + C2DMessaging

I update my android sdk last week to 4.0 (14) and I now have the following error when I try to use the C2DMessaging class:
java.lang.NoClassDefFoundError: com.google.android.c2dm.C2DMessaging
Does anybody already saw this error?
Best regards
add gcm.jar(client side) in your project build path.

PhoneGap 2.0 Upgrade Errors - JSCallback Error / Could not find class

I updated my Phonegap (Cordova) project from 1.9 to 2.0 and am receiving the following two new errors:
Web Console
JSCallback Error: Request failed. at file file://android_assets/www/js/cordova-2.0.0.js:3698
and
dalvikvm
Could not find class 'android.webkit.WebResourceResponse', referenced from method org.apache.cordova.CordovaWebViewClient.generatedWebResourceResponse
Is this a known problem? I have searched but can't find a solution that addresses these issues. I have tried creating a new blank project and I am getting the same errors. I have also ensured Eclipse and the SDK manager are up to date.
Any help would be much appreciated.
Thank you.
Not sure about the first question as I need to know what you are doing when that log appears.
Regarding the second question:
https://stackoverflow.com/a/12043959/41679

Categories

Resources