The problem background

Recently, the application plans to use the crash service of Huawei AppGallery Connect, which requires access to SDK. However, the application is still developed by Eclipse. After the integration, IT is found that the SDK integration is different from Android Studio.

According to the huawei AGC official website, download the tool package and use the tool package to generate the Eclipse engineering package. The detailed documents are as follows:

Developer.huawei.com/consumer/cn…

However, when executing the build.bat file in the aar2Eclipse /aar directory, the command line fails. The main error message is

* What went wrong: Task 'assembleRelease' not found in root project 'AAR'.Copy the code

Problem of repetition

1, the first suspect is the network problem:

As the company computers use the Intranet of the company, the reason is suspected to be the Intranet of the company. However, when the Intranet is disconnected and the Internet is used normally, the BAT execution problem still exists.

2. The Android development environment.

I borrowed a colleague’s computer and succeeded in executing it. Therefore, I suspect the configuration of the Android development environment is wrong. For the development environment, I found that the environment variables were different from mine. His environment variable has an extra parameter ANDROID_HOME compared to my computer.

Cause of the problem:

The Eclipse toolkit provided by Huawei relies on the ANDROID_HOME variable to run. If the parameter does not exist in the system environment variable, an error occurs when the system runs it.

Final problem solved: open my computer -> right-click “this computer” -> select “Properties” -> select “Advanced System Settings” -> click “Environment Variables” -> In system variables, create a new ****ANDROID_HOME parameter.

Its value is configured as your local Android SDK installation path, you can run successfully, there are pictures and truth:

Huawei AGC service introduction to Android USES the official document: developer.huawei.com/consumer/cn…

The original link: developer.huawei.com/consumer/cn…

Original author: Mayism