NOTE: This spoiler was submitted by Jeremy

The film opens at the Bubble Corporation, where CEO Marc Weidell (Justice Smith) unveils his newest invention, the B-Bot, a revolutionary robot that is programmed to become a child’s best friend through knowing all their interests based on social media information. With its algorithm, the B-Bot can also connect its owners to other kids to become friends with based on personal interests. After a successful demonstration, the B-Bot is launched instantly to kids all over the world.

In the town of Nonsuch lives Barney Pudowski (Jack Dylan Grazer), a lonely middle schooler who has no friends and is the only kid without a B-Bot. He lives with his father Graham (Ed Helms) and grandmother Donka (Olivia Colman). At his school are kids he used to be friends with, like the popular Savannah Meades (Kylie Cantrall), prankster Rich Belcher (Ricardo Hurtado), gamer Noah (Cullen McCarthy), and science enthusiast Ava (Ava Morse). It’s Barney’s birthday and he has many invitations for his party made, but he knows kids would be hesitant to come since the last time he had kids at a birthday party, the animals that Donka keeps caused a ruckus and caused a fire that sent the kids running. Since he is lonely at school, the teacher puts him on the “buddy bench” and lets it be known that Barney loves collecting rocks, which Rich exploits for his dumb internet videos.

Barney goes home to find Graham trying to sell his novelty products, plus Donka cooking a traditional family feast. He tells them that he is not having any kids come to his birthday party because of the previous incident. The doorbell rings, which he thinks is a B-Bot being delivered to him, but it’s just Rich and his goons playing a prank with a large rock wrapped up to look like a B-Bot. Graham realizes how lonely Barney is and tries going to the Bubble Headquarters to get a B-Bot, but the employee, Bree (Sarah Miller), informs them that there is a three-month wait for a B-Bot. Graham then notices a truck with a B-Bot that fell out of the truck (which was Barney’s fault on his way to school), and Graham sees an opportunity.

Barney wakes up to find the B-Bot (Zach Galifianakis) next to his bed. He is excited, but when he tries to activate it, it proves to be glitchy. Barney has a hard time trying to get him to connect, so he just decides to leave it at home for the time being and asks it to do what it can to learn everything about him so that they can become friends. When he gets home later, Barney finds that the B-Bot destroyed his room and is now in the kitchen with Donka singing and dancing to an old country folk song. He decides he has had enough and it is time to return the Bot to Bubble.

Barney begins taking the B-Bot to the store, but they end up across a playground where Rich and his buddies are hanging out trying to film stuff on their B-Bots. Barney’s B-Bot ends up rolling toward them and starts doing the silly song he learned at home. Barney asks Rich for the Bot back, but Rich just continues to taunt Barney until the B-Bot reacts by hitting Rich. When Rich fights back, the Bot fights harder and starts chasing the guys around, causing them to get stuck in the playground fixtures. Barney changes his mind about the Bot and decides to keep him, then starts to call him “Ron” based on the serial number on his back. They are then caught by a police officer after Rich reports them.

Graham and Donka meet with Barney and the cop at Bubble to report the defective Ron, even though Barney insists there is nothing wrong with him. After seeing that Ron’s safety features aren’t activated and causes him to hit people, Bree orders Ron to be sent to the crusher. Barney sneaks into the room with the crusher and frees Ron, and they go on a wild chase through Bubble until they end up in a children’s playroom with B-Bots using skins based on animals. Barney deactivates one and gives it up as though it was Ron, and it gets sent to the crusher while Barney makes it out with Ron hidden away.

Marc and Bubble’s COO Andrew Morris (Rob Delaney) meet with shareholders to discuss how well the B-Bot is doing in sales. The two soon catch wind of Ron and his antics, with Andrew fearing that Ron’s exposure would cause bad publicity for the company.

Barney starts to teach Ron more about himself so that he can learn more and become Barney’s best friend. They spend time at home, playing and messing around, and Barney even reveals his loneliness to Ron. While sitting on a hill, Ron tumbles down and ends up crashing into Savannah’s pool, with Barney soon following. Savannah’s B-Bot records Barney and Ron falling into the pool and looking silly, but Barney asks Savannah not to tell anyone about Ron. Barney takes Ron home where he acts as a night light since he knows Barney doesn’t like the dark, and looks up a chart that Barney made up to continue learning.

The next day, Ron goes all around town looking for strangers that can be Barney’s friend. He even posts flyers everywhere for people to be his friend. Barney then finds that Ron bought an old lady, a biker, a homeless man, and a baby. In the middle of the madness, Rich and his buddies get ahold of Ron and learn that his safety features haven’t been uploaded. They use their B-Bots to copy Ron’s code, causing their B-Bots to run amok and replicate the code to all the other kids’ B-Bots. This causes bigger chaos, because the Bots start to fuse together while Savannah uses her Bot to record the scene, which everyone at Bubble witnesses. Rich tries to command the giant Bot mecha, which then grabs Savannah and swallows her before “pooping” her out. This is also recorded, and Savannah becomes “Poop Girl”. Andrew has the tech guys run a patch that disables the Bots and turns them back to normal. Barney gets sent home and gets angry at Ron for causing all this trouble, even ordering him to go away, which Ron does. Meanwhile, Andrew attempts to do a PR clean-up of the incident, shifting blame to Ron and trying to cover up any footage of the scene. Marc has no choice but to let Andrew take control.

Barney goes home to find Bree and other Bubble cronies looking for him and Ron. He retreats to the shed where he finds Ron hidden. After Barney apologizes to Ron, he packs him up and retreats to the woods as the Bubble vans spot him and chase after them. On his way, he runs by Savannah’s yard to find her crying because now everyone knows her as “Poop Girl” and her reputation is ruined. He once again asks her not to say anything, and when the Bubble goons come by, Savannah just sends them away. Barney continues to run into the woods with Ron. The two spend the day playing outdoors before it’s nighttime and they rest on a large stand. Barney tells Ron that he used to be close friends with Savannah and Rich until they became obsessed with fame.

In order to find them, Andrew has all the B-Bots of every kid in town be hacked to use as spycams to try and catch sigh of Barney and Ron. This causes other kids to turn on each other, like Rich’s friends when they all learn what they really think of one another, and everyone has turned on Savannah. She is visited by Graham and Donka to look for Barney, but she tells them she doesn’t know where they are. At school, Savannah talks to Rich, since she knows he made a remix video of “Poop Girl” that went viral worldwide, but she tells him that it’s their fault that Barney and Ron are on the run and lost in the woods.

The weather in the woods gets colder, and there is little for Barney and Ron to use as warmth besides Barney’s underpants, and Ron’s battery is also running out. They run and hide when they find reprogrammed B-Bots sent to scan the place and locate them. While Andrew does see Barney and Ron on a monitor, he covers them up and pretends that nothing has been found. Barney gets weaker because of the temperature and his asthma, so Ron uses what little battery power he has left to carry Barney towards the outskirts of the school in the morning. Savannah, Rich, Noah, Ava, Graham, and Donka all find the two of them, but so does Bubble. Barney is taken to the hospital while Ron is taken back to the company.

At the hospital, Savannah talks to the other kids about how close they all used to be before they became obsessed with popularity. In particular, she and Ava were good friends at one point. Barney wakes up and finds Marc coming to bring him Ron, who has been fixed and is acting like a regular B-Bot, which Barney doesn’t like. Marc says he can re-upload Ron’s memory from the cloud, but then finds that Andrew convinced the shareholders to have Marc fired and be replaced by Andrew as CEO of Bubble. The Pudowskis join Marc as they decide to break into Bubble.

Andrew is giving a gaudy presentation to an audience while Graham and Donka try to create a distraction. Graham uses his faulty laptop to plug into the building’s system and cause a blackout. Andrew soon learns that Barney is in the building looking for Ron. With Marc’s help, Barney makes it to the server room but finds that it is huge, and he doesn’t know how to find Ron. When things get dark, he sees the light that Ron creates for Barney glowing, and he finds his program. He re-uploads Ron to the B-Bot body, but then sees the surveillance footage of Savannah, Rich, Noah, and Ava, all of whom are just as lonely as Barney is. He gets the idea to upload Ron’s programming to their Bots, because as Marc notices, Ron’s code doesn’t have the algorithm that the regular Bots have, but he is programmed to learn manually as opposed to having all of Barney’s personal information uploaded to him. Meanwhile, Andrew confronts Graham, discussing his plan to exploit the kids through the Bots and expressing hatred for all kids. Barney and Ron say goodbye since Ron knows that Barney can now have real friends while still helping them by uploading Ron’s code. After it’s done, Barney leaves with Graham and Donka. Andrew returns to the presentation, but Marc uses his gadget to show Andrew a video he recorded talking about his plan and hatred for kids. Andrew has no choice but to relinquish his position back to Marc, who promises to do better with the B-Bots.

Three months later, all the other kids at school have faulty B-Bots like Ron, but it’s made them more fun and the kids are happier with them. Barney is joined by Savannah, Rich, Noah, and Ava during recess, and they share chicken legs from Donka. We then pan up to a Bubble tower that overlooks the school, which lights up to show Ron’s smiling face.

Brought to you by

The B-Bot is a revolutionary robot for kids that is programmed to be their best friend by having all of their personal information from the internet uploaded to their code. The only kid in town without one is Barney Pudowski, a lonely middle schooler who lives with his dad Graham and grandmother Donka. Graham later gets Barney a B-Bot that is slightly damaged, and it turns out to be defective and destructive. However, Barney soon befriends the Bot and names him Ron as a shortened form of his serial number.

While Barney and Ron start to become friends, Bubble, the company that made the B-Bots, catches wind of Ron's existence because he hit Barney's classmate Rich, as well as a police officer. The company tries to have Ron crushed, but Barney sneaks him out. The COO Andrew Morris tries to cover up Ron's existence for fear of bad publicity to the company, but CEO Marc Weidell, who invented the B-Bots, is fascinated with Ron's faulty coding.

After a major disaster at school involving Rich's Bot copying Ron's coding without safety features, Andrew scrambles to cover up the incident while sending people to get Barney and Ron. Barney's classmates like Savannah are left humiliated after the incident. He and Ron run away into the woods, but Ron gets Barney out of there when he starts to drop in temperature and suffer from asthma. Barney is taken to the hospital while Ron is taken by Bubble and reprogrammed to be like a regular Bot. When Barney tells Marc to reprogram him as the old Ron, Marc finds that Andrew booted him from his CEO position and is going to continue to use the B-Bots to exploit children's interests for profit. They break into the company and Barney is able to find Ron's code. However, since he sees that Savannah, Rich, and other classmates are just as lonely as he is, they decide to upload Ron's code to all the other B-Bots so that they can be natural friends instead of programmed friends. Barney and Ron say goodbye, while Marc blackmails Andrew with a video of him talking about his plan so that Andrew has no choice but to let Marc be CEO again, with the promise to do better by kids and B-Bots.

Months later, all the other kids have B-Bots acting like Ron, and Barney is now friends with Savannah, Rich, and others. Meanwhile, Ron's face appears on a Bubble tower, implying that he is still alive.