I have a problem with the new ActionBarSherlock.
I have to link it to my project and use it's features (Fragments, etc), in a project that supports android API level 7 and above.
I have created a module in intelij with my project, and I've linked the ActionBarSherlock library project to it. Everything looks good, the project rebuilds correctly, deploy a valid apk to emulator, but when I'm trying to run the application I got something like this:
WARN/dalvikvm(540): Unable to resolve superclass of Lcom/mobileinsight/common/CustomActivity; (134)
WARN/dalvikvm(540): Link of class 'Lcom/mobileinsight/common/CustomActivity;' failed
WARN/dalvikvm(540): Unable to resolve superclass of Lcom/mobileinsight/ui/SplashActivity; (175)
WARN/dalvikvm(540): Link of class 'Lcom/mobileinsight/ui/SplashActivity;' failed
WARN/dalvikvm(540): threadid=3: thread exiting with uncaught exception (group=0x4001b188)`
ERROR/AndroidRuntime(540): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mobileinsight/com.mobileinsight.ui.SplashActivity}: java.lang.ClassNotFoundException: com.mobileinsight.ui.SplashActivity in loader dalvik.system.PathClassLoader#45f352e8
I get the error when the application tries to instantiate an activity that extends SherlockActivity or FragmentSherlockActivity
Somebody can help me with this?
Thanks,
Ark
Related
I have used this library project in my app [Scan document library]
I have also included OpenCv android SDk in my app.
The app is getting compiled fine. After running, onclick of scan button ,
The ScanActivity is not getting recognised. It gives following error:
android.content.ActivityNotFoundException: Unable to find explicit
activity class {com.myapptest/com.scanlibrary.ScanActivity}
I have a Unity game which uses an Android Library packed in an AAR (library.aar). However, I need to access the Main Activity's lifecycle callbacks (onPause(), onResume(), to name a few).
So I created a new library project in Android Studio (let's call this plugin). I imported library.aar into plugin and added it to the Dependencies. I tested it by calling the functions inside library.aar inside MainActivity. It doesn't throw any errors at this point.
In MainActivity, I called Library.onActivityResult(), Library.onResume(), and Library.onPause() in the respective functions.
Next, I added the classes.jar from Unity/Editor/Data/PlaybackEngines/androidplayer/release/bin into my plugin project. I added the JAR into the dependencies. I tested it by trying to subclass UnityPlayerActivity. Again, no errors yet.
I compile plugin into plugin-debug.aar and put it in Assets/Plugins/Android. I also created an AndroidManifest.xml which I got from the Unity Manual and put it inside Assets/Plugins.
I call the functions from a button in a Unity scene like so:
AndroidJavaClass jc = new AndroidJavaClass("com.alxcyl.plugin.MainActivity");
jc.CallStatic("connect");
// "connect" is a static function in the Java class MainActivity containing
// a short message like so:
// Log.d("My Plugin", "connect() was called");
I build the game and run it on my Android device. If I click the button, MyPlugin.connect() is properly called since it logs the message it's supposed to when clicked.
I think the lifecycle callbacks are properly called but the problem is that it logs an error saying:
I/dalvikvm( 5466): Could not find method com.somecompany.library.Library.onActivityResult, referenced from method com.alxcyl.plugin.MainActivity.onActivityResult
W/dalvikvm( 5466): VFY: unable to resolve virtual method 276: Lcom/somecompany/library/Library;.onActivityResult (IILandroid/content/Intent;)V
I/dalvikvm( 5466): Could not find method com.somecompany.library.Library.onPause, referenced from method com.alxcyl.plugin.MainActivity.onPause
W/dalvikvm( 5466): VFY: unable to resolve virtual method 276: Lcom/somecompany/library/Library;.onPause()V
I/dalvikvm( 5466): Could not find method com.somecompany.library.Library.onResume, referenced from method com.alxcyl.plugin.MainActivity.onResume
W/dalvikvm( 5466): VFY: unable to resolve virtual method 276: Lcom/somecompany/library/Library;.onResume()V
D/MyPlugin( 5466): connect() was called
I'm not sure what causes it. When you build the plugin project, it builds fine without any errors but when you access it through Unity, it doesn't work. I tried to use the same library.aar into a new Android project and Library.onActivityResult(), Library.onPause(), and Library.onResume() definitely exists and are properly called.
Could it be that Unity can't handle AARs that include AARs? Is there a fix for this?
Looks like the .jar file with all your compiled code is missing in the .aar library.
Unity compiles its own .jar file with all .jar files from all plugins together, into one .dex file.
On Unity forums, you posted "class not found" error; here you mention "method not found". Anyway, something seems to be wrong with your .aar file.
I'm trying to import actionbarcherlok project inside my project (actionbarsherlok is a project marked with "is library")
My project includes yet support-v4 library, so when I import sherlock action bar (that also includes support-v4 library) I obtains the following error:
Found 2 versions of android-support-v4.jar in the dependency list,
but not all the versions are identical (check is based on SHA-1 only at this time).
That means I have to remove one library.
I have removed the support-v4 library that was already in my project, but I obratin an error at this line
public class ReminderCreation extends FragmentActivity{
because FragmentActivity was taken from support-v4 library:
android.support.v4.app.FragmentActivity
I can I solve this problem? Can I refer to the support-v4 library included in the sherlock project?
NOTE:
I have also tryied changing FramentActivity into SherlokFragmentactivity, obtaining this error:
The hierarchy of the type ReminderCreation is inconsistent.
EDIT:
If I introduce this modification (suggested by #ascorbin) and I otain this error at runtime:
10-17 09:30:12.190: E/dalvikvm(1877): Could not find class 'com.nostra13.universalimageloader.core.ImageLoaderConfiguration$Builder', referenced from method host.framework.ApplicationFramework.onCreate
10-17 09:30:12.190: W/dalvikvm(1877): VFY: unable to resolve new-instance 489 (Lcom/nostra13/universalimageloader/core/ImageLoaderConfiguration$Builder;) in Lhost/framework/ApplicationFramework;
10-17 09:30:12.190: E/AndroidRuntime(1877): FATAL EXCEPTION: main
10-17 09:30:12.190: E/AndroidRuntime(1877): java.lang.NoClassDefFoundError: com.nostra13.universalimageloader.core.ImageLoaderConfiguration$Builder
at this line:
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
inside a class that extends Application
(I have never get this error before)
The error didn't mean that you had to delete one support-jar but that they all have to be the same version. Delete the support library from both projects, then right-click -> android -> add support library for both, then they'll both have the same jar.
I am trying to use Xuggler on Android to convert WAV files to M4A.
I have used the xuggle-xuggler-noarch-5.4.jar in my java build path
and copied the libxuggler.so file out of xuggle-xuggler-arch-i686-pc-linux-gnu.jar to my libs folder within my android application.
in my main activity i have a static initialiser that attempts to System.loadlibrary("libxuggler")
however i just get these set of info and error messages
I/dalvikvm(27614): Could not find method com.xuggle.mediatool.ToolFactory.makeReader, referenced from method com.example.quality.MainActivity.convertToMP3
W/dalvikvm(27614): VFY: unable to resolve static method 3376: Lcom/xuggle/mediatool/ToolFactory;.makeReader (Ljava/lang/String;)Lcom/xuggle/mediatool/IMediaReader;
W/dalvikvm(27614): Unable to resolve superclass of Lcom/example/quality/MainActivity$6; (485)
W/dalvikvm(27614): Link of class 'Lcom/example/quality/MainActivity$6;' failed
W/dalvikvm(27614): Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lcom/example/quality/MainActivity;
W/dalvikvm(27614): Class init failed in newInstance call (Lcom/example/quality/MainActivity;)
W/dalvikvm(27614): threadid=1: thread exiting with uncaught exception (group=0x40acf228)
My System.loadlibrary called failed with
UnsatisfiedLinkError: Couldn't load libxuggle: findLibrary returned null
is it possible to use Xuggler on Android
What have i done wrong?
What havent i done?
There is an explanation on xuggler-users group from Art Clarke :
I have not attempted to port xuggler to android, but if someone is interested all jvm related code is in the 'ferry' module. Memory mgmt is particularly complicated and hard, but in theory a port would be possible.
I'm using the Java Google APIs for an Android application. I followed the usage pattern described here for Authenication and API use: http://goo.gl/rPZ9Z
The problem I'm having is that the call to GoogleTransport.create() throws a NoClassDefFoundException. I looked at the log and the HttpHeaders class is not linking properly. I attached the Google API JAR file using the normal method in eclipse and all other classes I'm using are working correctly. Problem is that this one class in particular is not linked correctly. Here are some logs of the app running but not calling the class:
01-27 14:04:34.390: WARN/dalvikvm(422): Link of class 'Lcom/google/api/client/http/HttpHeaders;' failed
01-27 14:04:34.400: WARN/dalvikvm(422): Unable to resolve superclass of Lcom/google/api/client/googleapis/GoogleHeaders; (43)
Log of direct call to GoogleTransport.create():
01-27 16:13:11.882: ERROR/AndroidRuntime(16086): java.lang.NoClassDefFoundError: com.google.api.client.http.HttpHeaders
01-27 16:13:11.882: ERROR/AndroidRuntime(16086): at com.google.api.client.http.HttpTransport.(HttpTransport.java:145)
01-27 16:13:11.882: ERROR/AndroidRuntime(16086): at com.google.api.client.googleapis.GoogleTransport.create(GoogleTransport.java:58)
Thanks in advance!
Sounds like your project references are messed up. Try checking the library dependencies.