I've followed the wizard to produce an 'app engine connected android project' and using instructions from https://developers.google.com/eclipse/docs/endpoints-androidconnected-gae.
The only additions I have made to what is auto-generated are setting the api key, setting process number, setting LOCAL_ANDROID_RUN to true.
Appengine dev server starts fine and all as it should be on localhost:8888
Android app deploys fine to emulator (running google apis as target).
But when I click to register I get
'Sorry! The application VillageTest (process com.villagetest) has
stopped unexpectedly. Please try again.'
with a button to 'force close'.
Logcat is as follows:
03-27 16:19:02.098: D/dalvikvm(422): GC_FOR_MALLOC freed 5074 objects / 389216 bytes in 75ms
03-27 16:19:02.288: V/GCMBaseIntentService(422): Releasing wakelock
03-27 16:19:02.288: W/dalvikvm(422): threadid=9: thread exiting with uncaught exception (group=0x4001d800)
03-27 16:19:02.298: E/AndroidRuntime(422): FATAL EXCEPTION: IntentService[GCMIntentService-405986951973-1]
03-27 16:19:02.298: E/AndroidRuntime(422): java.lang.NullPointerException
03-27 16:19:02.298: E/AndroidRuntime(422): at com.villagetest.GCMIntentService.onRegistered(GCMIntentService.java:144)
03-27 16:19:02.298: E/AndroidRuntime(422): at com.google.android.gcm.GCMBaseIntentService.handleRegistration(GCMBaseIntentService.java:251)
03-27 16:19:02.298: E/AndroidRuntime(422): at com.google.android.gcm.GCMBaseIntentService.onHandleIntent(GCMBaseIntentService.java:153)
03-27 16:19:02.298: E/AndroidRuntime(422): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)
03-27 16:19:02.298: E/AndroidRuntime(422): at android.os.Handler.dispatchMessage(Handler.java:99)
03-27 16:19:02.298: E/AndroidRuntime(422): at android.os.Looper.loop(Looper.java:123)
03-27 16:19:02.298: E/AndroidRuntime(422): at android.os.HandlerThread.run(HandlerThread.java:60)
Please help. It's driving me crazy!!
The problem appears to be in your implementation of GCMIntentService (at GCMIntentService.java line 144). I suggest you post or look at that line in your code.
Have you followed the instructions for implementing GCM in your app:
http://developer.android.com/google/gcm/gs.html
Most specifically, Step 3?
Also, note that someone else posted almost exactly the same question yesterday...
app engine(eclipse): can't register device from android emulator to endpoint
You appear to be experiencing the exact same problem and he has now posted his line 144. I'm going to follow up there.
This is fixed in the latest version of GPE (3.2.2) released today. The problem had to do with a missing null check in the case where you'd never registered your device with the endpoint before.
Related
Its on an HTC Aria, running 2.2 (API 8)
https://en.wikipedia.org/wiki/HTC_Aria
The aria is an armv6 device that supports opengles 2
If you open up the latest Android Studio (im working on windows 7), then import the HelloGL2 sample, then simply try to run it on the above device, it will fail as soon as it tries to make a call into the native library.
Here is the log:
01-06 11:14:08.467 12771-12813/com.android.gl2jni D/dalvikvm: Trying to load lib /data/data/com.android.gl2jni/lib/libgl2jni.so 0x44c165d0
01-06 11:14:08.467 12771-12813/com.android.gl2jni I/dalvikvm: Unable to dlopen(/data/data/com.android.gl2jni/lib/libgl2jni.so): Cannot load library: link_image[1995]: failed to link libgl2jni.so
01-06 11:14:08.477 12771-12813/com.android.gl2jni W/dalvikvm: Exception Ljava/lang/UnsatisfiedLinkError; thrown during Lcom/android/gl2jni/GL2JNILib;.<clinit>
01-06 11:14:08.497 12771-12813/com.android.gl2jni W/dalvikvm: threadid=8: thread exiting with uncaught exception (group=0x40028a00)
01-06 11:14:08.517 95-121/? I/ActivityManager: Displayed activity com.android.gl2jni/.GL2JNIActivity: 9823 ms (total 2027818 ms)
01-06 11:14:08.567 12771-12813/com.android.gl2jni E/AndroidRuntime: FATAL EXCEPTION: GLThread 9
java.lang.ExceptionInInitializerError
at com.android.gl2jni.GL2JNIView$Renderer.onSurfaceChanged(GL2JNIView.java:332)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1327)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
Caused by: java.lang.UnsatisfiedLinkError: Library gl2jni not found
at java.lang.Runtime.loadLibrary(Runtime.java:461)
at java.lang.System.loadLibrary(System.java:557)
at com.android.gl2jni.GL2JNILib.<clinit>(GL2JNILib.java:24)
at com.android.gl2jni.GL2JNIView$Renderer.onSurfaceChanged(GL2JNIView.java:332)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1327)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
01-06 11:14:08.607 95-164/? W/ActivityManager: Force finishing activity com.android.gl2jni/.GL2JNIActivity
This sample works on the 3 other devices i've tried (Galaxy s5, Galaxy J1, Nexus s)
The line: 'Unable to dlopen(/data/data/com.android.gl2jni/lib/libgl2jni.so): Cannot load library: link_image[1995]: failed to link libgl2jni.so' is probably key. I tried loading the library explicitly using system.loadlibrary, but the same problem happens on that call.
I think it might be something to do with the processor being armv6?
The sample is configured to do 'armeabi' though.
I've created the sample app given in the latest version (current master) of Apache Cordova Facebook Plugin several times:
https://github.com/phonegap/phonegap-facebook-plugin
Currently, I'm working on Android only.
The first time I created this sample app (about two weeks ago) everything worked fine. I successfully logged in with my facebook account, posted a status to my wall and logged out (all the other actions worked fine as well).
But since than I've created this sample app several more times (in the exact same way), and it has never worked again (the last time I tried was today). In the new apps (with the very same code as the first app, which still works), I press "LOGIN WITH FACEBOOK", and my app crashes immediately. Sometimes the app doesn't crash immediately, and I can get the message "Argument 'session' cannot be null". Then I press "LOGIN WITH FACEBOOK" again, and the app crashes. Sometimes I can get this message several times before the app eventually crashes.
If I press "LOGOUT WITH FACEBOOK", I get the message: "No valid session found, must call init and login before logout".
I also don't think that the problem is that I have a wrong hash key or something like that, because I've been careful with the settings of the facebook app every time.
I also believe that I've installed the plugin correctly each time, because I've always done it the same way I did it the first time, which worked fine.
So how is it that in my latest attempts the session variable is NULL??
Why did it work only in the first time??
I'm very frustrated..
Edit:
Here is the relevant segment of the LogCat log:
D/ConnectPlugin( 7064): login FB
W/dalvikvm( 7064): VFY: unable to resolve static field 2130 (com_facebook_internet_permission_error_title) in Lcom/facebook/android/R$string;
D/dalvikvm( 7064): VFY: replacing opcode 0x60 at 0x0010
I/dalvikvm( 7064): DexOpt: unable to optimize static field ref 0x0851 at 0x18 in Lcom/facebook/AuthorizationClient;.checkInternetPermission
W/dalvikvm( 7064): VFY: unable to resolve static field 2120 (com_facebook_login_activity_layout) in Lcom/facebook/android/R$layout;
D/dalvikvm( 7064): VFY: replacing opcode 0x60 at 0x0003
W/dalvikvm( 7064): VFY: unable to resolve static field 2103 (com_facebook_login_activity_progress_bar) in Lcom/facebook/android/R$id;
D/dalvikvm( 7064): VFY: replacing opcode 0x60 at 0x0008
I/ActivityManager( 2112): START {intent.toShortString} from pid 7064
I/power ( 2112): *** acquire_dvfs_lock : lockType : 1 freq : 1000000
D/PowerManagerService( 2112): acquireDVFSLockLocked : type : DVFS_MIN_LIMIT frequency : 1000000 uid : 1000 pid : 2112 tag : ActivityManager
W/ActivityManager( 2112): mDVFSLock.acquire()
D/dalvikvm( 7064): GC_CONCURRENT freed 455K, 6% free 12931K/13639K, paused 4ms+5ms
W/PluginManager( 7064): THREAD WARNING: exec() call to FacebookConnectPlugin.login blocked the main thread for 207ms. Plugin should use CordovaInterface.getThreadPool().
D/CordovaActivity( 7064): Paused the application!
D/CordovaWebView( 7064): Handle the pause
D/FirewallPolicy( 2112): getURLFilterEnabled(true)
D/FirewallPolicy( 2112): isUrlBlocked - Policy disabled
D/webkit ( 7064): Firewall not null
D/FirewallPolicy( 2112): getURLFilterEnabled(true)
D/FirewallPolicy( 2112): isUrlBlocked - Policy disabled
I/ClipboardServiceEx( 2112): mCBPickerDialog enter case. MSG_DISMISS_DIALOG
D/webkit ( 7064): euler: isUrlBlocked = false
D/FirewallPolicy( 2112): getURLFilterEnabled(true)
D/FirewallPolicy( 2112): isUrlBlocked - Policy disabled
D/ActivityManager( 2112): Trying to launch applicationName
D/KeyguardViewMediator( 2112): setHidden false
I/ClipboardServiceEx( 2112): mCBPickerDialog enter case. MSG_DISMISS_DIALOG
D/AndroidRuntime( 7064): Shutting down VM
W/dalvikvm( 7064): threadid=1: thread exiting with uncaught exception (group=0x40c6c1f8)
E/AndroidRuntime( 7064): FATAL EXCEPTION: main
E/AndroidRuntime( 7064): java.lang.NoClassDefFoundError: com.facebook.android.R$layout
E/AndroidRuntime( 7064): at com.facebook.LoginActivity.onCreate(LoginActivity.java:57)
E/AndroidRuntime( 7064): at android.app.Activity.performCreate(Activity.java:4562)
E/AndroidRuntime( 7064): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
E/AndroidRuntime( 7064): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
E/AndroidRuntime( 7064): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
E/AndroidRuntime( 7064): at android.app.ActivityThread.access$600(ActivityThread.java:128)
E/AndroidRuntime( 7064): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
E/AndroidRuntime( 7064): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 7064): at android.os.Looper.loop(Looper.java:137)
E/AndroidRuntime( 7064): at android.app.ActivityThread.main(ActivityThread.java:4514)
E/AndroidRuntime( 7064): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 7064): at java.lang.reflect.Method.invoke(Method.java:511)
E/AndroidRuntime( 7064): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
E/AndroidRuntime( 7064): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
E/AndroidRuntime( 7064): at dalvik.system.NativeStart.main(Native Method)
W/ActivityManager( 2112): Force finishing activity com.yomama.test/com.facebook.LoginActivity
W/ActivityManager( 2112): Force finishing activity com.yomama.test/.Test
Another strange thing that happened to me yesterday was that I recompiled and re-installed (on my phone) the first working app, and suddenly it didn't work either (I got the same message after pressing "LOGIN WITH FACEBOOK", and then the app crashed). Then I recompiled and re-installed the app again, and it was working fine again. Weird.
Try the following steps (from this GitHub issue; had worked for me):
+### Android Setup without Eclipse (just CLI)
+Follow the steps above:
cordova create myApp
cd myApp/
cordova platform add android
cordova -d plugin add https://github.com/phonegap/phonegap-facebook-plugin.git --variable APP_ID="123456789" --variable APP_NAME="myApplication"
// add FacebookLib
echo "android.library.reference.2=com.phonegap.plugins.facebookconnect/FacebookLib" >> platforms/android/project.properties
cp platforms/android/local.properties platforms/android/com.phonegap.plugins.facebookconnect/FacebookLib
android update project -p platforms/android/
cd platforms/android/
ant clean
cd com.phonegap.plugins.facebookconnect/FacebookLib
ant clean
open -e AndroidManifest.xml
// change your minSdkVersion and your targetSdkVersion to your environment settings.
ant release
cd ../../../..
cordova build android
With this steps you can add the Plugin without using Eclipse
I am trying to debug the app engine connected android starter app but when I select account through on my phone (android 2.3.6 and deployed the app on appengine following the tutorial) it shows these errors and prompt to force close the application.
Here is the logcat:
06-09 13:00:07.781: D/dalvikvm(14321): GC_CONCURRENT freed 76K, 44% free 3311K/5831K, external 518K/1030K, paused 3ms+3ms
06-09 13:00:08.007: I/global(14321): Loaded time zone names for en_US in 1308ms.
06-09 13:00:08.398: W/dalvikvm(14321): threadid=9: thread exiting with uncaught exception (group=0x40018578)
06-09 13:00:08.429: E/AndroidRuntime(14321): FATAL EXCEPTION: IntentService[my_registered_c2dm_id#gmail.com]
06-09 13:00:08.429: E/AndroidRuntime(14321): java.lang.RuntimeException: The RequestFactory ValidationTool must be run for the com.testtasker.client.MyRequestFactory RequestFactory type
06-09 13:00:08.429: E/AndroidRuntime(14321): at com.google.web.bindery.requestfactory.vm.impl.Deobfuscator$Builder.load(Deobfuscator.java:59)
06-09 13:00:08.429: E/AndroidRuntime(14321): at com.google.web.bindery.requestfactory.vm.InProcessRequestFactory.<init>(InProcessRequestFactory.java:80)
06-09 13:00:08.429: E/AndroidRuntime(14321): at com.google.web.bindery.requestfactory.vm.RequestFactorySource.create(RequestFactorySource.java:43)
06-09 13:00:08.429: E/AndroidRuntime(14321): at com.testtasker.Util.getRequestFactory(Util.java:158)
06-09 13:00:08.429: E/AndroidRuntime(14321): at com.testtasker.DeviceRegistrar.getRequest(DeviceRegistrar.java:107)
06-09 13:00:08.429: E/AndroidRuntime(14321): at com.testtasker.DeviceRegistrar.registerOrUnregister(DeviceRegistrar.java:54)
06-09 13:00:08.429: E/AndroidRuntime(14321): at com.testtasker.C2DMReceiver.onRegistered(C2DMReceiver.java:46)
06-09 13:00:08.429: E/AndroidRuntime(14321): at com.google.android.c2dm.C2DMBaseReceiver.handleRegistration(C2DMBaseReceiver.java:191)
06-09 13:00:08.429: E/AndroidRuntime(14321): at com.google.android.c2dm.C2DMBaseReceiver.onHandleIntent(C2DMBaseReceiver.java:110)
06-09 13:00:08.429: E/AndroidRuntime(14321): at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:59)
06-09 13:00:08.429: E/AndroidRuntime(14321): at android.os.Handler.dispatchMessage(Handler.java:99)
06-09 13:00:08.429: E/AndroidRuntime(14321): at android.os.Looper.loop(Looper.java:130)
06-09 13:00:08.429: E/AndroidRuntime(14321): at android.os.HandlerThread.run(HandlerThread.java:60)
I searched a lot on google and stackoverflow, but unable to resolve the error.
I did not change single character in the starter code then why its not running.
When I try through emulator (as described in tutorials) it gives PHONE_REGISTRATION_ERROR.
Used software:
Eclipse Java EE IDE for Web Developers.
eclipse platform 3.7.2
Version: Indigo Service Release 2
Build id: 20120216-1857
ADT 18.0.0
app engine java sdk1.6.6
gwt sdk 2.4.0
This is the debug stack:
DalvikVM[localhost:8600]
Thread [<1> main] (Running)
Thread [<8> Binder Thread #2] (Running)
Thread [<7> Binder Thread #1] (Running)
Thread [<9> IntentService[my_registered_c2dm_id#gmail.com]] (Suspended (exception RuntimeException))
C2DMReceiver(C2DMBaseReceiver).onHandleIntent(Intent) line: 124
IntentService$ServiceHandler.handleMessage(Message) line: 59
IntentService$ServiceHandler(Handler).dispatchMessage(Message) line: 99
Looper.loop() line: 130
HandlerThread.run() line: 60
On clicking thread 9 variables it shows this:
com.testtasker.C2DMReceiver#4052c3e8
Intent { act=com.google.android.c2dm.intent.REGISTRATION cat=[com.testtasker]
cmp=com.testtasker/.C2DMReceiver (has extras) }
Please help me, I have to work app engine but before that this sample should run on real device.
I don't know which "tutorial" you are using. With the ADT 18 you won't be able to run the one here http://bradabrams.com/2011/05/google-io-session-overview-android-app-engine-a-developers-dream-combination/
Instead follow the instruction here:
https://developers.google.com/eclipse/docs/appeng_android_install_setup
Also, make sure to register for the c2dm service: https://developers.google.com/android/c2dm/signup, which I think is your actual problem. I believe when testing you must sign in with the same account you used in registration on your phone and the local App Engine server.
Have you customized files, or are you trying to test the c2dm service out of the box?
I've been developing an NDK app for quite some time and it's been working well. However, today the app randomly decided to not start anymore, after I compiled it after making some nominal change. It's caused by a cryptic problem with loading the app's main library. Here's some log output:
08-11 18:38:11.220 D/dalvikvm( 1237): Added shared lib /mnt/asec/com.audia.rta-1/lib/libqtandroid.so 0x40513bd8
08-11 18:38:11.220 D/dalvikvm( 1237): No JNI_OnLoad found in /mnt/asec/com.audia.rta-1/lib/libqtandroid.so 0x40513bd8, skipping init
08-11 18:38:11.220 D/dalvikvm( 1237): Trying to load lib /mnt/asec/com.audia.rta-1/lib/librta.so 0x40513bd8
08-11 18:38:11.260 D/AndroidRuntime( 1237): Shutting down VM
08-11 18:38:11.260 W/dalvikvm( 1237): threadid=1: thread exiting with uncaught exception (group=0x40015560)
08-11 18:38:11.260 E/AndroidRuntime( 1237): FATAL EXCEPTION: main
08-11 18:38:11.260 E/AndroidRuntime( 1237): java.lang.UnsatisfiedLinkError: Cannot load library: reloc_library[1311]: 67 cannot locate '_ZNSaIcEC1Ev'...
08-11 18:38:11.260 E/AndroidRuntime( 1237):
08-11 18:38:11.260 E/AndroidRuntime( 1237): at java.lang.Runtime.loadLibrary(Runtime.java:434)
08-11 18:38:11.260 E/AndroidRuntime( 1237): at java.lang.System.loadLibrary(System.java:554)
08-11 18:38:11.260 E/AndroidRuntime( 1237): at com.audia.rta.RTA.onCreate(RTA.java:139)
According to some Google results, _ZNSaIcEC1Ev is part of libstdc++. I've checked, and it gets linked in the build process, and g++ is being used for linking.
Oddly enough, reverting to an older apk of the app fixes the problem, but compiling an old revision and installing that doesn't fix the problem. Everything in my build system is checked into version control, and I've done several clean builds. All my builds were working today and then they just stopped working. I didn't upgrade or install anything; it happened while I was in the middle of testing new code. What happened?
Update: Building from a freshly checked out copy doesn't fix the problem.
Update 2: Is there any way I can track down the link to that symbol, maybe with objdump? Maybe this could provide some clues.
I ended up compiling everything with a fresh NDK install, and it worked. It's as if the old one was corrupted somehow, though I have no idea how.
It was also an upgrade from r5b to r6, so maybe it's related to the NDK version.
I am trying to run the simplest Hello World example app and looks like I can crash it even all it does is showing a TextView.
Steps to reproduce: Launch it in the emulator (1.5). Open the app - it shows the text view, then lock the phone by pressing "end call" button. Unlock by pressing "menu", then press "back". App crashes with "The process android.process.acore has stopped unexpectedly..." and Force Close button. It does not happen all the time, but I am able to reproduce it every time after wiping the user data at least.
I wonder if default Hello World is missing a detail which was considered too advanced for a hello world... Such problems with a basic example does not look very encouraging =)
Any idea what detail is missing and how to avoid this crash?
Stack (I've truncated timestamps):
37.478: DEBUG/KeyguardViewMediator(576): wakeWhenReadyLocked(82)
37.481: DEBUG/KeyguardViewMediator(576): handleWakeWhenReady(82)
37.481: DEBUG/KeyguardViewMediator(576): pokeWakelock(5000)
39.110: DEBUG/KeyguardViewMediator(576): pokeWakelock(5000)
39.140: WARN/InputManagerService(576): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#436e3fc0
40.990: ERROR/IMemory(679): binder=0x238aa8 transaction failed fd=-2147483647, size=0, err=-2147483646 (Unknown error: 2147483646)
40.990: ERROR/IMemory(679): cannot dup fd=-2147483647, size=0, err=-2147483646 (Bad file number)
40.990: ERROR/IMemory(679): cannot map BpMemoryHeap (binder=0x238aa8), size=0, fd=-1 (Bad file number)
40.990: ERROR/Surface(679): Couldn't map Surface's heap (binder=0x238aa8, heap=0x238b00)
40.990: DEBUG/AndroidRuntime(679): Shutting down VM
40.990: WARN/dalvikvm(679): threadid=3: thread exiting with uncaught exception (group=0x4000fe70)
40.990: ERROR/AndroidRuntime(679): Uncaught handler: thread main exiting due to uncaught exception
40.990: ERROR/AndroidRuntime(679): java.lang.IllegalArgumentException
40.990: ERROR/AndroidRuntime(679): at android.view.Surface.lockCanvasNative(Native Method)
40.990: ERROR/AndroidRuntime(679): at android.view.Surface.lockCanvas(Surface.java:196)
40.990: ERROR/AndroidRuntime(679): at android.view.ViewRoot.draw(ViewRoot.java:1175)
40.990: ERROR/AndroidRuntime(679): at android.view.ViewRoot.performTraversals(ViewRoot.java:1030)
40.990: ERROR/AndroidRuntime(679): at android.view.ViewRoot.handleMessage(ViewRoot.java:1482)
40.990: ERROR/AndroidRuntime(679): at android.os.Handler.dispatchMessage(Handler.java:99)
40.990: ERROR/AndroidRuntime(679): at android.os.Looper.loop(Looper.java:123)
40.990: ERROR/AndroidRuntime(679): at android.app.ActivityThread.main(ActivityThread.java:3948)
40.990: ERROR/AndroidRuntime(679): at java.lang.reflect.Method.invokeNative(Native Method)
40.990: ERROR/AndroidRuntime(679): at java.lang.reflect.Method.invoke(Method.java:521)
40.990: ERROR/AndroidRuntime(679): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
40.990: ERROR/AndroidRuntime(679): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
40.990: ERROR/AndroidRuntime(679): at dalvik.system.NativeStart.main(Native Method)
41.000: INFO/Process(576): Sending signal. PID: 679 SIG: 3
41.000: INFO/dalvikvm(679): threadid=7: reacting to signal 3
41.030: ERROR/ActivityThread(576): Failed to find provider info for android.server.checkin
41.030: ERROR/Checkin(576): Error reporting crash: java.lang.IllegalArgumentException: Unknown URL content://android.server.checkin/crashes
41.070: INFO/dalvikvm(679): Wrote stack trace to '/data/anr/traces.txt'
50.940: WARN/ActivityManager(576): Launch timeout has expired, giving up wake lock!
50.980: WARN/ActivityManager(576): Activity idle timeout for HistoryRecord{4366ac40 {com.android.launcher/com.android.launcher.Launcher}}
sounds to me more like something wrong with your emulator. Why dont you delete your emulator and create a new one and try again with a fresh project.
Hope that will help you. BTW why are you using emulator on 1.5?? Start to build applications for min 2.1.
Good luck.