SAN FRANCISCO — Google is taking its rivalry against Amazon.com to the skies.The search giant’s X laboratory division is developing drones that can handle deliveries, a move that would be in direct competition with the e-commerce company that is testing its own shipment service using self-flying machines.Google’s initiative, called Project Wing, aims to use drones to drop off goods quickly, the company said in an e-mail on Thursday. It will take a few years before the system is ready for commercial use, Google said.The company said it has been exploring the use of unmanned aircraft for about two years. Its disclosure of the project pits it in a race with Amazon, which announced late last year its own plan to test drones to deliver goods. The two companies are increasingly competing with each other as they target companies as well as consumers to sustain growth.“Self-flying vehicles could open up entirely new approaches to moving goods — including options that are cheaper, faster, less wasteful and more environmentally sensitive than what’s possible today,” Google said. “Before we develop our system, we want to go out and learn about more situations in which aerial delivery could help people in their daily lives and jobs.”The venture is another investment in long-term projects through Google’s secretive X lab using cutting-edge technology. The unit has also produced Glass, the computerized eyewear, and is developing self-driving cars and sensor-enabled contact lenses.Earlier this year, Google’s researchers tested Project Wing in Queensland, Australia. The company tested drones with two farmers, who were delivered items including radios, dog treats and cattle vaccines.