Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android "Unfortunately, [app_name] has stopped" #194

Closed
YeeshaYe opened this issue Feb 26, 2015 · 20 comments
Closed

Android "Unfortunately, [app_name] has stopped" #194

YeeshaYe opened this issue Feb 26, 2015 · 20 comments

Comments

@YeeshaYe
Copy link

When I am trying to fb login this message appears: "Unfortunately, [app_name] has stopped".
Latest ANE ver. Please help me to solve this problem. Thank you!

My manifest:



                <!-- Only this application can receive the messages and registration result -->
                <permission android:name="air.[app_name].permission.C2D_MESSAGE" android:protectionLevel="signature" />
                <uses-permission android:name="air.[app_name].permission.C2D_MESSAGE" />

                <!-- This app has permission to register and receive message -->
                <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

                <application>

                    <activity android:name="com.freshplanet.nativeExtensions.NotificationActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />

                    <receiver android:name="com.freshplanet.nativeExtensions.C2DMBroadcastReceiver"
                    android:permission="com.google.android.c2dm.permission.SEND">

                        <!-- Receive the actual message -->
                        <intent-filter>
                            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                            <category android:name="[app_name]" />
                        </intent-filter>

                        <!-- Receive the registration id -->
                        <intent-filter>
                            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
                            <category android:name="[app_name]" />
                        </intent-filter>
                    </receiver>

                    !-- Local notification -->
                    <service android:name="com.freshplanet.nativeExtensions.LocalNotificationService"/>
                    <receiver android:name="com.freshplanet.nativeExtensions.LocalBroadcastReceiver" android:process=":remote"></receiver>

                    <activity android:name="com.facebook.LoginActivity"/>
                    <activity android:name="com.freshplanet.ane.AirFacebook.LoginActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
                    <activity android:name="com.freshplanet.ane.AirFacebook.ShareDialogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
                    <activity android:name="com.freshplanet.ane.AirFacebook.ShareOGActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>
                    <activity android:name="com.freshplanet.ane.AirFacebook.WebDialogActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"></activity>

                    <activity android:name="com.freshplanet.inapppurchase.activities.BillingActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"></activity>
                </application>
            </manifest>
@YeeshaYe
Copy link
Author

With example from sample folder same thing...any thoughts?

@phpandroid
Copy link

i also got this message with latest ANE version on Android device. Please fix it help me.

@vlook
Copy link

vlook commented Mar 2, 2015

Have you checked the system log for the cause of the crash?

I have the exact same issue, and according to the log a missing resource causes the crashing on openSessionWithReadPermissions.

E/AndroidRuntime(30971): Caused by: android.content.res.Resources$NotFoundException: String resource ID #0x7f070013
E/AndroidRuntime(30971): at android.content.res.Resources.getText(Resources.java:1123)
E/AndroidRuntime(30971): at android.content.res.Resources.getString(Resources.java:1217)
E/AndroidRuntime(30971): at android.content.Context.getString(Context.java:362)
E/AndroidRuntime(30971): at com.facebook.widget.WebDialog.onCreate(Unknown Source)
E/AndroidRuntime(30971): at android.app.Dialog.dispatchOnCreate(Dialog.java:363)
E/AndroidRuntime(30971): at android.app.Dialog.show(Dialog.java:264)
E/AndroidRuntime(30971): at com.facebook.AuthorizationClient$WebViewAuthHandler.tryAuthorize(Unknown Source)
E/AndroidRuntime(30971): at com.facebook.AuthorizationClient.tryCurrentHandler(Unknown Source)
E/AndroidRuntime(30971): at com.facebook.AuthorizationClient.tryNextHandler(Unknown Source)
E/AndroidRuntime(30971): at com.facebook.AuthorizationClient.authorize(Unknown Source)
E/AndroidRuntime(30971): at com.facebook.AuthorizationClient.startOrContinueAuth(Unknown Source)
E/AndroidRuntime(30971): at com.facebook.LoginActivity.onResume(Unknown Source)
E/AndroidRuntime(30971): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1210)
E/AndroidRuntime(30971): at android.app.Activity.performResume(Activity.java:5468)
E/AndroidRuntime(30971): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2906)

EDIT: I had the another missing resource related issue (#175) with an older build, but had no luck with the solution provided there.

@phpandroid
Copy link

Hi vlook, could you tell me how to read the error log?

@DamboRam
Copy link

DamboRam commented Mar 9, 2015

Have the same problem , please any solution ?

@vlook
Copy link

vlook commented Mar 9, 2015

phpandroid, I'm just using logcat to collect the log dumps from the device.

adb logcat -d > androidlog.txt

@mattmurton
Copy link

If this is the same issue I experienced I've fixed it in my pull request #200 .
A re-built ane binary is included in my latest commit. Let me know if it fixes your problems.

@mparrett
Copy link

@mattmurton Thanks for your help and info about java 1.6 (that was baffling me!). We just tried your ANE and still have the problem "Unfortunately, [App Name] has stopped." upon trying to call init(). Any ideas? Here's my log dump:

http://vpaste.net/0g0oC

@jonnyleeharris
Copy link

I was experiencing the same problem upon calling do login with read permissions until I used @mattmurton 's change.

I still get the same error after the login process has completed though.

@jonnyleeharris
Copy link

E/AndroidRuntime(28585): java.lang.RuntimeException: Unable to pause activity {air.com.app/com.facebook.LoginActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setVisibility(int)' on a null object reference
E/AndroidRuntime(28585): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3225)
E/AndroidRuntime(28585): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3184)
E/AndroidRuntime(28585): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3159)
E/AndroidRuntime(28585): at android.app.ActivityThread.access$1000(ActivityThread.java:144)
E/AndroidRuntime(28585): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1296)
E/AndroidRuntime(28585): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(28585): at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(28585): at android.app.ActivityThread.main(ActivityThread.java:5221)
E/AndroidRuntime(28585): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(28585): at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(28585): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
E/AndroidRuntime(28585): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
E/AndroidRuntime(28585): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setVisibility(int)' on a null object reference
E/AndroidRuntime(28585): at com.facebook.LoginActivity.onPause(Unknown Source)
E/AndroidRuntime(28585): at android.app.Activity.performPause(Activity.java:6044)
E/AndroidRuntime(28585): at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1294)
E/AndroidRuntime(28585): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3211)
E/AndroidRuntime(28585): ... 11 more

@BadViking
Copy link

I just wanted to chime in and say that we're having the same problem. Has anyone been able to get this working yet? @mattmurton that solution didn't seem to make any difference for me. Same problem after calling openSessionWithReadPermissions, the app crashes with the "Unfortunately, [app_name] has stopped" error.

@mparrett
Copy link

@BadViking - we reverted back to the working commit 1e6a221 for our Android project due to time constraints.

@wastedabuser
Copy link

It seems the latest commit contains all of the R.* resource calls and the ANE is built with them. This is causing the problem. The author stated in the README:

This sdk is using staticaly linked elements. We had to modify all the calls to the com.facebook.android.R package by a custom function that is doing the linking at runtime: import com.freshplanet.ane.AirFacebook.AirFacebookExtension and use AirFacebookExtension.getResourceId("nameOfTheRessource") or AirFacebookExtension.getResourceIds("nameOfTheRessource")

After doing as he said the java.lang.NullPointerException is resolved. If somebody is interested i can fork and push my changes. Unfortunately i am unable to build the ANE for iOS as i am building the entire thing on Windows (i currently don't care about iOS anyway)

@hmark
Copy link

hmark commented Apr 7, 2015

@wastedabuser Is it possible to fork/push your solution with Android ANE please? I think it will help all with the same problem.

@wastedabuser
Copy link

@hlavko i did, check it out here: https://github.com/wastedabuser/ANE-Facebook

@CrazyFlasher
Copy link

Same thing...

@UmberFunk
Copy link

@wastedabuser's version works for me, but sadly it's only for Android.

Minor issues:

  1. Avoid clearing tokens twice. Calling openSessionWithReadPermissions after this crashes app.
  2. Calling openSessionWithReadPermissions, canceling it and calling again causes an "already connected" error.

@stigmawall
Copy link

I have the exactly same problem like everyone else with the Facebook ANE from freshplanet, change it to the @wastedabuser ANE fixs it.

@UmberFunk
Copy link

Keep in mind that wastedabuser's ANE works only with Android.

I had struggled a lot with this, found many versions witch supported both platforms and at last made one work, but when I integrated it into our game it failed again. So I switched to commetcial ane and am happy with this decision.

Thanks to Freshplanet for providing opensource extension, but I should let you know that you might lose a lot of time making it work and it can fail anyway.

@shintiger
Copy link

@wastedabuser Thanks for support! I've heard that the Exception is the SDK problem then I spend whole day for Update freshplanet android source to facebook SDK 4.7, finally I stuck when many error cause java sdk1.6...

Anyway, I simply unpack your ANE and repack it with iOS part (nothing change) , I can use it smoothly either iOS or Android now.
👍

@AdamFP AdamFP closed this as completed Mar 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests