4

I created a project in previous version of android studio and I changed "os "of my Laptop! I lost everything including android studio but again I downloaded it and imported the project to new version . when I run the project it shows this error

06-27 17:08:45.010 7440-7440/com.example.vinay.finsert W/ContextImpl: Unable to create files subdir /data/data/com.example.vinay.finsert/cache
06-27 17:08:45.010 7440-7440/com.example.vinay.finsert E/ActivityThread: Unable to setupGraphicsSupport due to missing cache directory
06-27 17:08:45.031 7440-7440/com.example.vinay.finsert W/ContextImpl: Unable to create files subdir /data/data/com.example.vinay.finsert/cache
06-27 17:08:45.035 7440-7440/com.example.vinay.finsert D/AndroidRuntime: Shutting down VM
06-27 17:08:45.046 7440-7440/com.example.vinay.finsert E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.vinay.finsert, PID: 7440
java.lang.RuntimeException: Unable to instantiate application com.android.tools.fd.runtime.BootstrapApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.io.File.getPath()' on a null object reference
at android.app.LoadedApk.makeApplication(LoadedApk.java:564)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4566)
at android.app.ActivityThread.access$1600(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1382)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.io.File.getPath()' on a null object reference
at com.android.tools.fd.runtime.BootstrapApplication.attachBaseContext(BootstrapApplication.java:235)
at android.app.Application.attach(Application.java:181)
at android.app.Instrumentation.newApplication(Instrumentation.java:996)
at android.app.Instrumentation.newApplication(Instrumentation.java:980)
at android.app.LoadedApk.makeApplication(LoadedApk.java:559)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4566) 
at android.app.ActivityThread.access$1600(ActivityThread.java:154) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1382) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5294) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Patryk
  • 22,602
  • 44
  • 128
  • 244
Chatrapati Shiva
  • 343
  • 1
  • 3
  • 13
  • Possible duplicate of [What is a NullPointerException, and how do I fix it?](http://stackoverflow.com/questions/218384/what-is-a-nullpointerexception-and-how-do-i-fix-it) – kalabalik Jun 27 '16 at 12:02
  • I am also having a same problem after upgrading to 6.0. have you got any solution? – Swapnil Meshram Aug 24 '16 at 10:28
  • Are you using a rooted device? Same thing has been happening to me and **ever since I've "re-rooted" the device with a different rooting app the issue disapeared**. The issue was that after installing the app, something always deleted the _data/data/com.{appName}_ directory. And the app probably can't re-create it again when its running - hence the errors. – user2347921 Jun 17 '20 at 19:42

0 Answers0