Android Error Summary

Source: Internet
Author: User


<span style= "FONT-SIZE:14PX;" ><code class= "Hljs http has-numbering" style= "display:block; padding:0px; Color:inherit; Box-sizing:border-box; font-family: ' Source Code Pro ', monospace;font-size:undefined; White-space:pre; border-radius:0px; Word-wrap:normal; background:transparent; " ><span class= "Hljs-attribute" style= "Box-sizing:border-box;" >com.android.dex.dexexception</span&gt: <span class= "hljs-string" style= "Color:rgb (0, 136, 0); Box-sizing:border-box; " >multiple dex files define Landroid/support/annotation/animres;</span></code><ul class= " Pre-numbering "style=" Box-sizing:border-box; Position:absolute; width:50px; top:0px; left:0px; margin:0px; padding:6px 0px 40px; border-right-width:1px; Border-right-style:solid; Border-right-color:rgb (221, 221, 221); List-style:none; Text-align:right; Background-color:rgb (238, 238, 238); " ><li style= "Box-sizing:border-box; padding:0px 5px; " >1</li></ul><ul Class= "pre-numbering" style= "Box-sizing:border-box; Position:absolute; width:50px; top:0px; left:0px; margin:0px; padding:6px 0px 40px; border-right-width:1px; Border-right-style:solid; Border-right-color:rgb (221, 221, 221); List-style:none; Text-align:right; Background-color:rgb (238, 238, 238); " ><li style= "Box-sizing:border-box; padding:0px 5px; " >1</li></ul></span>

< Span style= "font-size:14px" > every time to clean up, and then to compile, the process of light wasted 4/5 minutes. This problem occurs because of the latest V4 package (compile ' com. android.support:support-v4:22.2.1 ') already contains annotation.jar this package, but other jar packages also contain this package. Instead of including v4/v7, a bunch of people say the following settings are in the V7 package:

<span style= "FONT-SIZE:14PX;" ><code class= "HLJS cs has-numbering" style= "display:block; padding:0px; Color:inherit; Box-sizing:border-box; font-family: ' Source Code Pro ', monospace;font-size:undefined; White-space:pre; border-radius:0px; Word-wrap:normal; background:transparent; " >compile (<span class= "hljs-string" style= "Color:rgb (0, 136, 0); box-sizing:border-box;" > ' com.android.support:appcompat-v7:22.2.1 ' </span>) {exclude <span class= "Hljs-keyword" style= "Color:rg B (0, 0, 136); Box-sizing:border-box; " >group</span&gt: <span class= "hljs-string" style= "Color:rgb (0, 136, 0); Box-sizing:border-box; " > "Com.android.support" &LT;/SPAN&GT;, module: <span class= "hljs-string" style= "Color:rgb (0, 136, 0); Box-sizing:border-box; " > "support-v4" </span>}</code><ul class= "pre-numbering" style= "Box-sizing:border-box; Position:absolute; width:50px; top:0px; left:0px; margin:0px; padding:6px 0px 40px; Border-right-width:1px; Border-right-style:solid; Border-right-color:rgb (221, 221, 221); List-style:none; Text-align:right; Background-color:rgb (238, 238, 238); " ><li style= "Box-sizing:border-box; padding:0px 5px; " >1</li><li style= "Box-sizing:border-box; padding:0px 5px; " >2</li><li style= "Box-sizing:border-box; padding:0px 5px; " >3</li></ul><ul class= "pre-numbering" style= "Box-sizing:border-box; Position:absolute; width:50px; top:0px; left:0px; margin:0px; padding:6px 0px 40px; border-right-width:1px; Border-right-style:solid; Border-right-color:rgb (221, 221, 221); List-style:none; Text-align:right; Background-color:rgb (238, 238, 238); " ><li style= "Box-sizing:border-box; padding:0px 5px; " >1</li><li style= "Box-sizing:border-box; padding:0px 5px; " >2</li><li style= "Box-sizing:border-box; padding:0px 5px; " >3</li></ul></span>

< Span style= "font-size:14px"-that is, set V7 package does not contain V4, this set up is useless. Just make sure you're consistent with the local version of V4 and V7. The correct solution is as follows:  
1, find the other dependencies of the project, must be in the libs of a jar bag, hidden annotation.jar package, delete It is OK, this is the most Orthodox solution; 
2, downgrade the V4 package, because the higher version of V4 contains Annotation.jar, you can force the setting in the outermost build.grable:

<span style= "FONT-SIZE:14PX;" ><code class= "hljs matlab has-numbering" style= "display:block; padding:0px; Color:inherit; Box-sizing:border-box; font-family: ' Source Code Pro ', monospace;font-size:undefined; White-space:pre; border-radius:0px; Word-wrap:normal; background:transparent; " >allprojects <span class= "Hljs-cell" style= "Box-sizing:border-box;"  >{repositories {jcenter ()}</span> <span class= "hljs-transposed_variable" style= "box-sizing: Border-box; " >configurations.</span>all <span class= "Hljs-cell" style= "Box-sizing:border-box;" >{resolutionstrategy.force <span class= "hljs-string" style= "Color:rgb (0, 136, 0); box-sizing:border-box;" > ' com.android.support:support-annotations:22.1.0 ' </span>}</span>}</code><ul class= " Pre-numbering "style=" Box-sizing:border-box; Position:absolute; width:50px; top:0px; left:0px; margin:0px; padding:6px 0px 40px; border-right-width:1px; BorDer-right-style:solid; Border-right-color:rgb (221, 221, 221); List-style:none; Text-align:right; Background-color:rgb (238, 238, 238); " ><li style= "Box-sizing:border-box; padding:0px 5px; " >1</li><li style= "Box-sizing:border-box; padding:0px 5px; " >2</li><li style= "Box-sizing:border-box; padding:0px 5px; " >3</li><li style= "Box-sizing:border-box; padding:0px 5px; " >4</li><li style= "Box-sizing:border-box; padding:0px 5px; " >5</li><li style= "Box-sizing:border-box; padding:0px 5px; " >6</li><li style= "Box-sizing:border-box; padding:0px 5px; " >7</li><li style= "Box-sizing:border-box; padding:0px 5px; " >8</li></ul><ul class= "pre-numbering" style= "Box-sizing:border-box; Position:absolute; width:50px; top:0px; left:0px; margin:0px; padding:6px 0px 40px; border-right-width:1px; Border-right-style:solid; Border-right-color:rgb (221, 221, 221); List-style:none; Text-align: Right; Background-color:rgb (238, 238, 238); " ><li style= "Box-sizing:border-box; padding:0px 5px; " >1</li><li style= "Box-sizing:border-box; padding:0px 5px; " >2</li><li style= "Box-sizing:border-box; padding:0px 5px; " >3</li><li style= "Box-sizing:border-box; padding:0px 5px; " >4</li><li style= "Box-sizing:border-box; padding:0px 5px; " >5</li><li style= "Box-sizing:border-box; padding:0px 5px; " >6</li><li style= "Box-sizing:border-box; padding:0px 5px; " >7</li><li style= "Box-sizing:border-box; padding:0px 5px; " >8</li></ul></span>

< Span style= "font-size:14px" >3, exclude the annotation package where the V4 package is needed, note that the compile is added with parentheses:

<span style= "FONT-SIZE:14PX;" ><code class= "Hljs Ruby has-numbering" style= "display:block; padding:0px; Color:inherit; Box-sizing:border-box; font-family: ' Source Code Pro ', monospace;font-size:undefined; White-space:pre; border-radius:0px; Word-wrap:normal; background:transparent; " > Compile (<span class= "hljs-string" style= "Color:rgb (0, 136, 0); box-sizing:border-box;" > ' com.android.support:support-v4:22.2.1 ' </span>) {exclude <span class= "Hljs-class" style= "box-sizing:b Order-box; " ><span class= "Hljs-keyword" style= "Color:rgb (0, 0, 136); Box-sizing:border-box; " >module</span&gt: ' <span class= "Hljs-title" style= "Box-sizing:border-box; Color:rgb (102, 0, 102); " >support</span>-<span class= "Hljs-title" style= "Box-sizing:border-box; Color:rgb (102, 0, 102); " >annotations</span> ' </span>}</code><ul class= "pre-numbering" style= "box-sizing: Border-box; Position:absolute; width:50px; top:0px; Left:0px; margin:0px; padding:6px 0px 40px; border-right-width:1px; Border-right-style:solid; Border-right-color:rgb (221, 221, 221); List-style:none; Text-align:right; Background-color:rgb (238, 238, 238); " ><li style= "Box-sizing:border-box; padding:0px 5px; " >1</li><li style= "Box-sizing:border-box; padding:0px 5px; " >2</li><li style= "Box-sizing:border-box; padding:0px 5px; " >3</li></ul><ul class= "pre-numbering" style= "Box-sizing:border-box; Position:absolute; width:50px; top:0px; left:0px; margin:0px; padding:6px 0px 40px; border-right-width:1px; Border-right-style:solid; Border-right-color:rgb (221, 221, 221); List-style:none; Text-align:right; Background-color:rgb (238, 238, 238); " ><li style= "Box-sizing:border-box; padding:0px 5px; " >1</li><li style= "Box-sizing:border-box; padding:0px 5px; " >2</li><li style= "Box-sizing:border-box; padding:0px 5px; " >3</li></ul></spaN> 

The disadvantage is that every place to use the V4 package is so set.
4, add a sentence in the Dexoptions setting in the Build.gradle of application: Predexlibraries = False is OK:

PS: The above four methods can solve the problem, recommend the Orthodox Method 1 and Lazy Method 4.

<span style= "FONT-SIZE:14PX;" ><pre name= "Code" class= "JavaScript" ></span>



1. Example of using LRUCache to cache pictures: (memory cache)
Http://www.cnblogs.com/lichenwei/p/4437773.html
http://my.oschina.net/ryanhoo/blog/93406

Freemeory () in the 3.java.lang.runtime class, TotalMemory (), MaxMemory ()
MaxMemory (): Returns the maximum amount of memory that this process has dug from the operating system, in bytes.
TotalMemory (): Returns all memory occupied by the process at that time.
Freememory (): When the Java program running process, memory is always slowly from the operating system dug, basically how much digging how much, but the Java virtual machine will always dig some more, these more dug out and no use of memory, is freememory () the value returned, It is generally relatively small.

4.AsyncTask Lightweight Asynchronous class

The 5.MVC full name is the model View Controller, an abbreviation for the models-views (view)-Controller (Cotroller), a software design paradigm that organizes the code with a separate approach to business logic, data, and interface display. Aggregating business logic into a single component does not require rewriting business logic while improving and personalizing the interface and user interaction.

6.ToggleButton, Switch, checkbox, and RadioButton are all inherited from Android.widget.CompoundButton, meaning it is optional, so they are very similar in usage. The Compoundbutton has two states, namely checked and not checked.

The 7.native keyword means that the underlying function of the operating system can be called, so this technique becomes a JNI technology (Java Native Interface)

8.jre (Java Runtime Environment,java Runtime), the set of environments necessary to run Java programs, including the Java Virtual Machine (JVM), Java Core Class library, and supporting files. The Java program you write after Javac compiled will form a word lines file, this Java intermediate file, the computer is not understand, and this file is for the JVM (Java Virtual machine) used. It is interpreted by the JVM to form a machine language to the computer. And this JVM is in the JRE.
The JDK (Java Development Kit) is a software development kit for the Java language.
The basic components included in the JDK include:
javac-compiler to convert the source program into bytecode.
jar-Packaging tool to package related class files into a single file
javadoc-Document generator, extracting documents from source notes
Jdb-debugger, error-checking tool
Java-running the compiled Java program (. Class)


10. When the application is started, a PID, the process ID, is created and all activity is run on this process. Then we initialize the global variables when the application is created, all the activity of the same application can fetch the values of these global variables, in other words, we change the values of these global variables in one activity, Then the value of the other activity in the same application will change.

11. There are two ways to implement multithreading in Java, one is to inherit the thread class and one is to implement the Runnable interface; the thread class is defined in the Java.lang package. A class can implement multithreaded operations by inheriting the thread class while covering the Run method in this class, but a class can inherit only one parent class. This is the limitation of this method.
Thread
Http://www.jb51.net/article/37465.htm
With Run (), the first one is executed, the second is executed, and no one runs on each other. In other words, it is synchronous.
With the start () method, the program is run interactively. In other words, it is asynchronous.

In real-world development, a multithreaded operation rarely uses the thread class, but is accomplished through the Runnable interface.

Thread knows runnable and knows there is a run method inside runnable. Once the thread's Start method is called, the run in the Runnable method is automatically run by the thread. So, when we inherit our class (which should be called implementation interface) since runnable, our program belongs to the runnable type. Although it is a subclass of runnable, but people know your father, of course, also knew you.

Runnable is an interface, not a thread, and a generic thread implements Runnable. So if we use an anonymous inner class that is running on the main thread of the UI, if we use the threading class that implements the Runnable interface, it is run on the corresponding thread.

First of all, the Android CPU allocation of the smallest unit is a thread, handler is generally created in a line thread, so handler and thread are bound to each other, one by one.
While Runnable is an interface, thread is a subclass of runnable. So, they're both a process.

12.async Asynchronous
Sync synchronization


13. Results of Onresp not receiving returns

Create a new WXAPI directory under the appropriate directory for your package name, and add a wxentryactivity class under the Wxapi directory that inherits from the activity and adds a exported attribute to the manifest file, set to True. Android: Exported= "true" android:exported
This property is used to indicate whether the service can be invoked or interacted with by other application components. If set to true, it can be called or interacted with, otherwise it cannot. When set to False, only the component of the same application or an application with the same user ID can start or bind the service.
  
Implement the Iwxapieventhandler interface, the sent request will be callback to the Onreq method, and the response sent to the request will be callback to the Onresp method.
  
The Handleintent method that is passed to the Iwxapi interface by the intent that are received in wxentryactivity and the object that implements the Iwxapieventhandler interface.  When sending a request to your app, the callback will be done via the Onreq method of the Iwxapieventhandler interface, similar to the response result of the application request passing the ONRESP callback.
  


Android Error Summary

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.