This may seem like a silly question, but what exactly happens when I delete the / src folder of an Android project from the “build path” (only MainActivity / gen remains)? I can still compile and run the project, so what does the build path do?
Background: I'm a little embarrassed about importing a maven project into Eclipse. It has a directory structure / src / main / package, so when importing, all declared package names do not match (obviously, a well-known problem). My first attempt was to simply move packages to the folder structure (directly in / src) before importing the project, but this gave me a ton of other problems (regarding importing other packages).
The second attempt was (it was recommended on several issues on SO) to simply remove the / src folder from the build path and voila, work with package declarations and no longer show problems in Eclipse, but I had a very strange runtime problem, and I do not know if this is due to my removal of the / src folder from the build path.
Edit: there is an error starting the application. I must add that MyApplication is not an Activity, but it extends the application (used to store global variables). Google maps are used in this project, but not in the first action.
02-20 14:39:34.781: E/AndroidRuntime(1479): FATAL EXCEPTION: main
02-20 14:39:34.781: E/AndroidRuntime(1479): java.lang.RuntimeException: Unable to instantiate application com.example.myapp.MyApplication: java.lang.ClassNotFoundException: Didn't find class "com.example.myapp.MyApplication" on path: /system/framework/com.google.android.maps.jar:/data/app/com.example.myapp-1.apk
02-20 14:39:34.781: E/AndroidRuntime(1479): at android.app.LoadedApk.makeApplication(LoadedApk.java:504)
02-20 14:39:34.781: E/AndroidRuntime(1479): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4364)
02-20 14:39:34.781: E/AndroidRuntime(1479): at android.app.ActivityThread.access$1300(ActivityThread.java:141)
02-20 14:39:34.781: E/AndroidRuntime(1479): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1294)
02-20 14:39:34.781: E/AndroidRuntime(1479): at android.os.Handler.dispatchMessage(Handler.java:99)
02-20 14:39:34.781: E/AndroidRuntime(1479): at android.os.Looper.loop(Looper.java:137)
02-20 14:39:34.781: E/AndroidRuntime(1479): at android.app.ActivityThread.main(ActivityThread.java:5039)
02-20 14:39:34.781: E/AndroidRuntime(1479): at java.lang.reflect.Method.invokeNative(Native Method)
02-20 14:39:34.781: E/AndroidRuntime(1479): at java.lang.reflect.Method.invoke(Method.java:511)
02-20 14:39:34.781: E/AndroidRuntime(1479): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-20 14:39:34.781: E/AndroidRuntime(1479): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-20 14:39:34.781: E/AndroidRuntime(1479): at dalvik.system.NativeStart.main(Native Method)
02-20 14:39:34.781: E/AndroidRuntime(1479): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.myapp.MyApplication" on path: /system/framework/com.google.android.maps.jar:/data/app/com,example.myapp-1.apk
02-20 14:39:34.781: E/AndroidRuntime(1479): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
02-20 14:39:34.781: E/AndroidRuntime(1479): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
02-20 14:39:34.781: E/AndroidRuntime(1479): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
02-20 14:39:34.781: E/AndroidRuntime(1479): at android.app.Instrumentation.newApplication(Instrumentation.java:968)
02-20 14:39:34.781: E/AndroidRuntime(1479): at android.app.LoadedApk.makeApplication(LoadedApk.java:499)
02-20 14:39:34.781: E/AndroidRuntime(1479): ... 11 more
source
share