Android studio frequently encountered problems and solutions during use (occasionally updated), Android studio

Source: Internet
Author: User

Android studio frequently encountered problems and solutions during use (occasionally updated), Android studio
Q1: When studio is enabled, it is stuck in the progress bar.

Generally, android studio checks your current sdk version and content before entering the interface, especially when you enter the interface for the first time ~~~ If you have not crossed the wall, this progress bar cannot be completed even if you have a complete sdk, because it cannot get the latest sdk list from google and compare it with the local one !!!

Title: Fetching Android SDK component information on the progress bar

A1:

Find idea under bin in the installation directory of android studio. properties, and then add disable at the end of the file. android. first. run = true to skip studio's sdk Update Check ~~~



Q2: The finished with non-zero exit value 2 error occurs during project compilation.
<span style="font-size:14px;">Error:Execution failed for task ':app:dexDebug'.> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/opt/jdk7/bin/java'' finished with non-zero exit value 2</span>

Different moudle of the project contains multiple open-source libraries or jar files with the same name.

For example: 1. When Module A has A V4 package, Module B also has A V4 package or the v7 package of the entire project (in studio, v7 is the v4 dependency package ), this error occurs.

A2:

To delete redundant jar packages such as V4, just kill the V4 package in one of the modules and reference the module with another V4 package ~~~



Q3: Notes for importing the eclipse open-source Library: After we import moudle in three import/export methods and add the Library to the dependency of the app, we also need to do the following: 1. Modify the build of the open source library. gradle to maintain and build the app. gradle is consistent. 2. in step 1, you may find that the minSdkVersion and targetSdkVersion are not set in the open-source library at all. It is very simple because the compiled version of our eclipse project is in AndroidMainfest. the configuration in the xml file, so you can have two options: one is to directly modify the Version Content in the xml file, and the other is to delete the corresponding content in the xml file, then write a script block for compiling Version Control in gradle. 3. There are three gradle-app in the project, open source library, and project. Therefore, we need to re-query and delete all dependencies... Otherwise, a Q2 error will be reported. For example, the v7 package should delete the app and keep the Open Source Library (the dependency between them is one-way). It is best to keep the gradle classpath only for the project, check the references under the libs package !!!



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.