2017년 4월 7일 금요일

AI2 Companion it´s not working


Hi, I can´t connect my mobile device to App Inventor 2. I´ve tried to fix it (refreshing connection, installing the latest version) and it keeps saying "Companion Connection Error"

It happens when I enter or scan the code, the app (from cell... samsung galaxy s5) do nothing, and then the pc shows the error. 
What can I do?

--
This depends Jimy on how you are connecting and the project you are attempting.   Have you ever connected before?     Did you follow the instructions here  http://appinventor.mit.edu/explore/ai2/setup-device-wifi.html  ?     Do you have the most recent version of MIT Companion (version 2.27) downloaded and installed on your galaxy?      Are both your PC  and android connected to the same network as indicated in Step 2?   Are you trying to connect with Chrome? Perhaps try Firefox.

Do you have Bluestacks on your PC?   Bluestacks gives AI2 severe problems.

--
I´m using the same wifi network. It´s not my first time, I´ve already have develop some apps. 

I´m using the 2.27 version on my galaxy. 

I´ve used Chrome and Safari and it doesn´t work.

I don´t have Bluestacks.

The error happens after I enter the code... it tries to connect, but it fails in the process

--
Thanks for the information Jimy.

"The error happens after I enter the code "      ...you mean the Companion connection Error
"... it tries to connect" ... you are not getting a connection, does this ", but it fails in the process" your Project does not load?     Does this happen with ALL your Projects or just a particular project?   It is important for us to know.    If you can load a simple project; perhaps make a new project called MyTest where you place a button on the Designer and then Connect>AI Companion  ; does that connect?   If the simple project connects and the other project does not connect; it means there are issues with your Project code or aia size.

How large is your source aia file?     Do you have more than ten Screens or are you attempting to load a large audio or image or video file at the app start?

Have you added an adblock program to your browser? or recently added any other plug-ins.  Some plug ins on the browser can cause Companion and AI2 to misbehave.

If your app does not appear on your device, the most likely problems are:
⦁ You may have an outdated version of the App Inventor Companion App. Download the latest Companion App for App Inventor 2 from above. OK, you said you have 2.27 on your Android.
⦁ Your device may not be connected to wifi. Make sure you see an IP address at the bottom of the AICompanion App screen on your phone or tablet. Do you see the IP address?
⦁ Your device may not be connected to the same wifi network as your computer. Make sure both devices are connected to the same wifi network name   
Anything above familiar?   Please answer the additional questions and we might figure this out together.   For most people, using WIFI and AI2 is very easy...and it has worked before so something appears to be blocking the connection.

--
Steve, it happens in all my projects. I say that it´s trying to connect because when I scan the code, in my pc, the code dissapears as it is going to connect, but after a while (5 secs aprox) an error appears "Companion Connection Error"

My projects aren´t so big... I´ve tried more than one now.

I I´ve disabled now all my chrome plugins and nothing... I dont have plugins on mozzila and it didn´t work there.

It has an IP adress whie I´m trying to connect.

I really think now that the problem it´s in the phone, maybe an app it´s blocking the connection. Do you have any list of apps that can be causing this?

--
What virus checker are you using on your phone?  That could block.    Have your Firewall connections changed on your PC recently?

Here are a large list of things to think about, please do gtry steps 1 to 3 if you can.

Connecting the phone over wifi

I'm using wireless and the phone won't connect to the blocks editor.
Try the following steps to troubleshoot your wireless connection.
1. Try to reach http://rendezvous.appinventor.mit.edu from your computer.
2. Try to reach http://rendezvous.appinventor.mit.edu from the phone itself.
3. If the steps above both work, try using the "ping" command to ping to the IP Address of the phone (displayed by the MIT AICompanion in its startup window). If you are using windows, type "ping" + *IP address of the phone* in cmd.exe window, if you are using mac or linux, type type "ping" + *IP address of the phone* in terminal window. Detailed instruction see http://www.wikihow.com/Ping-an-IP-Address
4. If all of these steps succeed and Wireless App Inventor *still* doesn't work, then there may be a firewall between the computer and phone that is blocking ports 8001 and 9987. If you have a "telnet" program you can attempt to telnet from the computer to the phone on these ports. If the connection won't complete, then there is likely a firewall in place that is blocking connections to the phone.
I installed the MIT AICompanion App before and it doesn't work now.
You must use the latest version of the MIT AICompanion App. If you attempt to use an older version of the Companion App with App Inventor, you will be prompted to update it.
I followed all the wireless instructions and my phone is connected to wifi, and I still cannot connect to App Inventor via wifi.
If you have trouble connecting using these wireless instructions, make sure your phone is using WiFi and not the cell network. On some devices and in some locations, even with WiFi enabled, the phone continues to use the cell network for Internet connectivity. If this is happening to you, you can disable mobile networking (cell phone carrier based Internet connectivity) from your device's Android settings menu. More information about how the wifi connection works.

Communicating with the device

App Inventor says: You must be connected to the companion or emulator to use "Do It".
This message means that App Inventor believes that it's not connected to any device. If you are using the USB cable, first check that the phone is plugged in. You can also check the connection by using the Connection Test Page. One the phone is connected, stop the Companion software on the phone and try connecting again. If this does not work, or if you are not using USB, try the solution shown under "App Inventor says: Metwork Error Communicating with Companion."
The phone (or emulator) shows a notice -- Security error receiving blocks from browser.
A likely cause for this is that the browser loaded a new project and the Companion didn't recognize that. (Perhaps the phone was unplugged?) Reset the Companion by using the menu key (on the emulator) and select "stop this application". Then reload the browser page, and try connecting again.
The Companion started to run, and then said "Connection error."
This can happen if App Inventor tries to connect and start the companion, and the companion is already running on the device (perhaps from previous project). Go to the running Companion app, press menu, and choose to stop the application. Then try reconnecting again. If this keeps happening, try rebooting the device.
Something you might want to do in the meanwhile is install the setup software and try the emulator...   does that work?   http://appinventor.mit.edu/explore/ai2/setup-emulator.html   

--
Thanx Steve for your help... i´m still in trouble with aicompanion.

I think the problem it´s definitly my phone, because i couldn´t ping it succesfully (i tried other sites and devices and it worked)

I´ve tried to change configs on Avast (on my phone and my pc), but I haven´t solved it yet. 

It didn´t work either using the emulator, it says it´s out of date and then I had trouble with the update package.

I don´t want to give up on app inventor... I hope you could help me again

--
In the past, Avast users have had problems with that virus checker blocking AI Companion activities.  This could be your issue.  Check Avast to see if that program has the possibility of selectively unblocking what it considers suspicious urls.  I do not know if that is your issue or not, only reporting some AI users had that difficulty several months ago.

You have Avast on both your phone and the PC?  Perhaps try the free AVG or the free McAfee on your Android?

You said you could not update Companion on the PC either to use Companion.  This appears suspiciously something is blocking AI..my guess is it might be Avast.  You could try another virus checker.     However, first try this with respect to the Companion update.  First, make sure you are running your Win8 PC using Administrative privlidges.  Then  from the AI browser screen,  Connect > Hard Reset.  This attempts to 'manually' update Companion on the emulator.  You should see a pop up menu after Hard Reset.  This does not always happen.  If you do not see the pop up immediately, then close your browser; reboot your PC then reload the browser and try to use the emulator again.   What happens?  Let us know.

Also please confirm that you did install using Admin privileges .  

--
Hi Steve, definitly: I dont know whats wrong with my connection.

I´ve uninstalled avast, du booster, and nothing... 

I still can´t connect the companion or even ping my phone.

If you have any ideas, they are welcome

--
Hopeless perhaps Jimmy.

Let us try again.   WIFI is the easiest thing for most users to do.  Since you cannot connect, the problem is one or more of the following:

1) There is a hardware problem with your PC.  Since you can connect with other things, this is unlikely.
2) There is a problem with your Android phone.  Borrow a phone and try?
3) There is a problem with your dsl router  .    Is your PC connected via a cable?    Perhaps your WIFI is a guest connection and not connecting to the same IP as your computer?
4) There is a problem with your PC software.   You seem to have deleted the usual culprits that inhibit AI2 activity.
5) There is a problem with your installation of Companion 2.27 on your phone.  You say you have version 2.27 so that should be OK.
6) There is a problem with the project you are attempting to load.  This is highly likely...see below.
7) Your version of Chrome is not up to date or you need to clear its cache.  This is possible.
8) The phone is connecting via network and not thru WIFI.   This is very possible.
9) You have a virus.  Perhaps but the others are more probable.

You said you have created apps with AI2 before and you cannot get any to load using WIFI  Connect > AI Companion and you cannot ping.  For the moment, forget about the emulator and let us try to get WIFI working for you again.  To use WIFI, you do not need aiStarter.  You do need a Project on your Project screen that is known to work and to follow all of these procedures:

Connect your Phone or Tablet over WiFi

You can use App Inventor without downloading anything to your computer! You'll develop apps on our website: ai2.appinventor.mit.edu. To do live testing on your Android device just install the MIT App Inventor Companion app on your Android phone or tablet.  Once the Companion is installed, you can open projects in App Inventor on the web, open the companion on your device, and you can test your apps as you build them:
The following steps will walk you through the process.

Step 1: Download and install the MIT AI2 Companion App on your phone.

Open your device's QR code scanner and scan the QR code on the left below to download the Companion App from the Play Store. If you can't use the Play Store, use the QR code on the right to download the Companion App directly to your phone.

Play Store

Recommended: Automatic updates

APK File

Manual updates required

Scan this QR code (or click this link)
to get the app from the Play Store

Scan this QR code (or click this link)
to download the app directly

If you need a QR code scanner, you can get one at the Play Store (e.g., ZXing).
After downloading, step though the the instructions to install the Companion app on your device.You need to install the MIT AI2 Companion only once, and then leave it on your phone or tablet for whenever you use App Inventor.
Note 1: If you are unable to use the QR code, you can still install MIT AI2 Companion on your phone or tablet. Use the Web browser on your device to go to the Google Play Store; look for MIT AI2 Companion in the store. Once you find Companion, click the INSTALL button for the Companion app.
Note 2: If you choose not to go through the Play store and instead load the app directly (aka "side load), you will need to enable an option in your device's settings to allow installation of apps from "unknown sources". To find this setting on versions of Android prior to 4.0, go to "Settings > Applications" and then check the box next to "Unknown Sources". For devices running Android 4.0 or above, go to "Settings > Security" or "Settings > Security & Screen Lock" and then check the box next to "Unknown Sources" and confirm your choice.

Step 2: Connect both your computer and your device to the SAME WiFi Network

App Inventor will automatically show you the app you are building, but only if your computer (running App Inventor) and your Android device (running the Companion) are connected to the same WiFi Network. See a more detailed explanation of this here.         Take the time to read what is said on this link; since you last were able to run a Project using WIFI, perhaps something has changed with your WIFI network.  Is it possible your phone is attempting to connect to the Internet using a network connection, and not WIFI? You can turn off the network setting on your phone in the Settings.
Some router software require you provide and setup the router password in your Android?    Have you done that?             Another test, after you are sure your are not using a network connection on your device, connect to the Internet using your device's default brower.  Can you surf the Internet?    If you cannot, it probably means you phone is not connecting via WIFI to anything.
In the settings in your phone, do you have USB debugging turned on?    If so, turn it off.  Attempting WIFI and USB at the same time will confuse either AI2 or Companion.

Step 3: Open an App Inventor project and connect it to your device

Go to App Inventor and open a project (or create a new one -- use Project > Start New Project and give your project a name).    Please create a NEW project;    call it JimmyCompanionTest.
Place a button on the Designer Screen.   Set the Button.Text to   Hello Jimy    .    That is the entire project.    Please do    Connect > AI Companion .    Does the project load and the button render on your phone?
 Then Choose "Connect" and "AI Companion" from the top menu in the AI2 browser:
A dialog with a QR code will appear on your PC screen. On your device, launch the MIT App Companion app just as you would do any app. Then click the “Scan QR code” button on the Companion, and scan the code in the App Inventor window:
Within a few seconds, you should see the app you are building on your device. It will update as you make changes to your design and blocks, a feature called “live testing”.
If you have trouble scanning the QR code or your device does not have a scanner, type the code shown on the computer into the Companion's text area on your Android device exactly as shown.  The code is directly below where the screen on your PC shows "Your code is" and consists of six characters.  Type the six characters and choose the orange "Connect with code".  Do not type an Enter or carriage return: type just the six characters followed by pressing the orange button..

Troubleshooting:

If your app does not appear on your device, the most likely problems are:
⦁ You may have an outdated version of the App Inventor Companion App. Download the latest Companion App for App Inventor 2 from above.
⦁ Your device may not be connected to wifi. Make sure you see an IP address at the bottom of the AICompanion App screen on your phone or tablet.
⦁ Your device may not be connected to the same wifi network as your computer. Make sure both devices are connected to the same wifi network name.
⦁ Your school or organization may have network protocols in place such that the wifi connection is not allowed. If this is the case, you can still use App Inventor with the emulator or you can use a USB cable to connect your device (Yuk). Go back back the main setup page for these options.
I'm out of ideas.   Can you access your projects from another PC or from a friend's PC using your log in?   If you can visit with a friend, try that or borrow a phone or a laptop.     Try the simple project, what happens?   The only way to isolate issues inherent with your phone for sure s to try another phone.

Tell us what happens, we can either celebrate with you or cry together.

--
Thanks Steve, you´re awesome... thanks for your guide and patience.

It works!! I started doing 2 steps at once, so I don´t know exactly which was the problem:
- I used Clean Up to delete all cookies and stuff
- i disabled all usb debug options in my phone

And then i tried to connect one more time and it worked... only by entering the code... when I try to scan it, the app closes, but I dont mind

Thanks again for all your patience and help...

--
Great.  You might have required both steps to get running Jimy. Regards using the QR code, you might just try cleaning fingerprints off the Android's camera lens..yes, that works.   Since you used WIFI successfully previously, you probably have a bar code scanner on your phone ...some users have issues scanning because they need to add the bar code app.   In your case, next time you start a connection, wipe the lens clean and try the scan.

thanks for letting us know you are up and running 

--

댓글 없음:

댓글 쓰기