I want to change source code of aniqroid library https://code.google.com/p/aniqroid/
I create java application, add android library to "Java Build Path" and after that "Export".
Then add jar to my android project.
Problem is that when I start my application it crashes with ClassNotFoundException of "com.sileria.android.Application" that is used in the manifest.
If I just add source code to my application, then it works fine.
I suppose that I just have lack of knowledge about building. What am I doing wrong?
I appreciate any help!
UPD:
LOGCAT:
E/AndroidRuntime(9646): java.lang.RuntimeException: Unable to instantiate application com.sileria.android.Application: java.lang.ClassNotFoundException: com.sileria.android.Application in loader dalvik.system.PathClassLoader[/data/app/com.myapp.apk]
E/AndroidRuntime(9646): Caused by: java.lang.ClassNotFoundException: com.sileria.android.Application in loader dalvik.system.PathClassLoader[/data/app/com.myapp-1.apk]
Manifest:
<application
...
android:name="com.sileria.android.Application"
...
</application>
Solved by creating library project, but it is still interesting how to make jar.
Hmm okay I see after viewing the jar archive of library what the problem might be..
I take it you want to customize to use in own app rather than change library code
You will the Application class in the library aniqroid and the Application class mention in the android manifest will be the one in your main project with your app package naming scheme..
When you first type YourApp extends Application
the IDE will give you two choices, you want the second choice which will be your application class from the library you are attempting to use.
The problem was that I have built android application using jdk 1.6, but aniqroid library using 1.7. Changing to 1.6 solved this issue.
Related
I'm trying to write a small module for netbeans.
Now, everything compiles, but when I try to run the module the follwing error occurs:
The module mtzoutgoings is not a friend of C:\Program Files (x86)\NetBeans 8.0.2\java\modules\org-netbeans-modules-java-j2seproject.jar
I've read that in the jar's MANIFEST.MF there is a section "OpenIDE-Module-Friends" in which all classes are referenced that are allowed to use the jar.
Hm. So, is there any way that I can use it for my module as well, without beeing a "friend" of the jar ?
thanks for any hint!
Thorsten
I'm developing a module for NetBeans. When I tried to run my module, I received the following error message:
The module my_module_name is not a friend of
/home/antonio/netbeans-8.2/php/modules/org-netbeans-modules-php-api-phpmodule.jar
What I did to get rid of that error message: I expanded Libraries, right-clicked PHP Module API and clicked Edit. In the dialog box, I checked Implementation Version and clicked OK.
Reference: https://markmail.org/message/qulevpr647bpvshg
I have been working on creating a simple Java desktop app using the RESTful API for Business Objects and have run into an issue. Whenever I run my app in Eclipse in works fine; whenever I export it as a 'Runnable Jar' and select the Library handling option 'Package required libraries into generated JAR' it works fine. However, whenever I try to export it using the Library handling option 'Extract required libraries into generated JAR' I get the following error after running the app:
java.lang.NoClassDefFoundError: Could not initialize class com.businessobjects.bcm.BCM
I have the 'bcm.jar' file added under a 'res' Source Folder and have it added to the Build Path. At one point I added all the JARs under the 'SAP BusinessObjects' java folder, and external folder, but it still throws the error. The problem stems from this line of code:
enterpriseSession = CrystalEnterprise.getSessionMgr().logon(userID, password, CMS, auth);
Would anyone know why I am getting said error? I really want to use the Extract option as it will improve performance as my app becomes larger. Any help resolving this issue would be greatly appreciated :)
EDIT: I would be happy to provide clarification or further detail upon request!
Seems this was introduced in SP04 and SAP has no intent of fixing it as the RESTful API wasn't designed to be used with Desktop apps.
Have you included the cryptojFIPS.jar? Leaving it out can cause the error.
I'm trying to use JRuby in projects created in Android studio. I have built the latest (as of 9/10/2014) JRuby, and have completely updated Android Studio. I have a working app that I can use to test. I have a copy of jruby.jar in the MyApp/app/libs directory. Once there I right-clicked on jruby.jar and selected "Add as Library", which presumably did something (though what I am not certain), and have added the line "compile files('libs/jruby.jar')" to the build.gradle that is in MyApp/app/.
In one of the class files I have "import org.jruby.embed.ScriptingContainer;", which Android Studio says is fine (if I hadn't added jruby.jar as a library I couldn't include this without an error). Then in one of the working methods I say "ScriptingContainer container = new ScriptingContainer();". When I run this method the app will crash. I won't try to include the whole error message, but the important part seems to be:
Caused by: java.lang.ExceptionInInitializerError
at org.jruby.embed.internal.AbstractLocalContextProvider.<init>(AbstractLocalContextProvider.java:42)
at org.jruby.embed.internal.SingletonLocalContextProvider.<init>(SingletonLocalContextProvider.java:88)
at org.jruby.embed.ScriptingContainer.getProviderInstance(ScriptingContainer.java:248)
at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:228)
at org.jruby.embed.ScriptingContainer.<init>(ScriptingContainer.java:185)
and
Caused by: java.lang.RuntimeException: unsupported Java version: 0.9
at org.jruby.RubyInstanceConfig.initGlobalJavaVersion(RubyInstanceConfig.java:1858)
at org.jruby.RubyInstanceConfig.<clinit>(RubyInstanceConfig.java:1608)
At least, those are the parts that make sense to me. I hav no idea why I would get the error "java.lang.RuntimeException: unsupported Java version: 0.9", since I am using 1.8.0_20. The rest of the errors I cannot follow. When I click on any of the files giving me an error (say AbstractLocalContextProvider.java:42) Android Studio will show the file but also say "Sources not found". That could be the problem, but I don't know why it can't find the sources.
Thanks for any help,
Brian
Uwe Kubosch (#donv70) was able to tell me the solution to this via Twitter, so credit to him, but I wanted to post the solution here in case anyone else needs it.
It was Java version that was causing the problem. In Ruboto the problem is solved here: https://github.com/ruboto/ruboto/blob/master/assets/src/org/ruboto/JRubyAdapter.java#L137
and for use in Android Studio it is necessary only to include the line: System.setProperty("jruby.bytecode.version", "1.6");
The number of course can be 1.6, 1.7, or 1.8, depending on your version of Java.
Looks like an interoperability problem between JRuby and the Dalvik VM (don't forget that you're running against Dalvik, not the Java VM).
There's a bug report at http://jira.codehaus.org/browse/JRUBY-5774 that may lead you in the right direction.
It's kind of old, and is marked 'fixed', but maybe it'll provide some clues?
I need to have access to some android classes in a non-android project (just java project) in Eclipse.
What I actually need to do:
Class c = Class.forName("android.widget.Button");
Obviously I get a java.lang.ClassNotFoundException: android.widget.Button
Can I do what I want to do?
do not ad Android Classpath Container in eclipse , instead add individual android.jar..its recommended to add the highest android version and than create a local.properties file to store the location for your build script.
I've created a GWT project using Eclipse which was working perfectly (I was able to run it in both Hosted Mode and on Google App Engine) until I tried to import the Gears API for Google Web Toolkit. After adding the following line to my java source file:
import com.google.gwt.gears.client.geolocation.Geolocation;
I get the following error when I try to compile:
19-Jun-2009 3:36:09 AM com.google.apphosting.utils.jetty.JettyLogger warn
WARNING: failed com.google.apphosting.utils.jetty.DevAppEngineWebAppContext#1c7d682{/,C:\Documents and Settings\Geoff Denning\workspace\TaskPath\war}
javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAXParserFactoryImpl not found
I've already added the gwt-gears.jar file to my \war\WEB-INF\lib directory, and I've referenced it in Eclipse as follows:
I've even opened the gwt-gears.jar file and confirmed that org/apache/xerces/jaxp/SAXParserFactoryImpl.class does exist. Can anyone give me any pointers as to why I'm getting the above error?
Check that Xerces exists in:
$JAVA_HOME/lib/endorsed
Sounds like a Java 5 issue. Also check the Java system property for:
javax.xml.parsers.SAXParserFactory
It should be:
org.apache.xerces.jaxp.SAXParserFactoryImpl
If not then that's your issue, make sure you set the system property.
Apparently this is a bug in jre 1.5. I was able to resolve the problem by switching my default JRE in Eclipse from 1.5.0_06 to 1.6.0_03, as shown below:
Thanks to Jon and Rahul for pointing me in the right direction.
This happened to me. I had conflicting JARs in my workspace. I removed one and boom it worked. The message didn't lend very well to the root of the error.
My SAXParserFactoryImpl problem was caused by gwt-gadgets.jar I had in my boot class path. Removing this JAR from the boot class path solved the problem for me. Basically you have to remove any JAR containing a SAXParserFactoryImpl class from your build path (user libs).
Remove the $JAVA_HOME/jre/lib/jaxp.properties fixed the issue.
Take a look at Trouble with Selenium (XercesImpl) and Google App Engine.
I had a similar problem with GWT / GAE (SAXParserFactoyImpl not found) and solved it by;
Importing the jar to war/WEB-INF/lib
Adding the jar to the build path