Android unable to create files directory -
on samsung galaxy s5 (android 4.4.2), after installing, click app, , crashes. crash stack is
08-18 13:58:48.191 10816-10851/com.example.galina.demo w/contextimpl: unable create files directory /data/data/com.example.galina.demo/files 08-18 13:58:48.191 10816-10816/com.example.galina.demo e/androidruntime: fatal exception: main process: com.example.galina.demo, pid: 10816 java.lang.runtimeexception: unable create application com.example.galina.demo.mainapplication: java.lang.nullpointerexception @ android.app.activitythread.handlebindapplication(activitythread.java:4752) @ android.app.activitythread.access$1600(activitythread.java:172) @ android.app.activitythread$h.handlemessage(activitythread.java:1368) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:146) @ android.app.activitythread.main(activitythread.java:5653) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1291) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:1107) @ dalvik.system.nativestart.main(native method) caused by: java.lang.nullpointerexception @ com.example.cll.android.androidcll.<init>(androidcll.java:42) @ com.example.util.telemetry.clllogger.<init>(clllogger.java:113) @ com.example.util.ttlcoreimpl.initialize(ttlcoreimpl.java:134) @ com.example.util.core.ttlcore.initialize(ttlcore.java:24) @ com.example.galina.demo.mainapplication.oncreate(mainapplication.java:25) @ android.app.instrumentation.callapplicationoncreate(instrumentation.java:1013) @ android.app.activitythread.handlebindapplication(activitythread.java:4749) @ android.app.activitythread.access$1600(activitythread.java:172) @ android.app.activitythread$h.handlemessage(activitythread.java:1368) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop(looper.java:146) @ android.app.activitythread.main(activitythread.java:5653) @ java.lang.reflect.method.invokenative(native method) @ java.lang.reflect.method.invoke(method.java:515) @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1291) @ com.android.internal.os.zygoteinit.main(zygoteinit.java:1107) @ dalvik.system.nativestart.main(native method)
the mainapplication.java doing initiating work, , has lot codes... line @ androidcll.java:42
string datapath = context.getfilesdir().getpath();
with context
null. context
passed in getapplicationcontext() mainapplication.oncreate().
the reason why context null vm shutdown caused uncaught exception, exception related unable create files directory /data/data/com.example.galina.demo/files
checked directory /data/data/, there's no folder com.microsoft.mmx.sdkdemo
. doesn't happen every time, @ high possibility. test other apps on device, there's no problem. it's weird why fails create directory.
you have inform android application needs write external storage adding uses-permission entry in androidmanifest.xml file.
<uses-permission android:name="android.permission.write_internal_storage"/>
Comments
Post a Comment