Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-20435

NullPointerException is thrown in logcat if you use the latest SDK with latest Facebook module

    Details

    • Type: Bug
    • Status: Closed
    • Priority: None
    • Resolution: Duplicate
    • Affects Version/s: Release 5.2.0
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Description

      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:

      1. In the Stable KitchenSink, open tiapp.xml
      2. Replace the Android section with the following:

        <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>
        

      3. Make sure facebook module 5.0.0 is selected
      4. Install KitchenSink to device
      5. Wait for app to launch

      Actual: NullPointerException is thrown in logcat:

      [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)
      

      Expected: NullPointerException should not be thrown.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                msamah Ashraf Abu (Inactive)
                Reporter:
                wluu Wilson Luu (Inactive)
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-20984
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Integration