Skip to content

Loading…

[Issue with demo application]Unable to instantiate application com.novoda.imageloader.demo.DemoApplication: java.lang.ClassNotFoundException: com.novoda.imageloader.demo.DemoApplication in loader #85

Closed
mickaelDev opened this Issue · 6 comments

2 participants

@mickaelDev

Hello, i can't run the demo application. I have this error :

12-30 15:31:48.264: E/AndroidRuntime(965): java.lang.RuntimeException: Unable to instantiate application com.novoda.imageloader.demo.DemoApplication: java.lang.ClassNotFoundException: com.novoda.imageloader.demo.DemoApplication in loader dalvik.system.PathClassLoader[/data/app/com.novoda.imageloader.demo-2.apk]
12-30 15:31:48.264: E/AndroidRuntime(965): at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:649)
12-30 15:31:48.264: E/AndroidRuntime(965): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4232)
12-30 15:31:48.264: E/AndroidRuntime(965): at android.app.ActivityThread.access$3000(ActivityThread.java:125)
12-30 15:31:48.264: E/AndroidRuntime(965): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2071)
12-30 15:31:48.264: E/AndroidRuntime(965): at android.os.Handler.dispatchMessage(Handler.java:99)
12-30 15:31:48.264: E/AndroidRuntime(965): at android.os.Looper.loop(Looper.java:123)
12-30 15:31:48.264: E/AndroidRuntime(965): at android.app.ActivityThread.main(ActivityThread.java:4627)
12-30 15:31:48.264: E/AndroidRuntime(965): at java.lang.reflect.Method.invokeNative(Native Method)
12-30 15:31:48.264: E/AndroidRuntime(965): at java.lang.reflect.Method.invoke(Method.java:521)
12-30 15:31:48.264: E/AndroidRuntime(965): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-30 15:31:48.264: E/AndroidRuntime(965): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-30 15:31:48.264: E/AndroidRuntime(965): at dalvik.system.NativeStart.main(Native Method)
12-30 15:31:48.264: E/AndroidRuntime(965): Caused by: java.lang.ClassNotFoundException: com.novoda.imageloader.demo.DemoApplication in loader dalvik.system.PathClassLoader[/data/app/com.novoda.imageloader.demo-2.apk]
12-30 15:31:48.264: E/AndroidRuntime(965): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
12-30 15:31:48.264: E/AndroidRuntime(965): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
12-30 15:31:48.264: E/AndroidRuntime(965): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
12-30 15:31:48.264: E/AndroidRuntime(965): at android.app.Instrumentation.newApplication(Instrumentation.java:942)
12-30 15:31:48.264: E/AndroidRuntime(965): at android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:644)
12-30 15:31:48.264: E/AndroidRuntime(965): ... 11 more

@peter-budo

Can you please provide more details in regards of how we can reproduce this error? What did you do when trying to run the application

@mickaelDev

I never have succeeds in compiling the project. It is too complicated. I ever had as many difficulties to make function a project. I find that damage because that looks very interesting. But there I am discouraged.It is during compilation that I have an error.

@peter-budo

Well if you cannot setup your environment then you not gone be able get this project working. What you need is to download Maven, extracted somewhere on your disc (Windows system top level of C:\ drive is good choice, in case of Unix systems /home/USER_NAME, or Mac OS /Users/USER_NAME). After this you only need to notify system of Maven availability
For MacOS

M2_HOME=/Users/Peter/apache-maven-3.0.4;
PATH=$M2_HOME/bin;

For Windows

M2_HOME=C:\apache-maven-3.0.4
PATH=%M2_HOME%\bin;

In command line or terminal confirm that Maven installed correctly by executing following command

mvn build

and you will see something like bellow, complaining that it cannot build because pom.xml not found

[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.139s
[INFO] Finished at: Sun Dec 30 15:34:37 GMT 2012
[INFO] Final Memory: 2M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/Users/Peter). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException

If you have any problems with above let me know I will do my best to assist.

@mickaelDev

done. Can't you make a android project without using maven? I do not only think of being in this case.

@peter-budo

Answer is yes and no in same time. Why? Because we would have to manually manage and download all these libraries project is dependent on also compile proces wouldn't be simple 3 words command (you would have to compile first core; then you would have to compile demo and provide links to core; plus we or you, if interested, wouldn't be able to easily manage project tests and more) as just executing mvn clean install on project top pom.xml. In these times use of building tools like Maven or Gradle is essential (there is also Ant and Ivy, but we consider them out of date).

Now since you have Maven install, in command line navigate to project location. You should have either device pluged or an emulator running. From inside of image loader directory execute

mvn clean install

and if everything is right whole project will be builded for you and deployed either on device or emulator.

@peter-budo peter-budo was assigned
@peter-budo

Closed due to no further communication

@peter-budo peter-budo closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.