However, many problems were encountered in the initial environmental construction and project construction. It took a week to deal with this matter.
Now talk about the problems I encountered, hoping to give you some reference and avoid detours.
[java] View Plain Text
Exception in thread "main" Java. lang. runtime exception: java.net.sockettimeoutexception: read timeout.
Balabala, anyway, I have a problem with gradle's timeout. Directly on the picture, as shown in figure:
So I searched online for a long time and finally found a solution on stackoverflow.
The website address is as follows/questions/29874564/ionic-build-Android-error-when-download-gradle. Now I'll sum up two high-vote answers:
The first answer is to download the compressed package of gradle manually, and then directly change the download link (used to download gradle) in the script to an absolute path.
Since the first official route works, I'd better take the first one.
Talk about the first method in detail: 0.
In the first failed build, a folder named gradle was generated. The path is as follows:
Platform \Android\gradle
Download the gradle compressed package and copy the compressed package to the above path. The address is as follows:
It means: enter the following command directly at the command line, and use Ant instead of gradle in the construction process. I don't know why, I haven't touched (escaped) before.
Cordoba builds Android-Ant
As expected, it is still wrong after changing grandle.
The error report is as follows:
[javascript] View Plain Text
Unable to resolve all dependencies of configuration ":_DebugCompile"
Then I refer to stackoverflow's answer, and the link is/questions/33675491/could-not-resolve-all-dependencies-for-configuration-armv7 debugging and compiling /33675539.
Open the Android SDK manager, find the Android support library under extra and download it.
And then build it successfully
Scatter flowers. Tears of joy.
20 17-3- 15- updated.
Ionic project files must be placed in the English directory. Otherwise, building android will also fail.