I am working on an Android application. when I run my App below api 16 it works fine but when it runs on a post api 16 phone it crashes. Here is a the logact log which appears when it crashes.
06-19 20:20:05.096 5812-5812/com.ets.medecord W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x42011898)
06-19 20:20:05.106 5812-5812/com.ets.medecord E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ets.medecord/com.ets.medecord.SignupActivity2}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2218)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2268)
at android.app.ActivityThread.access$600(ActivityThread.java:148)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1263)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5162)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:756)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:572)
at miui.dexspy.DexspyInstaller.main(DexspyInstaller.java:171)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.ets.medecord.SignupActivity2.onCreate(SignupActivity2.java:72)
at android.app.Activity.performCreate(Activity.java:5135)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at com.lbe.security.service.core.client.b.x.callActivityOnCreate(Unknown Source)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2182)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2268)
at android.app.ActivityThread.access$600(ActivityThread.java:148)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1263)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5162)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:756)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:572)
at miui.dexspy.DexspyInstaller.main(DexspyInstaller.java:171)
at dalvik.system.NativeStart.main(Native Method)
To see code of the activity you can checkout this gist https://gist.github.com/darthvish/873dc292c841e5c86312
As you are using some deprecated features, so it may not supported for some API levels. For this you can check the api level as well as version before using the deprecated features using if condition. For example :
if(Build.VERSION.RELEASE.equals("4.4.4")) {
//Do somthing
}
Related
When I launch my app on device with android studio 2.0 Preview it works fine, but then when I open android studio 1.2 and try to launch it , it doesnt Launch and it crashes? Does anyone have same problem or know how to fix this ?
I get this error:
12-23 09:41:14.023 26953-26953/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication: java.lang.ClassNotFoundException: com.android.tools.fd.runtime.BootstrapApplication
at android.app.LoadedApk.makeApplication(LoadedApk.java:501)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4170)
at android.app.ActivityThread.access$1400(ActivityThread.java:134)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4867)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.android.tools.fd.runtime.BootstrapApplication
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
at android.app.Instrumentation.newApplication(Instrumentation.java:982)
at android.app.LoadedApk.makeApplication(LoadedApk.java:496)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4170)
at android.app.ActivityThread.access$1400(ActivityThread.java:134)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4867)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774)
at dalvik.system.NativeStart.main(Native Method)
12-23 09:41:14.083 2025-2049/? E/android.os.Debug﹕ !#Dumpstate > dumpstate -k -t -z -d -o /data/log/dumpstate_app_error
The problem probably occurs because of your android build tools and/or gradle configuration.
Can you check/change:
The classpath of the android build tool you are using to build the app (e.g: classpath 'com.android.tools.build:gradle:1.2.3')
The buildToolVersion of your gradle script (e.g: buildToolsVersion '23.0.2')
And finally if all these informations seems OK for you, you can check in this file <project folder>/.idea/gradle.xml the gradle_home.
e.g:
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.4" />
The last days I get this error, but only on devices with Android older than 4.4.
java.lang.ExceptionInInitializerError
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:217)
at com.orm.util.ReflectionUtil.getDomainClass(ReflectionUtil.java:273)
at com.orm.util.ReflectionUtil.getDomainClasses(ReflectionUtil.java:257)
at com.orm.SchemaGenerator.createDatabase(SchemaGenerator.java:37)
at com.orm.SugarDb.onCreate(SugarDb.java:26)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:252)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
at com.orm.SugarDb.getDB(SugarDb.java:36)
at com.orm.SugarRecord.find(SugarRecord.java:194)
at com.orm.SugarRecord.listAll(SugarRecord.java:99)
at co.getcontrol.service.AccountsService.getAnyAccount(AccountsService.java:142)
at co.getcontrol.ui.MainActivity.onCreate(MainActivity.java:191)
at android.app.Activity.performCreate(Activity.java:5244)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1082)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2034)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2095)
at android.app.ActivityThread.access$600(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4849)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.Error
at com.timgroup.jgravatar.internal.com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator$1.run(UnsignedBytes.java:259)
at java.security.AccessController.doPrivileged(AccessController.java:45)
at com.timgroup.jgravatar.internal.com.google.common.primitives.UnsignedBytes$LexicographicalComparatorHolder$UnsafeComparator.<clinit>(UnsignedBytes.java:248)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:217)
at com.orm.util.ReflectionUtil.getDomainClass(ReflectionUtil.java:273)
at com.orm.util.ReflectionUtil.getDomainClasses(ReflectionUtil.java:257)
at com.orm.SchemaGenerator.createDatabase(SchemaGenerator.java:37)
at com.orm.SugarDb.onCreate(SugarDb.java:26)
at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:252)
at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
at com.orm.SugarDb.getDB(SugarDb.java:36)
at com.orm.SugarRecord.find(SugarRecord.java:194)
at com.orm.SugarRecord.listAll(SugarRecord.java:99)
at co.getcontrol.service.AccountsService.getAnyAccount(AccountsService.java:142)
at co.getcontrol.ui.MainActivity.onCreate(MainActivity.java:191)
at android.app.Activity.performCreate(Activity.java:5244)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1082)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2034)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2095)
at android.app.ActivityThread.access$600(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1201)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4849)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
at dalvik.system.NativeStart.main(Native Method)
and as you can see, there is SugarDb. This is not completely my project and I don't know how the Sugar added to the project - there is no such dependency in gradle and no extern library in the folder. Moreover you can see, that there is jgravatar library in the error log. But the app craches in the place, where isn't any jgravatar object. It is used later in other activities.
I guess it's something wrong with libraries, because the code works on other devices.
I found the solution. The problem was jgravatar library. I changed it to gravatar-android and now it woks again
I am building an application in which I am inserting events directly to the calendar plus I left the possibility to invite someone else and everything is perfectly fine if I execute it on android sdk version 19 and above, on lower versions I get an exception.
Here is the source:
ContentResolver atend = getContentResolver();
ContentValues val = new ContentValues();
val.put(CalendarContract.Attendees.ATTENDEE_NAME, "Bajo");
val.put(CalendarContract.Attendees.ATTENDEE_EMAIL, someonesEmail);
val.put(CalendarContract.Attendees.ATTENDEE_RELATIONSHIP, CalendarContract.Attendees.RELATIONSHIP_ATTENDEE);
val.put(CalendarContract.Attendees.ATTENDEE_TYPE, CalendarContract.Attendees.TYPE_REQUIRED);
val.put(CalendarContract.Attendees.ATTENDEE_STATUS, CalendarContract.Attendees.ATTENDEE_STATUS_INVITED);
val.put(CalendarContract.Attendees.EVENT_ID, eventID);
Uri muri= atend.insert(CalendarContract.Attendees.CONTENT_URI, val);
Log.d("Atendees URI:",muri.toString());
long Aeventid=Long.parseLong(muri.getLastPathSegment());
the Exception:
03-05 19:45:59.681 1255-1266/? E/DatabaseUtils﹕ Writing exception to parcel
android.database.sqlite.SQLiteDoneException
at android.database.sqlite.SQLiteConnection.nativeExecuteForLong(Native Method)
at android.database.sqlite.SQLiteConnection.executeForLong(SQLiteConnection.java:591)
at android.database.sqlite.SQLiteSession.executeForLong(SQLiteSession.java:652)
at android.database.sqlite.SQLiteStatement.simpleQueryForLong(SQLiteStatement.java:107)
at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:816)
at android.database.DatabaseUtils.longForQuery(DatabaseUtils.java:804)
at com.android.providers.calendar.CalendarDatabaseHelper.duplicateEvent(CalendarDatabaseHelper.java:3311)
at com.android.providers.calendar.CalendarProvider2.insertInTransaction(CalendarProvider2.java:2265)
at com.android.providers.calendar.SQLiteContentProvider.insert(SQLiteContentProvider.java:96)
at android.content.ContentProvider$Transport.insert(ContentProvider.java:201)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:148)
at android.os.Binder.execTransact(Binder.java:367)
at dalvik.system.NativeStart.run(Native Method)
03-05 19:45:59.681 1632-1632/? D/AndroidRuntime﹕ Shutting down VM
03-05 19:45:59.681 1632-1632/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0xb2f7e288)
03-05 19:45:59.681 1632-1632/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.IllegalStateException: Could not execute method of the activity
at android.view.View$1.onClick(View.java:3591)
at android.view.View.performClick(View.java:4084)
at android.view.View$PerformClick.run(View.java:16966)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3586)
at android.view.View.performClick(View.java:4084)
at android.view.View$PerformClick.run(View.java:16966)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.database.sqlite.SQLiteException
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:184)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
at android.content.ContentProviderProxy.insert(ContentProviderNative.java:420)
at android.content.ContentResolver.insert(ContentResolver.java:864)
at com.example.rusev.vetcalendar.MainActivity.insertToCalendarImmunization(MainActivity.java:809)
at com.example.rusev.vetcalendar.MainActivity.syncToCalendar(MainActivity.java:931)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at android.view.View$1.onClick(View.java:3586)
at android.view.View.performClick(View.java:4084)
at android.view.View$PerformClick.run(View.java:16966)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Can you help me to identify what I miss?
I am trying my hand at developing simple apps with the Android Studio and I cannot seem to run even the default app with a blank activity containing the string "Hello World". When I try and run a device on a running Emulator, it gives me an error message and says it the app is not compatible on a watch. I don't know why it would think the emulator is a watch, but I don't know why I cannot emulate an app without changing anything manifest on the simplest AVD provided. Here is an image of the compatibility http://imgur.com/DEWoaON
08-26 16:09:16.500 733-733/com.example.mac.trial3 E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.example.mac.trial3, PID: 733
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.mac.trial3/com.example.mac.trial3.MyActivity}: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2197)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5026)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
at com.android.internal.policy.impl.PhoneWindow.requestFeature(PhoneWindow.java:275)
at com.android.internal.policy.impl.PhoneWindow.generateLayout(PhoneWindow.java:2872)
at com.android.internal.policy.impl.PhoneWindow.installDecor(PhoneWindow.java:3129)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:303)
at android.app.Activity.setContentView(Activity.java:1930)
at com.example.mac.trial3.MyActivity.onCreate(MyActivity.java:14)
at android.app.Activity.performCreate(Activity.java:5242)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2161)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2258)
at android.app.ActivityThread.access$800(ActivityThread.java:138)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1209)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5026)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
at dalvik.system.NativeStart.main(Native Method)
I'm trying to use Log4j2 on Android, it fails with the following stacktrace. Android has no javax.naming support, and I don't really need this plugin in log4j2.
How can I disable Log4j2 JNDI plugin? (Or any other standard plugin)
07-04 11:36:17.088 1573-1573/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.ExceptionInInitializerError
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ExceptionInInitializerError
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.locateContext(ClassLoaderContextSelector.java:218)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:144)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:80)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:72)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:37)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:473)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:418)
at com.altius.epos2.MyActivity.<clinit>(MyActivity.java:17)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.VerifyError: org/apache/logging/log4j/core/lookup/JndiLookup
at org.apache.logging.log4j.core.lookup.Interpolator.<init>(Interpolator.java:75)
at org.apache.logging.log4j.core.config.AbstractConfiguration.<init>(AbstractConfiguration.java:99)
at org.apache.logging.log4j.core.config.NullConfiguration.<init>(NullConfiguration.java:29)
at org.apache.logging.log4j.core.LoggerContext.<clinit>(LoggerContext.java:63)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.locateContext(ClassLoaderContextSelector.java:218)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:144)
at org.apache.logging.log4j.core.selector.ClassLoaderContextSelector.getContext(ClassLoaderContextSelector.java:80)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:72)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:37)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:473)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:418)
at com.altius.epos2.MyActivity.<clinit>(MyActivity.java:17)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1319)
at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
at android.app.ActivityThread.access$600(ActivityThread.java:130)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
You are using RC-2? Please raise this on the log4j2 Jira issue tracker so it will be fixed for the upcoming 2.0 release.
I am trying the same thing and encountered a similar problem with JNDI, i created a JIRA https://issues.apache.org/jira/browse/LOG4J2-703 with my code and the stacktrace i obtained.