Thursday, September 25, 2014

android Warning: xxx can't find referenced field 'int xxx' in class xxx.R$id

1.error

[2014-09-25 14:59:44 - pkrssv4] ------------------------------
[2014-09-25 14:59:44 - pkrssv4] Android Launch!
[2014-09-25 14:59:44 - pkrssv4] adb is running normally.
[2014-09-25 14:59:44 - pkrssv4] Performing com.pkrss.MainActivity activity launch
[2014-09-25 15:03:19 - pkrssv4] Launching a new emulator with Virtual Device '320_480_19'
[2014-09-25 15:04:07 - pkrssv4] New emulator found: emulator-5554
[2014-09-25 15:04:07 - pkrssv4] Waiting for HOME ('android.process.acore') to be launched...
[2014-09-25 15:05:08 - pkrssv4] HOME is up on device 'emulator-5554'
[2014-09-25 15:05:08 - pkrssv4] Uploading pkrssv4.apk onto device 'emulator-5554'
[2014-09-25 15:05:20 - pkrssv4] Installing pkrssv4.apk...
[2014-09-25 15:06:21 - pkrssv4] Success!
[2014-09-25 15:06:21 - webview_google] Could not find webview_google.apk!
[2014-09-25 15:06:21 - pkrssv4] Starting activity com.pkrss.MainActivity on device emulator-5554
[2014-09-25 15:06:24 - pkrssv4] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.pkrss.v4/com.pkrss.MainActivity }
[2014-09-25 15:06:26 - pkrssv4] Attempting to connect debugger to 'com.pkrss.v4' on port 8616
[2014-09-25 15:24:24 - pkrssv4] Proguard returned with error code 1. See console
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can't find referenced field 'int bottomLinearLayout' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can'
t find referenced field 'int topbar_imgbtn_speak' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can't find referenced field 'int imageLogo' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can'
t find referenced field 'int topbar_imgbtn_back' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can't find referenced field 'int topbar_imgbtn_next' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can'
t find referenced field 'int topbar_imgbtn_refresh' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can't find referenced field 'int topbar_imgbtn_edit' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can'
t find referenced field 'int topbar_imgbtn_favorite' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can't find referenced field 'int pB1' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity$9: can'
t find referenced field 'int topbar_imgbtn_back_parent' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity$9: can't find referenced field 'int topbar_imgbtn_next_parent' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.MainActivity: can'
t find referenced field 'int webview' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.MainActivity: can't find referenced field 'int topbar' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] Warning: com.pkrss.webview_core.MainActivity$2: can'
t find referenced field 'int topbar' in class com.pkrss.webview_core.R$id
[2014-09-25 15:24:24 - pkrssv4] You should check if you need to specify additional program jars.
[2014-09-25 15:24:24 - pkrssv4] Warning: there were 14 unresolved references to program class members.
[2014-09-25 15:24:24 - pkrssv4] Your input classes appear to be inconsistent.
[2014-09-25 15:24:24 - pkrssv4] You may need to recompile them and try again.
[2014-09-25 15:24:24 - pkrssv4] Alternatively, you may have to specify the option
[2014-09-25 15:24:24 - pkrssv4] '-dontskipnonpubliclibraryclassmembers'.
[2014-09-25 15:24:24 - pkrssv4] java.io.IOException: Please correct the above warnings first.
[2014-09-25 15:24:24 - pkrssv4] at proguard.Initializer.execute(Initializer.java:321)
[2014-09-25 15:24:24 - pkrssv4] at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-09-25 15:24:24 - pkrssv4] at proguard.ProGuard.execute(ProGuard.java:86)
[2014-09-25 15:24:24 - pkrssv4] at proguard.ProGuard.main(ProGuard.java:492)
[2014-09-25 15:25:00 - pkrssv4] Proguard returned with error code 1. See console
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can't find referenced field 'int bottomLinearLayout' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can'
t find referenced field 'int topbar_imgbtn_speak' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can't find referenced field 'int imageLogo' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can'
t find referenced field 'int topbar_imgbtn_back' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can't find referenced field 'int topbar_imgbtn_next' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can'
t find referenced field 'int topbar_imgbtn_refresh' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can't find referenced field 'int topbar_imgbtn_edit' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can'
t find referenced field 'int topbar_imgbtn_favorite' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity: can't find referenced field 'int pB1' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity$9: can'
t find referenced field 'int topbar_imgbtn_back_parent' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.BaseActivity$9: can't find referenced field 'int topbar_imgbtn_next_parent' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.MainActivity: can'
t find referenced field 'int webview' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.MainActivity: can't find referenced field 'int topbar' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] Warning: com.pkrss.webview_core.MainActivity$2: can'
t find referenced field 'int topbar' in class com.pkrss.webview_core.R$id
[2014-09-25 15:25:00 - pkrssv4] You should check if you need to specify additional program jars.
[2014-09-25 15:25:00 - pkrssv4] Warning: there were 14 unresolved references to program class members.
[2014-09-25 15:25:00 - pkrssv4] Your input classes appear to be inconsistent.
[2014-09-25 15:25:00 - pkrssv4] You may need to recompile them and try again.
[2014-09-25 15:25:00 - pkrssv4] Alternatively, you may have to specify the option
[2014-09-25 15:25:00 - pkrssv4] '-dontskipnonpubliclibraryclassmembers'.
[2014-09-25 15:25:00 - pkrssv4] java.io.IOException: Please correct the above warnings first.
[2014-09-25 15:25:00 - pkrssv4] at proguard.Initializer.execute(Initializer.java:321)
[2014-09-25 15:25:00 - pkrssv4] at proguard.ProGuard.initialize(ProGuard.java:211)
[2014-09-25 15:25:00 - pkrssv4] at proguard.ProGuard.execute(ProGuard.java:86)
[2014-09-25 15:25:00 - pkrssv4] at proguard.ProGuard.main(ProGuard.java:492)



2.fixed



because my project b refrence project a, and they have one same layout filename main_activity.xml, and project b project.property have “manifestmerger.enabled=true”,so i want to change the main_activity.xml of project a,and it ok now.



3.last



thanks your reading!

Saturday, September 20, 2014

#1215 - Cannot add foreign key constraint

1.error

#1215 - Cannot add foreign key constraint


2.old sql:



CREATE TABLE IF NOT EXISTS `pkrss_rssitem_l1` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tid` int(11) NOT NULL, `cid` int(11) NOT NULL COMMENT 'pkrss_rsscatalog.id', `lid` int(11) NOT NULL COMMENT 'pkrss_rsslocale.id', `item_pubdate` datetime DEFAULT NULL, `item_title` varchar(127) COLLATE utf8_bin NOT NULL, `item_desc` varchar(246) COLLATE utf8_bin NOT NULL, `item_link` varchar(246) CHARACTER SET ascii COLLATE ascii_bin NOT NULL, `item_authors` varchar(64) COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`), KEY `item_pubdate` (`item_pubdate`), CONSTRAINT fk_PerItems_l1 FOREIGN KEY (tid) REFERENCES pkrss_rsstable(id) on DELETE cascade ON update cascade ) DEFAULT CHARSET=utf8 COLLATE=utf8_bin


3.new sql



CREATE TABLE IF NOT EXISTS `pkrss_rssitem_l1` ( `id` int(11) NOT NULL AUTO_INCREMENT, `tid` int(11) NOT NULL, `cid` int(11) NOT NULL COMMENT 'pkrss_rsscatalog.id', `lid` int(11) NOT NULL COMMENT 'pkrss_rsslocale.id', `item_pubdate` datetime DEFAULT NULL, `item_title` varchar(127) COLLATE utf8_bin NOT NULL, `item_desc` varchar(246) COLLATE utf8_bin NOT NULL, `item_link` varchar(246) CHARACTER SET ascii COLLATE ascii_bin NOT NULL, `item_authors` varchar(64) COLLATE utf8_bin NOT NULL, PRIMARY KEY (`id`), KEY `item_pubdate` (`item_pubdate`), CONSTRAINT fk_PerItems_l1 FOREIGN KEY (tid) REFERENCES pkrss_rsstable(id) on DELETE cascade ON update cascade ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin



4.last



Note:



ENGINE=MyISAM

Thursday, September 11, 2014

Missing metadata tag with the name "com.google.android.gms.appstate.APP_ID" in the application tag of the manifest

1.error

09-11 22:37:45.919: E/ValidateServiceOp(5619): Missing metadata tag with the name "com.google.android.gms.appstate.APP_ID" in the application tag of the manifest for com.pkrss.snake


fixed:



moidfy AndroidManifest.xml:



<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id" />
<meta-data android:name="com.google.android.gms.appstate.APP_ID" android:value="@string/app_id" />

Tuesday, September 9, 2014

android maven error log:Could not find tool 'dx.jar' and Could not find tool 'aapt'

1.error

[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.3:dex (default-dex) on project gauges-android: Execution default-dex of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.3:dex failed: Could not find tool 'dx.jar'. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME. -> [Help 1]



fixed



 



image



reinstall  Android sdk plateform-tools,checked it,ok,checked it,ok.



then clean project,reopen eclipse.



if error not fixed,then



copy folder android sdk\build-tools\android-x.x\lib to android sdk\platform-tools\lib



2.error



[ERROR] Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.3:generate-sources (default-generate-sources) on project gauges-android: Execution default-generate-sources of goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.5.3:generate-sources failed: Could not find tool 'aapt'. Please provide a proper Android SDK directory path as configuration parameter <sdk><path>...</path></sdk> in the plugin <configuration/>. As an alternative, you may add the parameter to commandline: -Dandroid.sdk.path=... or set environment variable ANDROID_HOME. -> [Help 1]



fixed:



copy android sdk\build-tools\android-x.x\aapt.exe to android sdk\platform-tools\

[ERROR] E:\Program Files\Java\jre8\..\lib\tools.jar

1.error

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (default-compile) on project gauges-android: Compilation failure
[ERROR] Unable to locate the Javac Compiler in:
[ERROR] E:\Program Files\Java\jre8\..\lib\tools.jar
[ERROR] Please ensure you are using JDK 1.4 or above and
[ERROR] not a JRE (the com.sun.tools.javac.Main class is required).
[ERROR] In most cases you can change the location of your Java
[ERROR] installation by setting the JAVA_HOME environment variable.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException



fixed 1:



eclipse –> windows –> Preferences, selected Installed Jres, click Edit,Add External JARS, select your jdkhome/lib/tools.jar



image



or fixed 2:



System environment variable:



CLASSPATH=.;%JAVA_HOME%\jre\lib\rt.jar;%JAVA_HOME%\lib\tools.jar

Monday, September 8, 2014

windows + android + eclipse + maven + maven android plugin

1.install prepare

android sdk + eclipse

2.install apache maven

download from apache maven download , extract it, and add the bin/ directory to your system path variable.

3.install maven plugin in eclipse plugin

eclipse –> help –> install new software, then input maven,select ok in next steps.

4.download android maven plugin code

> git clone https://github.com/jayway/mav
en-android-plugin.git

> cd maven-android-plugin

in first time

> mvn clean install

or on error,then conintue run:

> mvn install

android ids.xml not translate error

1.error

when used android google play game sdk,add ids.xml to res/,then get bellow error message:

Description    Resource    Path    Location    Type
"app_id" is not translated in "af" (Afrikaans), "ar" (Arabic), "az" (Azerbaijani), "be" (Belarusian), "bg" (Bulgarian), "bn" (Bengali), "bs" (Bosnian), "ca" (Catalan), "cs" (Czech), "cy" (Welsh), "da" (Danish), "de" (German), "el" (Greek), "eo" (Esperanto), "es" (Spanish), "es-rUS" (Spanish: United States), "et" (Estonian), "eu" (Basque), "fa" (Persian), "fi" (Finnish), "fr" (French), "ga" (Irish), "gl" (Galician), "gu" (Gujarati), "ha" (Hausa), "hi" (Hindi), "hr" (Croatian), "ht" (Haitian), "hu" (Hungarian), "hy" (Armenian), "id" (Indonesian), "ig" (Igbo), "is" (Icelandic), "it" (Italian), "iw" (Hebrew), "ja" (Japanese), "jw", "ka" (Georgian), "km" (Khmer), "kn" (Kannada), "ko" (Korean), "la" (Latin), "lo" (Lao), "lt" (Lithuanian), "lv" (Latvian), "mi" (Māori), "mk" (Macedonian), "mn" (Mongolian), "mr" (Marathi), "ms" (Malay), "mt" (Maltese), "nb" (Norwegian Bokm?l), "ne" (Nepali), "nl" (Dutch), "no" (Norwegian), "pa" (Panjabi), "pl" (Polish), "pt" (Portuguese), "ro" (Romanian), "ru" (Russian), "sk" (Slovak), "sl" (Slovene), "so" (Somali), "sq" (Albanian), "sr" (Serbian), "sv" (Swedish), "sw" (Swahili), "ta" (Tamil), "te" (Telugu), "th" (Thai), "tl" (Tagalog), "tr" (Turkish), "uk" (Ukrainian), "ur" (Urdu), "vi" (Vietnamese), "yi" (Yiddish), "yo" (Yorùbá), "zh-rCN" (Chinese: China), "zh-rTW" (Chinese: Taiwan, Province of China), "zu" (Zulu) ids.xml /Snake/res/values line 3 Android Lint Problem



 



2:fixed:



old xml files:



<resources>
<string name="app_id">15921771863</string>
</resources>



new xml files:



<?xml version="1.0" encoding="utf-8" ?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="TypographyDashes">
<string name="app_id" translatable="false">15921771863</string>
</resources>

Sunday, September 7, 2014

09-07 23:12:19.520: E/GamesNativeSDK(5012): Exception in dalvik/system/DexClassLoader.loadClass: java.lang.ClassNotFoundException: com.google.android.gms.games.NativeSdkCallbacks.

1.i used cocos2d-x 3.0 and google play game sdk c++, after with office step,i get bellow error.

error

09-07 23:12:19.170: E/GamesNativeSDK(5012): Can't register class com/google/android/gms/games/PlayerLevel: an exception occurred.
09-07 23:12:19.170: E/GamesNativeSDK(5012): Can'
t register class com/google/android/gms/games/PlayerLevelInfo: an exception occurred.
09-07 23:12:19.180: E/GamesNativeSDK(5012): Can't register class com/google/android/gms/games/event/Event: an exception occurred.
09-07 23:12:19.180: E/GamesNativeSDK(5012): Can'
t register class com/google/android/gms/games/event/EventBuffer: an exception occurred.
09-07 23:12:19.180: E/GamesNativeSDK(5012): Can't register class com/google/android/gms/games/event/Events: an exception occurred.
09-07 23:12:19.180: E/GamesNativeSDK(5012): Can'
t register class com/google/android/gms/games/event/Events$LoadEventsResult: an exception occurred.
09-07 23:12:19.230: E/GamesNativeSDK(5012): Can't register class com/google/android/gms/games/quest/Quest: an exception occurred.
09-07 23:12:19.230: E/GamesNativeSDK(5012): Can'
t register class com/google/android/gms/games/quest/QuestBuffer: an exception occurred.
09-07 23:12:19.230: E/GamesNativeSDK(5012): Can't register class com/google/android/gms/games/quest/Quests: an exception occurred.
09-07 23:12:19.240: E/GamesNativeSDK(5012): Can'
t register class com/google/android/gms/games/quest/Milestone: an exception occurred.
09-07 23:12:19.240: E/GamesNativeSDK(5012): Can't register class com/google/android/gms/games/quest/Quests$LoadQuestsResult: an exception occurred.
09-07 23:12:19.250: E/GamesNativeSDK(5012): Can'
t register class com/google/android/gms/games/quest/Quests$AcceptQuestResult: an exception occurred.
09-07 23:12:19.250: E/GamesNativeSDK(5012): Can't register class com/google/android/gms/games/quest/Quests$ClaimMilestoneResult: an exception occurred.
09-07 23:12:19.250: E/GamesNativeSDK(5012): Can'
t register class com/google/android/gms/games/snapshot/Snapshot: an exception occurred.
09-07 23:12:19.270: E/GamesNativeSDK(5012): Can't register class com/google/android/gms/games/snapshot/SnapshotMetadata: an exception occurred.
09-07 23:12:19.270: E/GamesNativeSDK(5012): Can'
t register class com/google/android/gms/games/snapshot/SnapshotMetadataBuffer: an exception occurred.
09-07 23:12:19.280: E/GamesNativeSDK(5012): Can't register class com/google/android/gms/games/snapshot/Snapshots: an exception occurred.
09-07 23:12:19.280: E/GamesNativeSDK(5012): Can'
t register class com/google/android/gms/games/snapshot/Snapshots$CommitSnapshotResult: an exception occurred.
09-07 23:12:19.280: E/GamesNativeSDK(5012): Can't register class com/google/android/gms/games/snapshot/Snapshots$LoadSnapshotsResult: an exception occurred.
09-07 23:12:19.280: E/GamesNativeSDK(5012): Can'
t register class com/google/android/gms/games/snapshot/Snapshots$OpenSnapshotResult: an exception occurred.
09-07 23:12:19.290: E/GamesNativeSDK(5012): Can't register class com/google/android/gms/games/snapshot/SnapshotMetadataChange: an exception occurred.
09-07 23:12:19.290: E/GamesNativeSDK(5012): Can'
t register class com/google/android/gms/games/snapshot/SnapshotMetadataChange$Builder: an exception occurred.
09-07 23:12:19.300: W/dalvikvm(5012): dvmFindClassByName rejecting 'com/pkrss/cocos2d/SdkOperator'
09-07 23:12:19.410: I/GAV2(5012): Thread[main,5,main]: Initializing Game Services
09-07 23:12:19.410: I/GAV2(5012): Thread[main,5,main]: Uninitialized services, so creating
09-07 23:12:19.520: W/dalvikvm(5012): Link of class 'Lcom/google/android/gms/games/NativeSdkCallbacks;' failed
09-07 23:12:19.520: W/dalvikvm(5012): JNI WARNING: received null jclass
09-07 23:12:19.520: E/GamesNativeSDK(5012): Exception in dalvik/system/DexClassLoader.loadClass: java.lang.ClassNotFoundException: com.google.android.gms.games.NativeSdkCallbacks.
09-07 23:12:19.520: W/dalvikvm(5012): in Lcom/pkrss/cocos2d/wrapper;.nativeInitGPGS:(Landroid/app/Activity;)V (RegisterNatives)
09-07 23:12:19.520: I/dalvikvm(5012): "main" prio=5 tid=1 NATIVE
09-07 23:12:19.520: I/dalvikvm(5012): | group="main" sCount=0 dsCount=0 obj=0x40dfb6a0 self=0x408ea218
09-07 23:12:19.520: I/dalvikvm(5012): | sysTid=5012 nice=0 sched=0/0 cgrp=apps handle=1075221440
09-07 23:12:19.520: I/dalvikvm(5012): | schedstat=( 0 0 0 ) utm=39 stm=17 core=0
09-07 23:12:19.580: I/dalvikvm(5012): #00 pc 00001260 /system/lib/libcorkscrew.so (unwind_backtrace_thread+27)
09-07 23:12:19.580: I/dalvikvm(5012): #01 pc 0005f88c /system/lib/libdvm.so (dvmDumpNativeStack(DebugOutputTarget const*, int)+35)
09-07 23:12:19.580: I/dalvikvm(5012): #02 pc 0005401e /system/lib/libdvm.so (dvmDumpThreadEx(DebugOutputTarget const*, Thread*, bool)+289)
09-07 23:12:19.580: I/dalvikvm(5012): #03 pc 000540ae /system/lib/libdvm.so (dvmDumpThread(Thread*, bool)+25)
09-07 23:12:19.580: I/dalvikvm(5012): #04 pc 0003a33e /system/lib/libdvm.so
09-07 23:12:19.580: I/dalvikvm(5012): #05 pc 0003a612 /system/lib/libdvm.so
09-07 23:12:19.580: I/dalvikvm(5012): #06 pc 0003b58a /system/lib/libdvm.so
09-07 23:12:19.580: I/dalvikvm(5012): #07 pc 0003c100 /system/lib/libdvm.so
09-07 23:12:19.580: I/dalvikvm(5012): #08 pc 002c7958 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so
09-07 23:12:19.580: I/dalvikvm(5012): #09 pc 002c7e80 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so
09-07 23:12:19.580: I/dalvikvm(5012): #10 pc 002c4914 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (gpg::AndroidPlatformConfiguration::Valid() const+59)
09-07 23:12:19.580: I/dalvikvm(5012): #11 pc 0029a5a4 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (gpg::GameServices::Builder::Create(gpg::AndroidPlatformConfiguration const&)+39)
09-07 23:12:19.580: I/dalvikvm(5012): #12 pc 0023f9fe /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (_GpgSdkProxy::InitServices(gpg::AndroidPlatformConfiguration&)+189)
09-07 23:12:19.580: I/dalvikvm(5012): #13 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #14 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #15 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #16 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #17 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #18 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #19 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #20 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #21 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #22 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #23 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #24 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #25 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #26 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #27 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #28 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #29 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #30 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): #31 pc 0023f910 /data/data/com.pkrss.snake/lib/libcocos2dcpp.so (Java_com_pkrss_cocos2d_wrapper_nativeInitGPGS+43)
09-07 23:12:19.580: I/dalvikvm(5012): at com.pkrss.cocos2d.wrapper.nativeInitGPGS(Native Method)
09-07 23:12:19.590: I/dalvikvm(5012): at com.pkrss.cocos2d.Cocos2dAppActivity.onCreate(Cocos2dAppActivity.java:17)
09-07 23:12:19.590: I/dalvikvm(5012): at com.pkrss.snake.AppActivity.onCreate(AppActivity.java:21)
09-07 23:12:19.590: I/dalvikvm(5012): at android.app.Activity.performCreate(Activity.java:5010)
09-07 23:12:19.600: I/dalvikvm(5012): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
09-07 23:12:19.600: I/dalvikvm(5012): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2036)
09-07 23:12:19.600: I/dalvikvm(5012): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2097)
09-07 23:12:19.600: I/dalvikvm(5012): at android.app.ActivityThread.access$600(ActivityThread.java:137)
09-07 23:12:19.600: I/dalvikvm(5012): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1205)
09-07 23:12:19.600: I/dalvikvm(5012): at android.os.Handler.dispatchMessage(Handler.java:99)
09-07 23:12:19.600: I/dalvikvm(5012): at android.os.Looper.loop(Looper.java:137)
09-07 23:12:19.600: I/dalvikvm(5012): at android.app.ActivityThread.main(ActivityThread.java:4791)
09-07 23:12:19.600: I/dalvikvm(5012): at java.lang.reflect.Method.invokeNative(Native Method)
09-07 23:12:19.600: I/dalvikvm(5012): at java.lang.reflect.Method.invoke(Method.java:511)
09-07 23:12:19.600: I/dalvikvm(5012): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
09-07 23:12:19.600: I/dalvikvm(5012): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
09-07 23:12:19.600: I/dalvikvm(5012): at dalvik.system.NativeStart.main(Native Method)
09-07 23:12:19.600: E/dalvikvm(5012): VM aborting
09-07 23:12:19.600: A/libc(5012): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 5012 (main)




fixed:



upgrade newest google-play-services_lib,it is ok now.

Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. Please use Android Tools > Fix Project Properties.

1.error

[2014-09-08 09:45:04 - google-play-services_lib] Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. Please use Android Tools > Fix Project Properties.


2.fixed
 
1 Project Right -> android tools -> Fix Project 

2 If not, check the Project -> Properties-> Java Compiler      Confirm JDK compliance is set to 1.6, and enable specific seetings.

Saturday, September 6, 2014

cocos2d-x 3.0 parse xml used tinyxml

1.bellows is cocos2d-x 3.0 parse xml from file code,because i writed some error parse code,and fixed it.

bool RuntimeProfile::init(){
reset();

std::string currentLanguageCode = Application::getInstance()->getCurrentLanguageCode();
if (currentLanguageCode == "zh")
currentLanguageCode = "values-zh-rCN";

unsigned char* buf = 0;
do{

if (currentLanguageCode.empty())
break;

try{
std::string file_path = FileUtils::getInstance()->fullPathForFilename("locales/" + currentLanguageCode + "/strings.xml");
if (!FileUtils::getInstance()->isFileExist(file_path))
break;

ssize_t size;
buf = FileUtils::getInstance()->getFileData(file_path, "r", &size);
if (!buf)
break;

tinyxml2::XMLDocument* myDocment = new tinyxml2::XMLDocument();

if (tinyxml2::XML_NO_ERROR != myDocment->Parse((const char*)buf, size)){
break;
}

tinyxml2::XMLElement* rootElement = myDocment->RootElement();
if (!rootElement)
break;

tinyxml2::XMLElement* childElement = rootElement->FirstChildElement("string");

const char* key = NULL;

while (childElement) {
key = childElement->Attribute("name");
if (key && key[0])
mLangDictory[key] = childElement->GetText();

childElement = childElement->NextSiblingElement("string");
}
}
catch (...){
}

} while (false);

CC_SAFE_FREE(buf);

return true;
}

Wednesday, September 3, 2014

2014年8月青奥会闭幕式 青奥会激光笔照射事件

(有人乱删贴,我来贴原文,留给以后看)

在2014年8月青奥会闭幕式上,出现了令人遗憾的场景:总理,国际奥委会主席巴赫,国旗护卫队队员和演出人员,都被韩国人激光队照射眼睛。但是奇怪的是,今天所有报道此事的媒体网页都被删除,各大论坛也是一样,不知道组委会什么想法,圣母心态?大国情怀?必须转起来,让更多的人认清棒子的丑恶嘴脸!!!

青奥会闭幕式晚上下大雨,武警在外面站岗两个多小时,演出人员冒雨演出,安保人员许多从早上四点多开始工作,成功举办了第二届青年奥运会,中间发生了一段不和谐的插曲,李维亚导演再三恳求观众不要用激光笔去照射感光地面,因为会破坏直播效果,属于重大演出失误,再三陈述不许使用,但有一位观众不怀好意,在切总理画面时候用激光笔照射总理,造成恶劣影响,该观众一而再再而三搞破坏,照射总理,巴赫主席,照射国旗护卫队队员的眼睛,照射演出人员的眼睛。

转自网络。