我已注册cloud.google.com并制作应用。我生成了服务器密钥(可以仪表板 - >选择项目 - > API& Auth - >凭据 - >服务器密钥)
我使用应用程序ID(Google API项目编号)作为发件人ID,将服务器API密钥用作GCM API密钥。
我在Android模拟器中运行。
我的环境:
已修改 - 已添加日志
Titanium Command-Line Interface, CLI version 3.2.0-cr3, Titanium SDK version 3.2.0.v20131210191510
Copyright (c) 2012-2013, Appcelerator, Inc. All Rights Reserved.
Please report bugs to http://jira.appcelerator.org/
[INFO] : Found Titanium module id=ti.cloud version=latest platform=commonjs deploy-type=development path=/Users/...//Titanium/modules/commonjs/ti.cloud/3.2.0
[INFO] : Found Titanium module id=ti.cloudpush version=latest platform=android deploy-type=development path=/Users/...//Titanium/modules/android/ti.cloudpush/3.2.0
[INFO] : Found Titanium plugin id=ti.alloy version=1.0
[INFO] : Deploy type: development
[INFO] : Building for target: emulator
[INFO] : Building for emulator: titanium_2_WVGA854
[INFO] : Targeting Android SDK: 19
[INFO] : Building for the following architectures: armeabi, armeabi-v7a, x86
[INFO] : Signing with keystore: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/dev_keystore (tidev)
[INFO] : Debugging disabled
[INFO] : Profiler disabled
[INFO] : Forcing rebuild: /.../push/build/android/build-manifest.json does not exist
[INFO] : Found Alloy app in /.../push/app
[INFO] : Executing Alloy compile: /usr/local/bin/node /usr/local/bin/alloy compile /.../push/app --config platform=android,version=0,simtype=none,devicefamily=none,deploytype=development
[INFO] : ----- MVC GENERATION -----
[INFO] : [global style] loading from cache...
[INFO] : [index.xml] view processing...
[INFO] : style: "index.tss"
[INFO] : view: "index.xml"
[INFO] : controller: "index.js"
[INFO] : created: "Resources/android/alloy/controllers/index.js"
[INFO] : created: "Resources/android/alloy/styles/index.js"
[INFO] :
[INFO] : [app.js] using cached app.js...
[INFO] :
[INFO] : ----- OPTIMIZING -----
[INFO] : - android/alloy.js
[INFO] : - android/alloy/sync/localStorage.js
[INFO] : - android/alloy/sync/properties.js
[INFO] : - android/alloy/sync/sql.js
[INFO] :
[INFO] : Alloy compiled in 0.40172s
[INFO] : Alloy compiler completed successfully
[INFO] : Launching emulator: titanium_2_WVGA854
[INFO] : Running: /Volumes/data/android/tools/emulator "-avd" "titanium_2_WVGA854" "-port" "5554" "-no-boot-anim" "-partition-size" "128" "-sdcard" "/Users/krish/.titanium/titanium_2_WVGA854.sdcard"
[INFO] : Processing JavaScript files
[INFO] : Writing /.../push/build/android/bin/assets/app.json
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-network.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-xml.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-analytics.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-android.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-app.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-ui.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-filesystem.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-media.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-locale.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-utils.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-geolocation.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-accelerometer.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-contacts.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-map.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-gesture.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-calendar.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-platform.res.zip
[INFO] : Extracting module resources: /Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-database.res.zip
[INFO] : No aidl files to compile, continuing
[INFO] : Generating i18n files
[INFO] : Generating /.../push/build/android/res/values/theme.xml
[INFO] : Packaging application: /Volumes/data/android/build-tools/android-4.4/aapt "package" "-f" "-m" "-J" "/.../push/build/android/gen" "-M" "/.../push/build/android/AndroidManifest.xml" "-A" "/.../push/build/android/bin/assets" "-S" "/.../push/build/android/res" "-I" "/Volumes/data/android/platforms/android-19/android.jar" "-I" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/titanium.jar" "-F" "/.../push/build/android/bin/app.ap_"
[INFO] : Building Java source files: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/javac "-J-Xmx256M" "-encoding" "utf8" "-bootclasspath" "/Volumes/data/android/platforms/android-19/android.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/kroll-v8.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-network.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/thirdparty.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-xml.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/jaxen-1.1.1.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-analytics.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-android.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/ti-commons-codec-1.3.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/kroll-common.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/titanium.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-app.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-ui.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/android-support-v4.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/nineoldandroids-appc-2.4.0.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-filesystem.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-media.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-locale.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-utils.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-geolocation.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-accelerometer.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-contacts.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-map.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-gesture.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-calendar.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-platform.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-database.jar:/Users/...//Titanium/modules/android/ti.cloudpush/3.2.0/cloudpush.jar:/Users/...//Titanium/modules/android/ti.cloudpush/3.2.0/lib/bcprov-jdk15-146-shrink.jar:/Users/...//Titanium/modules/android/ti.cloudpush/3.2.0/lib/google-play-services.jar:/Users/...//Titanium/modules/android/ti.cloudpush/3.2.0/lib/signpost-commonshttp4-1.2.1.1.jar:/Users/...//Titanium/modules/android/ti.cloudpush/3.2.0/lib/signpost-core-1.2.1.1.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/kroll-apt.jar:/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/lib/titanium-verify.jar:ApplicationStylesheet.class:Manifest.class:PushActivity.class:PushAppInfo.class:PushApplication.class:R.class" "-d" "/.../push/build/android/bin/classes" "-proc:none" "-target" "1.6" "-source" "1.6" "@/.../push/build/android/java-sources.txt"
[INFO] : Running dexer: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java "-Xmx1024M" "-XX:-UseGCOverheadLimit" "-Djava.ext.dirs=/Volumes/data/android/platform-tools" "-jar" "/Volumes/data/android/build-tools/android-4.4/lib/dx.jar" "--dex" "--output=/.../push/build/android/bin/classes.dex" "/.../push/build/android/bin/classes" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/lib/titanium-verify.jar" "/Users/...//Titanium/modules/android/ti.cloudpush/3.2.0/cloudpush.jar" "/Users/...//Titanium/modules/android/ti.cloudpush/3.2.0/lib/bcprov-jdk15-146-shrink.jar" "/Users/...//Titanium/modules/android/ti.cloudpush/3.2.0/lib/google-play-services.jar" "/Users/...//Titanium/modules/android/ti.cloudpush/3.2.0/lib/signpost-commonshttp4-1.2.1.1.jar" "/Users/...//Titanium/modules/android/ti.cloudpush/3.2.0/lib/signpost-core-1.2.1.1.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/kroll-v8.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-network.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/thirdparty.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-xml.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/jaxen-1.1.1.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-analytics.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-android.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/ti-commons-codec-1.3.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/kroll-common.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/titanium.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-app.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-ui.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/android-support-v4.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/nineoldandroids-appc-2.4.0.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-filesystem.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-media.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-locale.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-utils.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-geolocation.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-accelerometer.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-contacts.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-map.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-gesture.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-calendar.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-platform.jar" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/modules/titanium-database.jar"
[INFO] : Creating unsigned apk
[INFO] : Processing /.../push/build/android/src
[INFO] : Writing unsigned apk: /.../push/build/android/bin/app-unsigned.apk
[INFO] : Determining signature algorithm: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/keytool "-J-Duser.language=en" "-v" "-list" "-keystore" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/dev_keystore" "**********" "tirocks" "-alias" "tidev"
[INFO] : Using MD5withRSA signature algorithm
[INFO] : Signing apk: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/jarsigner "-sigalg" "MD5withRSA" "-digestalg" "SHA1" "-keystore" "/Users/...//Titanium/mobilesdk/osx/3.2.0.v20131210191510/android/dev_keystore" "-storepass" "*******" "-signedjar" "/.../push/build/android/bin/push.apk" "/.../push/build/android/bin/app-unsigned.apk" "tidev"
[INFO] : Device is booted
[INFO] : SD card not required, skipping mount check
[INFO] : Emulator ready!
[INFO] : Aligning zip file: /Volumes/data/android/tools/zipalign "-v" "4" "/.../push/build/android/bin/push.apk" "/.../push/build/android/bin/push.apkz"
[INFO] : Writing build manifest: /.../push/build/android/build-manifest.json
[INFO] : Making sure the adb server is running
[INFO] : Removing deploy.json from SD card
[INFO] : Installing apk: /.../push/build/android/bin/push.apk
[INFO] : App successfully installed
[INFO] : Starting app: com.gsmusic.com/.PushActivity
[INFO] : Application pid: 452
[INFO] : Project built successfully in 1m 22s 520ms
-- Start application log -----------------------------------------------------
[INFO] : dalvikvm: Could not find method android.app.Application.onTrimMemory, referenced from method org.appcelerator.titanium.TiApplication.onTrimMemory
[WARN] : dalvikvm: VFY: unable to resolve virtual method 132: Landroid/app/Application;.onTrimMemory (I)V
[INFO] : TiApplication: (main) [0,0] checkpoint, app created.
[INFO] : TiApplication: (main) [347,347] Titanium 3.2.0 (2013/12/10 19:16 1de32ee)
[INFO] : TiDbHelper: (main) [193,540] No value in database for platform key: 'unique_machine_id' returning supplied default ''
[INFO] : TiDbHelper: (main) [35,575] No value in database for platform key: 'hardware_machine_id' returning supplied default ''
[INFO] : TiApplication: (main) [279,854] Titanium Javascript runtime: v8
[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
[INFO] : TiAnalyticsDb: (main) [76,76] Upgrading Database from 1 to 4
[INFO] : dalvikvm: Could not find method android.app.Activity.invalidateOptionsMenu, referenced from method org.appcelerator.titanium.proxy.ActivityProxy.handleInvalidateOptionsMenu
[WARN] : dalvikvm: VFY: unable to resolve virtual method 56: Landroid/app/Activity;.invalidateOptionsMenu ()V
[WARN] : V8Object: Runtime disposed, cannot set property 'userAgent'
[ERROR] : dalvikvm: Could not find class 'android.app.Notification$Builder', referenced from method ti.cloudpush.CloudpushModuleGeneric.showTrayNotification
[WARN] : dalvikvm: VFY: unable to resolve new-instance 34 (Landroid/app/Notification$Builder;) in Lti/cloudpush/CloudpushModuleGeneric;
[WARN] : CloudpushModule: (KrollRuntimeThread) [3065,3141] Setting 'enabled' is not required for GCM; it is sufficient to only 'retrieveDeviceToken'.
[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.gsmusic.com.PushActivity@40590838
[INFO] : dalvikvm: Could not find method android.view.View.setTranslationX, referenced from method org.appcelerator.titanium.view.TiUIView.resetTranslationX
[WARN] : dalvikvm: VFY: unable to resolve virtual method 3726: Landroid/view/View;.setTranslationX (F)V
[INFO] : dalvikvm: Could not find method android.view.View.setTranslationY, referenced from method org.appcelerator.titanium.view.TiUIView.resetTranslationY
[WARN] : dalvikvm: VFY: unable to resolve virtual method 3727: Landroid/view/View;.setTranslationY (F)V
[INFO] : dalvikvm: Could not find method android.view.View.setAlpha, referenced from method org.appcelerator.titanium.view.TiUIView.setAlpha
[WARN] : dalvikvm: VFY: unable to resolve virtual method 3694: Landroid/view/View;.setAlpha (F)V
[WARN] : TiVerify: (Timer-0) [5000,5000] Verifying module licenses...
[WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 975 (common_google_play_services_install_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 971 (common_google_play_services_enable_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 985 (common_google_play_services_update_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 982 (common_google_play_services_unsupported_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 979 (common_google_play_services_network_error_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 977 (common_google_play_services_invalid_account_title) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 972 (common_google_play_services_install_button) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 969 (common_google_play_services_enable_button) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 983 (common_google_play_services_update_button) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 974 (common_google_play_services_install_text_tablet) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 973 (common_google_play_services_install_text_phone) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 970 (common_google_play_services_enable_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 984 (common_google_play_services_update_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 981 (common_google_play_services_unsupported_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 978 (common_google_play_services_network_error_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve static field 976 (common_google_play_services_invalid_account_text) in Lcom/google/android/gms/R$string;
[WARN] : dalvikvm: VFY: unable to resolve instance field 35
[WARN] : dalvikvm: VFY: unable to resolve static field 980 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
[ERROR] : GooglePlayServicesUtil: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
[WARN] : GooglePlayServicesUtil: Google Play services is missing.
[INFO] : ALERT: (KrollRuntimeThread) [960,5960] Failed to register for push! Google Play Services is not ready. Error:SERVICE_MISSING
[INFO] : TiVerify: (Timer-0) [584,6544] Succesfully verified module licenses
答案 0 :(得分:0)
I use application ID as sender ID
我不确定application ID
的含义,但您应该使用Google API项目编号作为发件人ID。