Home > Uncategorized > Android app crashes on launch

Android app crashes on launch

This is probably the first mistake that any Android developer makes, so seasoned developers will know this issue very well:

Three things MUST match on your android app:

The App.Java file, should take the following format:

package com.openmerchantaccount.ruby;
import android.webkit.WebSettings;

import android.app.Activity;
import android.os.Bundle;
import com.phonegap.*;

public class App extends DroidGap {

Your package name will be different, but I’m highlighting the important bit.

Then in the Android Manifest the (AndroidManifest.xml) should start as follows:

<?xml version=”1.0″ encoding=”utf-8″?>
<manifest xmlns:android=”http://schemas.android.com/apk/res/android&#8221;
package=”com.openmerchantaccount.ruby
android:versionCode=”2″
android:versionName=”2″>

and end as follows:

<activity android:name=”com.openmerchantaccount.ruby.App
android:label=”@string/app_name”
android:configChanges=”orientation|keyboardHidden”
>
<intent-filter>
<action android:name=”android.intent.action.MAIN” />
<category android:name=”android.intent.category.LAUNCHER” />
</intent-filter>
</activity>

</application>
</manifest>

If any of the three class names do not match, the app will crash on startup.

 

 

Advertisement
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: