Application crashes after adding AirPush

571 views Asked by At

I am trying to create my first application, a live map of my Minecraft Server (it's actually just a webview displaying a webpage connected to a plugin in the Bukkit platform). Before I added AirPush, it was perfectly working! Now, after I included the JAR from AirPush (to add some ads, like banners, push, shortcuts and SmartWall) to my App, the app no longer starts (neither in the emulator or on my device connected by ADB with USB Debugging)

I need to note that Eclipse does not give me any error or warning about the code. It compiles but it does not start.

Here is my whole code:

MainActivity.java

package com.flashweb.flashwebmcserverlivemap;

import com.serthbrwj.umogzbldmXXXXXX.Airpush;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

    public class MainActivity extends Activity {

        Airpush airpush=new Airpush(getApplicationContext(), null);

        @Override
        public void onBackPressed() {
            if (airpush!=null) {
            airpush.startSmartWallAd();
            }
        super.onBackPressed();
        }

        private WebView webView;

        public void onCreate(Bundle savedInstanceState) {
            super.onCreate1(savedInstanceState);
            setContentView(R.layout.activity_main);

          webView = (WebView) findViewById(R.id.webview);
          webView.setInitialScale(1);
          webView.getSettings().setJavaScriptEnabled(true);
          webView.getSettings().setLoadWithOverviewMode(true);
          webView.getSettings().setUseWideViewPort(true);
          webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
          webView.setScrollbarFadingEnabled(false);
          webView.loadUrl("http://XXXX/");


        }

    }

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.flashweb.flashwebmcserverlivemap"
    android:versionCode="1"
    android:versionName="1.0" >

    <!-- Required permissions for all ads. This will apply for all ads. -->
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />    

    <!-- Additional required permission for push notification. Apply only for push notification ad. -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <!-- Required permission for Icon Ad. Apply only for icon ad. -->
    <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />

    <!-- Optional permissions but we strongly recommend you to add the optional permissions to enhance your Application earnings-->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
     <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS" />

    <!-- Optional permission use it when your application provide support for Kindle fire devices -->
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.example.flashwebmcserverlivemap.MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data android:name="com.serthbrwj.umogzbldm157427.APPID" android:value="XXXX" />
        <meta-data android:name="com.serthbrwj.umogzbldm157427.APIKEY" android:value="android*XXXX"/>
        <activity android:exported="false" android:name="com.serthbrwj.umogzbldm157427.SmartWallActivity"
     android:configChanges="orientation|screenSize"
android:theme="@android:style/Theme.Translucent" />

        <activity android:name="com.serthbrwj.umogzbldm157427.BrowserActivity"
android:configChanges="orientation|screenSize" />

        <service android:name="com.serthbrwj.umogzbldm157427.PushService" android:exported="false" />
<receiver android:name="com.serthbrwj.umogzbldm157427.BootReceiver" android:exported="false" >
  <intent-filter>
     <action android:name="android.intent.action.BOOT_COMPLETED" />
     <category android:name="android.intent.category.HOME" />
  </intent-filter>
</receiver>


    </application>

</manifest>

I replaced urls, keys and ids with X.

Now the app just stays on a black screen for about 2 seconds and after that, it throws an App stopped working screen.

Thanks in advance.

1

There are 1 answers

0
Li3ro On

add a

Log.i("TST", "TST");

to your onCreate and see if it gets plotted in console after clean&run