Common issues encountered in Android development Android Project Integration

Source: Internet
Author: User
Tags xml attribute

Problems


1. import Supportv7demo Compile error, console prompt

[2016-05-26 16:17:22-support7demos] D:\workspace\xa27_advanced\support7demos\res\values\styles.xml:26:error:error Retrieving parent for item: No Resource found that matches the given name

' Theme. AppCompat. Light.noactionbar '.

Reason: Need to rely on Support\v7\appcompat library

Workaround: Import the APPCOMAPT library

Tip: Be sure to select Copy

2. Library items cannot be run

3. Utils cannot be resolved not found

4. Error:error Retrieving parent for item:no Resource found that matches the given name ' Android:widget. Material. Actionbutton '.

Reason: Material

Background: New design styles for Android 5.0

Workaround: Compile with Android6.0 instead

5 ,

Dependency List : Dependency list

Cause: Supportv4.jar has multiple versions and there are conflicts between them

Workaround: Change the Supportv4.jar in the project and library to the same version, or delete the Supportv4.jar in the project

Sdk\extras\android\m2repository\com\android\support\support-v4

2. Change the minimum version number in the list to 9

Call requires API level one (current min is 9): Android.app.activity#oncreateview

Cause: The analysis found no use of the Oncreateview () method, the Eclipse compilation problem

Solution: Clean

Avoid:

4. [2016-05-27 12:00:44-ex05_actionbar minimum compatible 4.0] ActivityManager:Warning:Activity not started, it current Task have been brought to the front

Cause: A bug that runs different projects, eclipse

Solution: Clean

5. the minimum version number in the list is 9, and the Shouasaction in the menu XML file has a warning

Attribute "Showasaction" is a used in API level one and higher (current min is 9)

Cause: A higher version of the XML attribute is used

Resolution: Use the AppcompatV7 property instead

Terminology: namespace xmlns

6. Type mismatch: cannot convert from blankfragment to Myfragment

types do not match

7

ft object is invalidated after commit, next use requires re-creation

8. Use the OnClick property in the fragment layout, run-time FC

Cause: The runtime system will find the method that corresponds to the OnClick property value in the activity

Won't find a way in fragment.

Workaround: Do not use the onclick in the fragment layout

NullPointerException Exception

cause by Follow your code to indicate that an object in the current code is null

For example

Causeby then not your own code, stating that the current code triggered a null pointer to another code

The reason is that passing in a parameter is null

For example:

9. the layout of the ID is not in Contentview

Add toolbar in layout, compile error

Error:error parsing xml:unbound prefix

Cause: namespace not defined

Resolution: declaring namespaces

xmlns:appv7= "Http://schemas.android.com/apk/res-auto"

Class requires API Level 3 (current min is 1): Android.widget.HorizontalScrollView

The minimum SDK configuration in the checklist is higher than 3

Cause: The project for Android Studio, the minimum version number is not in the manifest file

14.

The Open Source Library throws an exception because it passes in a pager that does not have an adapter object set

FIX: Set pager adapter first, then pass in

15.

No rewrite Getpagetitle () method

16.

Cause: Bug in Eclipse

Solution: Clean

Note: For use in XML layout files, you must overload the construction method of two parameters

Let the custom control move.

Note: If the control is refreshed on a child thread, the invalidate () method cannot be called

need to call Postinvalidate ()

Add top cities

ListView when adding Headview, you must first add and then set the adapter

Resolving nested gridview Conflicts in a ListView

ScrollView Nested gridview ScrollView nested listview

using Gridview4scrollview in the library

5. JDK1.7 New syntax, generics

Copy supportv7demo the actionbarwithdrawerlayout class compile error

The import android.support.v7 cannot be resolved

copy supportv7demo actionbarwithdrawerlayout class run FC

Cause: If the activity inherits Appcompatactivity, the theme must use the theme that starts with Theme.appcompat

FIX: Modify the topics that are configured in the checklist

1. Resolve the generated Pojo compilation error

1) copy a Gson.jar in the Project Libs directory, or rely on the lib_yuchen0428 library

2) Ctrl + 1, add package name

3) Delete Import

4) Delete

Parse the JSON object, but download the Jsonarray string

2. Parse the Jsonarray object, but download the JSON string

3. [2016-06-01 12:03:51- Dex Loader] Unable to execute dex:multiple Dex files define Lcom/android/ Volley/volleyerror;

[2016-06-01 12:03:51-ex33_ using Gson Package parsing JSON] Conversion to Dalvik format failed:unable to execute DEX:MULTIPL E dex files define lcom/android/volley/volleyerror;

Cause: Multiple uses of the same library, library conflicts

FIX: Delete One of the duplicate libraries used in the project

4. using the UIL runtime FC

Init initial initialization Initialize

Cause: Not configured before use

5.

Cause: Java classes generated using the Jsonschema2pojo tool may have some fields that are not of the correct type and need to be modified

FIX: Modify Pojo based on actual type

5. added a parameterized construction method for Intentservice subclasses, runtime FC

1. multiple Open Interface common conflict issues with so files

Complete missing directories in Libs, so files are copied from armeabi-v7a

. methods that are not called by Java code in. so

3. cannot find the so file in a so directory

4. Compile error when inheriting Intentservice implicit Super constructor Intentservice () is undefined. Must explicitly invoke another constructor

5. added a parameterized construction method for Intentservice subclasses, runtime FC

5. added a parameterized construction method for Intentservice subclasses, runtime FC


This article is from the "How to play the Java Foundation" blog, please be sure to keep this source http://xiezhengping.blog.51cto.com/8272111/1794387

Common issues encountered in Android development Android Project Integration

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.