java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference

Appcelerator JIRA | Josh Longton | 10 months ago
  1. 0

    *Description* When installing a fresh version of the kitchen sink from the stable branch on github, The first install on the phone crashes, if you change the SDK to the 5.1.2 GA and run it works. if you change the Facebook module to the 4.0.5 and run it works. After either of these it also works on 5.2.0.v20160219124528 SDK aswell *{color:red}This is a Regression.{color}* *Steps to reproduce:* # Download a fresh install of the stable kitchen sink # Change targetSdkVersion to 23 # add Android config code below to the tiapp.xml # Run the application with the 5.2.0.v20160219124528 SDK and 5.0.0 Facebook module {code:javascript} <android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <application> <activity android:alwaysRetainTaskState="true" android:configChanges="keyboardHidden|orientation" android:label="KitchenSink" android:name=".KitchensinkActivity" android:theme="@style/Theme.Titanium"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activity android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="KitchenSinkFacebook" android:name="com.facebook.FacebookActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> <activity android:label="KitchenSinkFacebook" android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/> </application> <uses-sdk android:targetSdkVersion="23"/> </manifest> <activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity"/> <services> <service type="interval" url="testservice.js"/> </services> </android> {code} *Actual :* The application crashes *Log* {code:javascript} -- Start application log ----------------------------------------------------- [INFO] : TiApplication: (main) [0,0] checkpoint, app created. [INFO] : TiApplication: (main) [51,51] Titanium 5.2.0 (2016/02/19 12:45 fd837d1) [INFO] : DatabaseHelper: No value in database for platform key: 'unique_machine_id' returning supplied default '' [INFO] : DatabaseHelper: No value in database for platform key: 'hardware_machine_id' returning supplied default '' [INFO] : TiApplication: (main) [201,252] Titanium Javascript runtime: v8 [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null [ERROR] : TiApplication: (AsyncTask #1) [24,24] Sending event: exception on thread: AsyncTask #1 msg:java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference; Titanium 5.2.0,2016/02/19 12:45,fd837d1 [ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference [ERROR] : TiApplication: at org.appcelerator.titanium.util.TiFileHelper2.hasStoragePermission(TiFileHelper2.java:89) [ERROR] : TiApplication: at org.appcelerator.titanium.util.TiResponseCache.get(TiResponseCache.java:314) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.CacheAdapter.getJavaCachedResponse(CacheAdapter.java:103) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.CacheAdapter.get(CacheAdapter.java:47) [ERROR] : TiApplication: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:229) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:437) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java) [ERROR] : TiApplication: at com.facebook.GraphResponse.fromHttpConnection(GraphResponse.java:253) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeConnectionAndWait(GraphRequest.java:1255) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1157) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1124) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1108) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:1083) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:977) [ERROR] : TiApplication: at com.facebook.internal.Utility.getAppSettingsQueryResponse(Utility.java:868) [ERROR] : TiApplication: at com.facebook.internal.Utility.access$1(Utility.java:860) [ERROR] : TiApplication: at com.facebook.internal.Utility$1.run(Utility.java:797) [ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) [ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) [ERROR] : TiApplication: at java.lang.Thread.run(Thread.java:818) [INFO] : SQLiteConnectionPool: The connection pool for /data/user/0/com.appcelerator.kitchensink/databases/appcAnalytics.db has been closed but there are still 1 connections in use. They will be closed as they are released back to the pool. [INFO] : SQLiteConnectionPool: The connection pool for /data/user/0/com.appcelerator.kitchensink/databases/appcAnalytics.db has been closed but there are still 1 connections in use. They will be closed as they are released back to the pool. [ERROR] : TiApplication: (main) [38,62] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcelerator.kitchensink/com.appcelerator.kitchensink.KitchensinkActivity}: java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed.; Titanium 5.2.0,2016/02/19 12:45,fd837d1 [ERROR] : TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcelerator.kitchensink/com.appcelerator.kitchensink.KitchensinkActivity}: java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed. [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416) [ERROR] : TiApplication: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) [ERROR] : TiApplication: at android.app.ActivityThread.-wrap11(ActivityThread.java) [ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:148) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5417) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) [ERROR] : TiApplication: Caused by: java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed. [ERROR] : TiApplication: at android.database.sqlite.SQLiteConnectionPool.throwIfClosedLocked(SQLiteConnectionPool.java:962) [ERROR] : TiApplication: at android.database.sqlite.SQLiteConnectionPool.waitForConnection(SQLiteConnectionPool.java:677) [ERROR] : TiApplication: at android.database.sqlite.SQLiteConnectionPool.acquireConnection(SQLiteConnectionPool.java:348) [ERROR] : TiApplication: at android.database.sqlite.SQLiteSession.acquireConnection(SQLiteSession.java:894) [ERROR] : TiApplication: at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:834) [ERROR] : TiApplication: at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62) [ERROR] : TiApplication: at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:143) [ERROR] : TiApplication: at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:132) [ERROR] : TiApplication: at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:219) [ERROR] : TiApplication: at android.database.AbstractCursor.moveToNext(AbstractCursor.java:268) [ERROR] : TiApplication: at com.appcelerator.analytics.APSAnalyticsModel.getProps(APSAnalyticsModel.java:307) [ERROR] : TiApplication: at com.appcelerator.analytics.APSAnalyticsModel.addEvent(APSAnalyticsModel.java:78) [ERROR] : TiApplication: at com.appcelerator.analytics.APSAnalyticsHelper.sendAnalyticsEvent(APSAnalyticsHelper.java:523) [ERROR] : TiApplication: at com.appcelerator.analytics.APSAnalyticsHelper.postAnalyticsEvent(APSAnalyticsHelper.java:479) [ERROR] : TiApplication: at com.appcelerator.analytics.APSAnalytics.sendAppEnrollEvent(APSAnalytics.java:121) [ERROR] : TiApplication: at org.appcelerator.titanium.TiApplication.setRootActivity(TiApplication.java:498) [ERROR] : TiApplication: at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:94) [ERROR] : TiApplication: at android.app.Activity.performCreate(Activity.java:6251) [ERROR] : TiApplication: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) [WARN] : V8Object: (KrollRuntimeThread) [19,81] Runtime disposed, cannot set property 'userAgent' [INFO] : Process: Sending signal. PID: 11338 SIG: 9 {code} *GA :* The application runs *Expected:* The application runs

    Appcelerator JIRA | 10 months ago | Josh Longton
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference
  2. 0

    *Description* When installing a fresh version of the kitchen sink from the stable branch on github, The first install on the phone crashes, if you change the SDK to the 5.1.2 GA and run it works. if you change the Facebook module to the 4.0.5 and run it works. After either of these it also works on 5.2.0.v20160219124528 SDK aswell *{color:red}This is a Regression.{color}* *Steps to reproduce:* # Download a fresh install of the stable kitchen sink # Change targetSdkVersion to 23 # add Android config code below to the tiapp.xml # Run the application with the 5.2.0.v20160219124528 SDK and 5.0.0 Facebook module {code:javascript} <android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <application> <activity android:alwaysRetainTaskState="true" android:configChanges="keyboardHidden|orientation" android:label="KitchenSink" android:name=".KitchensinkActivity" android:theme="@style/Theme.Titanium"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activity android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="KitchenSinkFacebook" android:name="com.facebook.FacebookActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> <activity android:label="KitchenSinkFacebook" android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/> </application> <uses-sdk android:targetSdkVersion="23"/> </manifest> <activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity"/> <services> <service type="interval" url="testservice.js"/> </services> </android> {code} *Actual :* The application crashes *Log* {code:javascript} -- Start application log ----------------------------------------------------- [INFO] : TiApplication: (main) [0,0] checkpoint, app created. [INFO] : TiApplication: (main) [51,51] Titanium 5.2.0 (2016/02/19 12:45 fd837d1) [INFO] : DatabaseHelper: No value in database for platform key: 'unique_machine_id' returning supplied default '' [INFO] : DatabaseHelper: No value in database for platform key: 'hardware_machine_id' returning supplied default '' [INFO] : TiApplication: (main) [201,252] Titanium Javascript runtime: v8 [INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null [ERROR] : TiApplication: (AsyncTask #1) [24,24] Sending event: exception on thread: AsyncTask #1 msg:java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference; Titanium 5.2.0,2016/02/19 12:45,fd837d1 [ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference [ERROR] : TiApplication: at org.appcelerator.titanium.util.TiFileHelper2.hasStoragePermission(TiFileHelper2.java:89) [ERROR] : TiApplication: at org.appcelerator.titanium.util.TiResponseCache.get(TiResponseCache.java:314) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.CacheAdapter.getJavaCachedResponse(CacheAdapter.java:103) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.CacheAdapter.get(CacheAdapter.java:47) [ERROR] : TiApplication: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:229) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:437) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java) [ERROR] : TiApplication: at com.facebook.GraphResponse.fromHttpConnection(GraphResponse.java:253) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeConnectionAndWait(GraphRequest.java:1255) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1157) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1124) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1108) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:1083) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:977) [ERROR] : TiApplication: at com.facebook.internal.Utility.getAppSettingsQueryResponse(Utility.java:868) [ERROR] : TiApplication: at com.facebook.internal.Utility.access$1(Utility.java:860) [ERROR] : TiApplication: at com.facebook.internal.Utility$1.run(Utility.java:797) [ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) [ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) [ERROR] : TiApplication: at java.lang.Thread.run(Thread.java:818) [INFO] : SQLiteConnectionPool: The connection pool for /data/user/0/com.appcelerator.kitchensink/databases/appcAnalytics.db has been closed but there are still 1 connections in use. They will be closed as they are released back to the pool. [INFO] : SQLiteConnectionPool: The connection pool for /data/user/0/com.appcelerator.kitchensink/databases/appcAnalytics.db has been closed but there are still 1 connections in use. They will be closed as they are released back to the pool. [ERROR] : TiApplication: (main) [38,62] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcelerator.kitchensink/com.appcelerator.kitchensink.KitchensinkActivity}: java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed.; Titanium 5.2.0,2016/02/19 12:45,fd837d1 [ERROR] : TiApplication: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcelerator.kitchensink/com.appcelerator.kitchensink.KitchensinkActivity}: java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed. [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416) [ERROR] : TiApplication: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476) [ERROR] : TiApplication: at android.app.ActivityThread.-wrap11(ActivityThread.java) [ERROR] : TiApplication: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344) [ERROR] : TiApplication: at android.os.Handler.dispatchMessage(Handler.java:102) [ERROR] : TiApplication: at android.os.Looper.loop(Looper.java:148) [ERROR] : TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5417) [ERROR] : TiApplication: at java.lang.reflect.Method.invoke(Native Method) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) [ERROR] : TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) [ERROR] : TiApplication: Caused by: java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed. [ERROR] : TiApplication: at android.database.sqlite.SQLiteConnectionPool.throwIfClosedLocked(SQLiteConnectionPool.java:962) [ERROR] : TiApplication: at android.database.sqlite.SQLiteConnectionPool.waitForConnection(SQLiteConnectionPool.java:677) [ERROR] : TiApplication: at android.database.sqlite.SQLiteConnectionPool.acquireConnection(SQLiteConnectionPool.java:348) [ERROR] : TiApplication: at android.database.sqlite.SQLiteSession.acquireConnection(SQLiteSession.java:894) [ERROR] : TiApplication: at android.database.sqlite.SQLiteSession.executeForCursorWindow(SQLiteSession.java:834) [ERROR] : TiApplication: at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:62) [ERROR] : TiApplication: at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:143) [ERROR] : TiApplication: at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:132) [ERROR] : TiApplication: at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:219) [ERROR] : TiApplication: at android.database.AbstractCursor.moveToNext(AbstractCursor.java:268) [ERROR] : TiApplication: at com.appcelerator.analytics.APSAnalyticsModel.getProps(APSAnalyticsModel.java:307) [ERROR] : TiApplication: at com.appcelerator.analytics.APSAnalyticsModel.addEvent(APSAnalyticsModel.java:78) [ERROR] : TiApplication: at com.appcelerator.analytics.APSAnalyticsHelper.sendAnalyticsEvent(APSAnalyticsHelper.java:523) [ERROR] : TiApplication: at com.appcelerator.analytics.APSAnalyticsHelper.postAnalyticsEvent(APSAnalyticsHelper.java:479) [ERROR] : TiApplication: at com.appcelerator.analytics.APSAnalytics.sendAppEnrollEvent(APSAnalytics.java:121) [ERROR] : TiApplication: at org.appcelerator.titanium.TiApplication.setRootActivity(TiApplication.java:498) [ERROR] : TiApplication: at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:94) [ERROR] : TiApplication: at android.app.Activity.performCreate(Activity.java:6251) [ERROR] : TiApplication: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107) [ERROR] : TiApplication: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369) [WARN] : V8Object: (KrollRuntimeThread) [19,81] Runtime disposed, cannot set property 'userAgent' [INFO] : Process: Sending signal. PID: 11338 SIG: 9 {code} *GA :* The application runs *Expected:* The application runs

    Appcelerator JIRA | 10 months ago | Josh Longton
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference
  3. 0

    *Details:* NullPointerException is thrown in logcat if you use the latest SDK with latest Facebook module. *Notes:* This is *a regression* from SDK 5.2.0.v20160208101502 and 5.1.2.GA. *Steps to reproduce:* # In the Stable KitchenSink, open tiapp.xml # Replace the Android section with the following: {code} <android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <application> <activity android:alwaysRetainTaskState="true" android:configChanges="keyboardHidden|orientation" android:label="KitchenSink" android:name=".KitchensinkActivity" android:theme="@style/Theme.Titanium"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activity android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="KitchenSinkFacebook" android:name="com.facebook.FacebookActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> <activity android:label="KitchenSinkFacebook" android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/> </application> <uses-sdk android:targetSdkVersion="23"/> </manifest> <activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity"/> <services> <service type="interval" url="testservice.js"/> </services> </android> {code} # Make sure facebook module 5.0.0 is selected # Install KitchenSink to device # Wait for app to launch *Actual:* NullPointerException is thrown in logcat: {code} [ERROR] : TiApplication: (AsyncTask #1) [2,2] Sending event: exception on thread: AsyncTask #1 msg:java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference; Titanium 5.2.0,2016/02/19 12:45,fd837d1 [ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference [ERROR] : TiApplication: at org.appcelerator.titanium.util.TiFileHelper2.hasStoragePermission(TiFileHelper2.java:89) [ERROR] : TiApplication: at org.appcelerator.titanium.util.TiResponseCache.get(TiResponseCache.java:314) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.CacheAdapter.getJavaCachedResponse(CacheAdapter.java:103) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.CacheAdapter.get(CacheAdapter.java:47) [ERROR] : TiApplication: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:22 [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:433) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:384) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java) [ERROR] : TiApplication: at com.facebook.GraphResponse.fromHttpConnection(GraphResponse.java:253) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeConnectionAndWait(GraphRequest.java:1255) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1157) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1124) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1108) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:1083) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:977) [ERROR] : TiApplication: at com.facebook.internal.Utility.getAppSettingsQueryResponse(Utility.java:868) [ERROR] : TiApplication: at com.facebook.internal.Utility.access$1(Utility.java:860) [ERROR] : TiApplication: at com.facebook.internal.Utility$1.run(Utility.java:797) [ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) [ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) [ERROR] : TiApplication: at java.lang.Thread.run(Thread.java:818) {code} *Expected:* NullPointerException should not be thrown.

    Appcelerator JIRA | 10 months ago | Wilson Luu
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    *Details:* NullPointerException is thrown in logcat if you use the latest SDK with latest Facebook module. *Notes:* This is *a regression* from SDK 5.2.0.v20160208101502 and 5.1.2.GA. *Steps to reproduce:* # In the Stable KitchenSink, open tiapp.xml # Replace the Android section with the following: {code} <android xmlns:android="http://schemas.android.com/apk/res/android"> <manifest> <application> <activity android:alwaysRetainTaskState="true" android:configChanges="keyboardHidden|orientation" android:label="KitchenSink" android:name=".KitchensinkActivity" android:theme="@style/Theme.Titanium"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> <activity android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="KitchenSinkFacebook" android:name="com.facebook.FacebookActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> <activity android:label="KitchenSinkFacebook" android:name="com.facebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/> <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/app_id"/> </application> <uses-sdk android:targetSdkVersion="23"/> </manifest> <activity android:name="ti.modules.titanium.ui.android.TiPreferencesActivity"/> <services> <service type="interval" url="testservice.js"/> </services> </android> {code} # Make sure facebook module 5.0.0 is selected # Install KitchenSink to device # Wait for app to launch *Actual:* NullPointerException is thrown in logcat: {code} [ERROR] : TiApplication: (AsyncTask #1) [2,2] Sending event: exception on thread: AsyncTask #1 msg:java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference; Titanium 5.2.0,2016/02/19 12:45,fd837d1 [ERROR] : TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference [ERROR] : TiApplication: at org.appcelerator.titanium.util.TiFileHelper2.hasStoragePermission(TiFileHelper2.java:89) [ERROR] : TiApplication: at org.appcelerator.titanium.util.TiResponseCache.get(TiResponseCache.java:314) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.CacheAdapter.getJavaCachedResponse(CacheAdapter.java:103) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.CacheAdapter.get(CacheAdapter.java:47) [ERROR] : TiApplication: at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:22 [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:433) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:384) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:497) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105) [ERROR] : TiApplication: at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java) [ERROR] : TiApplication: at com.facebook.GraphResponse.fromHttpConnection(GraphResponse.java:253) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeConnectionAndWait(GraphRequest.java:1255) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1157) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1124) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1108) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:1083) [ERROR] : TiApplication: at com.facebook.GraphRequest.executeAndWait(GraphRequest.java:977) [ERROR] : TiApplication: at com.facebook.internal.Utility.getAppSettingsQueryResponse(Utility.java:868) [ERROR] : TiApplication: at com.facebook.internal.Utility.access$1(Utility.java:860) [ERROR] : TiApplication: at com.facebook.internal.Utility$1.run(Utility.java:797) [ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) [ERROR] : TiApplication: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) [ERROR] : TiApplication: at java.lang.Thread.run(Thread.java:818) {code} *Expected:* NullPointerException should not be thrown.

    Appcelerator JIRA | 10 months ago | Wilson Luu
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference
  6. 0

    Android App crashes if launched within ~5-7 seconds of turning phone on

    Stack Overflow | 5 months ago | Damen Tomassi
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.checkPermission(java.lang.String, int, int)' on a null object reference

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      Attempt to invoke virtual method 'int android.app.Activity.checkSelfPermission(java.lang.String)' on a null object reference

      at org.appcelerator.titanium.util.TiFileHelper2.hasStoragePermission()
    2. org.appcelerator.titanium
      TiResponseCache.get
      1. org.appcelerator.titanium.util.TiFileHelper2.hasStoragePermission(TiFileHelper2.java:89)
      2. org.appcelerator.titanium.util.TiResponseCache.get(TiResponseCache.java:314)
      2 frames
    3. com.android.okhttp
      CacheAdapter.get
      1. com.android.okhttp.internal.huc.CacheAdapter.getJavaCachedResponse(CacheAdapter.java:103)
      2. com.android.okhttp.internal.huc.CacheAdapter.get(CacheAdapter.java:47)
      2 frames
    4. Android
      HttpEngine.sendRequest
      1. com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:229)
      1 frame
    5. com.android.okhttp
      HttpsURLConnectionImpl.getResponseCode
      1. com.android.okhttp.internal.huc.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:437)
      2. com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:388)
      3. com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:501)
      4. com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
      5. com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java)
      5 frames
    6. com.facebook
      GraphRequest.executeAndWait
      1. com.facebook.GraphResponse.fromHttpConnection(GraphResponse.java:253)
      2. com.facebook.GraphRequest.executeConnectionAndWait(GraphRequest.java:1255)
      3. com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1157)
      4. com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1124)
      5. com.facebook.GraphRequest.executeBatchAndWait(GraphRequest.java:1108)
      6. com.facebook.GraphRequest.executeAndWait(GraphRequest.java:1083)
      7. com.facebook.GraphRequest.executeAndWait(GraphRequest.java:977)
      7 frames
    7. com.facebook.internal
      Utility$1.run
      1. com.facebook.internal.Utility.getAppSettingsQueryResponse(Utility.java:868)
      2. com.facebook.internal.Utility.access$1(Utility.java:860)
      3. com.facebook.internal.Utility$1.run(Utility.java:797)
      3 frames
    8. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
      3. java.lang.Thread.run(Thread.java:818)
      3 frames