1. Unable to resolve target 'android-2'
Install the api of the earlier version and change target = android-2 to target = android-7 in the default. properties file.
2. Invalid start tag LinearLayout
The main. xml folder has been put incorrectly. It should be under \ res \ layout.
3. INSTALL_FAILED_INSUFFICIENT_STORAGE
Cause: insufficient SD card memory capacity
Method 1: Add "-partition-size 128" to "Additional Emulator Command Line Options"
Method 2: Start the simulator and enter the menu
Settings-> applications-> mange applications-> select the application-> select "unistall ".
In this way, the apk can be completely deleted and re-installed.
4. No Space left on device
Clear the tmp file in the C: \ Users \ Lanyan \ AppData \ Local \ Temp \ AndroidEmulator folder
5. cocould not open the editor: Resource is out of sync with the file system
When you right-click default. properties to open it, an error occurs:
Solution: Right-click the project and Refresh it.
Cause: Usually happens when some files are edited outside of eclipse.
6. Invalid project description
Solution: In the. project file under the root directory of the project, find <name> cms6.0 </name> and change cms6.0 to the same name as the project directory.
Solution: I have already imported this project into Eclipse. A project cannot be imported twice. Or, you can import the project to another directory in your folder and try again.
Cause: There are two descriptive files with the same AndroidManifest. xml.
7. java. lang. SecurityException: Requires VIBRATE permission
Solution: add the following statement to AndroidManifest. xml:
"<Uses-permission android: name =" android. permission. VIBRATE "> </uses-permission>"
Cause: A permission error occurs because the vibration function is used.
8. Activity not started, its current task has been brought to the front
Solution: In Eclipse, "project" --> "clean ..."
Cause: There is something running in the simulator, that is, the activity you want to run already runs in the simulator. Don't think your simulator is running when it exits to the desktop. During debugging, an activity may be running if the program is shut down abnormally.
9. ArrayAdapter requires the resource ID to be a TextView
Problem description: java. lang. IllegalStateException: ArrayAdapter requires the resource ID to be a TextView and
Adapt = new ArrayAdapter <String> (this, R. layout. main, infoList );
In this sentence, the layout in layout main may not be a TextView object.
Adapt = new ArrayAdapter <String> (A1, A2, A3 );
The A2 parameter is a "resource ID to be a TextView
Solution: Change A2 to android. R. layout. simple_spinner_dropdown_item.
10. The R. java file suddenly disappeared.
Solution: Right-click the Project and choose Build Project.
Cause: the file name under res/drawable can only be ~ Z, 0 ~ A string of 9 characters.
10. ScrollView can host only one direct child.
Solution: Put all child elements in a LinearLayout or RelativeLayout layout.
Cause: Only one subelement can be included in ScrollView, that is, two subelements cannot be tied together.
11. emulator: ERROR: the user data image is used by another emulator. aborting
Otherwise, delete the folder ending with. lock under android-sdk-windows \. android \ avd.
Cause :. lock is a lock. If the program crashes or other causes, it cannot be cleared. this problem occurs in the folder at the end of lock, that is, the avd lock is not released, causing avd manager to think that the avd is in use.
12. * daemon not running. starting it now *
ADB server didn't ACK
* Failed to start daemon *
After confirming that the path of adb.exe is correct, the simulator and eclipse cannot be restarted twice. I checked the information online ~
Solution:
(1, close all adb.exe; (2) Restart eclipse.
13. android. content. res. resources notfoundexception
Add <uses-sdk android: minSdkVersion = "5"/> to Manifest. xml, or change 5 to 6. Add 1 to other values.
14. Unable to instantiate activity ComponentInfo
Solution: Change activity android: name = "Acitivity" to activity android: name = ". Acitivity"
Cause: An error occurred while configuring the activity path in AndroidManifest. xml.
15. There is a red exclamation mark on the project name
Solution: Right-click the project name BuildPath ---> ConfigureBuildPaht..., and find the package whose Red Cross number appears in Libraries as the path error. Modify the current path of the corresponding package in classpath. Then return to the eclipse F5 to refresh the project.
Cause: the package path pointed to in classpath in the project is incorrect.
Explanation: create a web project using myeclipse. A. classpath configuration file is generated under the project directory, which contains the jar configuration referenced in your project. This. classpath has no impact on your web project, but it is actually identified by myeclipse. This is because the configuration in the. classpath file references a jar, but in fact your lib does not have this jar, so there will be a red prompt. You don't need to take it. find the classpath file one by one with your jar file. Right-click MyEclipse and choose BuildPath> ConfigureBuildPaht... --> find Libraries on several tabs. Here we see all the jar files referenced in your project. Is there a small yellow exclamation point on a jar icon? If yes, select the jar and click Remove --> Click OK to wait for a few seconds. Now, the red XX on the web project does not exist. Haha. Explanation: the yellow exclamation mark jar indicates that the. classpath configuration file references the jar, but the jar is not in lib.
16. ActivityNotFoundException)
Solution: Add <activity android: name = ". Filelist" android: label = "@ string/app_name"/> to AndroidManifest. xml.
17. Fail to connect to camera service
Add <uses-permission android: name = "android. permission. CAMERA"/> In AndroidManifest. xml
If not
@ Override
Public void surfaceDestroyed (SurfaceHolder holder ){
// TODO Auto-generated method stub
MCamera. stopPreview ();
MCamera. release (); // Add this sentence, OK!
MCamera = null;
}
18. android. view. WindowManager $ BadTokenException: Unable to add window -- token null is not for an application
Solution: use Activity. this (Activity is the name of your Activity) to fill the parameters in new AlertDialog. Builder (Context context) to create a correct Dialog.
This error is reported in the new AlertDialog. builder (mcontext), although the parameter here is AlertDialog. builder (Context context), but we cannot use the Context obtained by getApplicationContext (). Instead, we must use Activity, because only one Activity can add a form.
19. java. io. IOException: the software in your host suspends a established connection.
Terminate the adb service in the task manager, disable mobile phone debugging or simulators, and restart.
20. java. lang. IllegalStateException: Circular dependencies cannot exist in RelativeLayout
The two locations cannot be used at the same time, but some of them do not report exceptions.
For example, android: layout_alignParentTop = "true" android: layout_centerHorizontal = "true"
21. No resource found that matches the given name
In the relative layout, if the android: layout_abve attribute is used and the subsequent id has not appeared before, you need to write: android: layout_abve = "@ + id/vidAdd_ButtonGroup ", add "+ ".
22. @ Override Error
Window-> Preferences-> Java-> Compiler.
Change the level of Compiler compliance level to 1.6. Only the default settings are required for each project attribute. Do not set specific.
23. PANIC: cocould not open: C: \ Users \ Lanyan \. android/avd/SDK2.2.ini
Add the android_sdk_home system variable with the value of the directory where you want to save avd. For example, place it under D: \ Program Files \ android \ avd.
24. Activity has leaked window that was originally added
Cause 1: When onKeyDown is rewritten, return super. onKeyDown (int keyCode, KeyEvent event) is not modified;
Cause 2: when the Activity is disabled, AlertDialog is not disabled.
Method 1: Change return super. onKeyDown (int keyCode, KeyEvent event) to return false;
Method 2: @ Override
Protected void onPause ()
{
Super. onPause ();
// Close the dialog box
AlertDialog. dismiss ();
}
Method 3: In AndroidManifest. xml, add
Android: configChanges = "orientation | keyboardHidden | navigation"
25. unable to instantiate application
Solution 1: remove the android: name in the application in AndroidManifest. xml;
Solution 2: The Global class or variable is private;
Solution 3: the package path is incorrect.
26. IllegalArgumentException 'provider "gps" unknown"
LocationManager. setTestProviderEnabled (LocationManager. GPS_PROVIDER, true); LocationManager cannot be triggered.
Just add the following parameters:
MLocationManager. addTestProvider (LocationManager. GPS_PROVIDER,
"RequiresNetwork" = "", "requiresSatellite" = "", "requiresCell" = "", "hasMonetaryCost" = "",
"SupportsAltitude" = "", "supportsSpeed" = "",
"SupportsBearing" = "", android. location. Criteria. POWER_LOW,
Android. location. Criteria. ACCURACY_FINE );