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 plugin crashes app #78

Open
gexplorer opened this issue Sep 8, 2015 · 6 comments
Open

Android plugin crashes app #78

gexplorer opened this issue Sep 8, 2015 · 6 comments

Comments

@gexplorer
Copy link

After adding the plugin to a working project while executing cordova run android I get a the app has stopped message.

@AeroHil
Copy link

AeroHil commented Sep 10, 2015

I am getting the same issue. Also, crashes with devices running Android 5.1+

@mwthinker
Copy link

I had a similar problem, solved it by adding the code stated in Android Quirks in the README.md file.

@AeroHil
Copy link

AeroHil commented Sep 15, 2015

ah. thanks@mwthinker. that helped. (Though I did try that before posting this, but gave up too fast...)
For those of you still looking at this problem (or similar), this is what I found:

Doing the Android Quirks note with a Cordova app, you actually have to MAKE the App.java class and put it somewhere inside your android/src folder with the proper package name. Then add the xml attribute 'android:name' as part of the 'application' tag of the AndroidManifest.xml.

Don't do what I did, which is put it inside the MainActivity.java class and fails to compile, then give up...

Also note that, if you do 'cordova platform remove android' then add it back again, this file will be deleted. You would need to add it again (for those of you, like me, who do not check in the 'platforms' folder into git)

@opedrero
Copy link

I add App.java file with this code:

package com.editartgroup.ldi;

import android.app.Application;
import org.apache.cordova.core.ParsePlugin;

public class App extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        ParsePlugin.initializeParseWithApplication(this);
    }

}

And I add tag in application AndroidManifest.xml:

 <application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="@string/app_name" android:name="com.editartgroup.ldi.App" android:supportsRtl="true">

but when i try cordova run android:

platforms/android/src/com/editartgroup/ldi/App.java:11: error: cannot find symbol
        ParsePlugin.initializeParseWithApplication(this);
                   ^
  symbol:   method initializeParseWithApplication(App)
  location: class ParsePlugin
1 error
:compileDebugJava FAILED

Can you help me please?

Thanks 4 all!!!

@AeroHil
Copy link

AeroHil commented Oct 28, 2015

That's exactly what I have, so the only thing I can think of is you might have a different version of the ParsePlugin?

Also make sure you have the org directory in your build

screen shot 2015-10-27 at 9 00 12 pm

@opedrero
Copy link

I finally use another plugin ( https://github.com/taivo/parse-push-plugin ), thks for your answer

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

4 participants