Titanium JIRA Archive
Appcelerator Daemon (DAEMON)

[DAEMON-260] Android configuration issues with the Studio 5.1.0

GitHub Issuen/a
TypeBug
PriorityHigh
StatusResolved
ResolutionFixed
Resolution Date2019-03-13T20:42:26.000+0000
Affected Version/sn/a
Fix Version/sAppc Daemon 2.0.0
Componentsandroidlib
Labelsn/a
ReporterKondal Kolipaka
AssigneeChris Barber
Created2018-06-26T03:47:14.000+0000
Updated2019-03-13T20:42:26.000+0000

Description

Hi all. I am having issues with Studio on my Mac. It seems to randomly not know that I have Android SDKs installed. It worked last week. Just this morning, I start up studio and on the dashboard I see that Android is ready to go. Then an few seconds later it changes to grayed out and the button says download. I click download and run the install - when I do it recognizes that I already have some versions of the SDK installed. But once through the install process, the problem still exists. I have been doing this all morning. An interesting point is that one of the times I did this process, it worked and I saw the emulators that I have always had available in Studio. Also note that the preferences pane in Studio sometimes shows that it has found the SDKs and the emulators dropdown is populated, but most of the time it looks like the attached screenshot. Any help would be greatly appreciated as I am unable to do Android mobile demonstrations and I have several in the near future. Thanks in advance.

Attachments

FileDateSize
appcd_dump_1530044433964.log2018-06-26T20:24:15.000+00001547463
appcddump.txt2018-07-03T04:36:45.000+00001142813
log2018-06-29T15:26:17.000+00002722541
Screen Shot 2018-06-26 at 1.18.59 PM.png2018-06-26T20:24:14.000+000068979
status.txt2018-07-03T04:36:54.000+000026027
studio.log2018-06-27T02:00:51.000+00004246119
tiInfo.rtf2018-06-26T20:24:14.000+000016682

Comments

  1. Kondal Kolipaka 2018-06-26

    [~fuzzywhite] If I understand the issue correctly, you're unable to configure Android SDK in the studio and it doesn't update in the studio dashboard page after installing a couple of times.Hope you're on the latest studio RC which is 5.1.0.201806130758 as on June 26th. Can you please provide the following logs and studio version which you're using. Before you fetch all the logs, please restart the studio with the following settings

    Go to Studio Preferences -> Studio -> Trouble Shooting

    Select Debug Level to "All" from the drop-down

    Click on Apply and restart the studio

    Once studio is launched, verify the android configuration in the dashboard and studio preferences

    Go to Studio Preferences -> Studio -> Platforms -> Android

    If no android SDK is configured or shown here, click on the "Browse" button to select android SDK location.

    *To fetch Studio diagnostic Log:*

    Go to Help -> Studio -> Run Diagnostic Test

    *To fetch Studio log:*

    Go to Help -> Studio -> View Log file

    *To fetch Appc Daemon Log:*

    Go to Help -> Studio -> Generate Appc Daemon Log

    *To fetch Appc ti info*

    Go to terminal and run appc ti info

    Please attach all the logs to the ticket to process further.
  2. Rick White 2018-06-26

    Diagnostic test will not run. Attached screenshot shows the error. Other requested info is attached. Thanks very much. [^tiInfo.rtf] [^appcd_dump_1530044433964.log] !Screen Shot 2018-06-26 at 1.18.59 PM.png|thumbnail!
  3. Kondal Kolipaka 2018-06-26

    [~rwhite] Can you please add the missing studio log file as mentioned above
  4. Rick White 2018-06-27

    Sorry. I’ll get that for you in an hour or so.
  5. Rick White 2018-06-27

    [^studio.log]
  6. Kondal Kolipaka 2018-06-27

    Thanks [~rwhite] for providing the logs. Looks like the problem is with the getting the android system-info from the Appc Daemon with in the 5sec, after making a system-info request if the daemon process doesn't respond with in the 5sec, studio will cancel the request process. [~cbarber] Why this can happen and how can we trace the root problem for this? I believe 5sec is good enough to fetch the system info from the daemon process. *Here is the request made by studio:*
       {"path":"\/system-info\/1.x\/info","id":1530044373934,"type":"call","version":"1.0"}
       
    Here is the Appc Daemon [^appcd_dump_1530044433964.log], But I don't see any issue here. *Error log:*
       !MESSAGE (Build 5.1.0.201806130758) [WARNING]  Unable to fetch system-info. Appcd didnt respond within 5 seconds.
       !STACK 1
       org.eclipse.core.runtime.CoreException: Unable to fetch system-info. Appcd didnt respond within 5 seconds.
       	at com.appcelerator.titanium.core.daemon.AppcDaemonManager.executeSync(AppcDaemonManager.java:286)
       	at com.appcelerator.titanium.core.daemon.AppcDaemonManager.getSystemInfo(AppcDaemonManager.java:303)
       	at com.appcelerator.titanium.android.core.DaemonAndroidSDKLocator.loadTiInfo(DaemonAndroidSDKLocator.java:847)
       	at com.appcelerator.titanium.android.core.DaemonAndroidSDKLocator.updateTiInfo(DaemonAndroidSDKLocator.java:231)
       	at com.appcelerator.titanium.android.core.DaemonAndroidSDKLocator.access$0(DaemonAndroidSDKLocator.java:229)
       	at com.appcelerator.titanium.android.core.DaemonAndroidSDKLocator$1.run(DaemonAndroidSDKLocator.java:244)
       	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
       Caused by: org.eclipse.core.runtime.CoreException: Unable to fetch system-info. Appcd didnt respond within 5 seconds.
       	at com.appcelerator.titanium.core.daemon.AppcDaemonManager.executeSync(AppcDaemonManager.java:278)
       
  7. Chris Barber 2018-06-28

    I think 5 seconds is most likely insufficient. The first time the system-info is called, it takes time to get warmed up. There are performance issues too with serializing the giant system-info object. I created DAEMON-230 to look into speeding it up, but without a major effort, it's just not feasible. Querying each type of info separately would be more efficient than system-info.
  8. Kondal Kolipaka 2018-06-29

    https://github.com/appcelerator/titanium_studio/pull/1085
  9. Satyam Sekhri 2018-06-29

    FR Passed. The login, dashboard and platform configuration works fine with the changes. Also no significant changes in performance noticed.
  10. Kondal Kolipaka 2018-06-29

    [~rwhite] Please pick 5.1.0 RC build - 5.1.0.201806291005 which is published here http://preview.appcelerator.com/appc-studio/ Let us know how it goes.
  11. Rick White 2018-06-29

    Unfortunately, the problem still exists with this version . However, it looks like the log file may have some more valuable info in it. Attached. [^log]
  12. Rick White 2018-06-29

    reopening, because it is not resolved. Thanks
  13. Kondal Kolipaka 2018-07-02

  14. Rick White 2018-07-02

    [~kondal kolipaka]. I will ping you on teams around 10 am Singapore time. Now iOS is not working either. I am going to need help reconfiguring my Mac to get Appc Studio working again. Thanks
  15. Kondal Kolipaka 2018-07-03

    Few observations from the today's call with [~rwhite]

    appc appcd exec /android/1.x/info is not responding. We have waited for more than 2mins still it doesn't return.

    appc appcd exec /system-info/1.x/info is also not responding from the terminal, but appc appcd exec /ios/1.x/info seems to work fine.

    Please find the [^appcddump.txt] [^status.txt] files captured during the session. Looking at the dump file I don't see any issues reported. [~cbarber] Could you guide us how can identify the root cause of the problem here.
  16. Chris Barber 2019-03-13

    I'm 99% positive I found the culprit and it's in androidlib. androidlib's logic was ported from node-titanium-sdk. During the port, the code for executing a command over an adb connection was erroneously changed from a socket.on('end') to a socket.on('close'). When a command that is to buffer until the socket is closed, such as "shell", is executed, the "close" event would never fire. Turns out this needs to be an "end" event. It was fixed in [this commit](https://github.com/appcelerator/androidlib/pull/20/commits/099b8d22866b4bd4c574f2a98fed2d1c396990e5) and shipped in androidlib@2.4.0. Since the fix, I haven't seen any hanging. Resolving this issue as fixed.

JSON Source