Следвах всички стъпки за импортиране на google-play-services, опитах да преинсталирам sdk, повторно импортиране. Опитах се да добавя тегло и текстови изгледи, за да му дам място... Опитах всичко през последните 2 дни, но продължавам да получавам тази грешка в графичния интерфейс на xml оформлението, което казва:
the following classes could not be instantiated: - com.google.android.gms.ads.AdView.
********манифест*/**********
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.alphaking.xxxxxxe"
android:versionCode="1"
android:versionName="1.0" >
<uses-feature android:name="android.hardware.sensor.accelerometer" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar" >
<activity
android:screenOrientation="portrait"
android:name="xxxxxxxxxe.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.STARTINGPOINTS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:screenOrientation="portrait"
android:name="com.alphaking.ijumprope.Settings"
android:label="@string/app_name" >
</activity>
<activity
android:screenOrientation="portrait"
android:name="com.alphaking.ijumprope.Start"
android:label="@string/app_name" >
</activity>
<activity
android:screenOrientation="portrait"
android:name="xxxxxxxxxxxxx.Logs"
android:label="@string/app_name" >
</activity>
<activity
android:screenOrientation="portrait"
android:name="cxxxxxxxxe.About"
android:label="@string/app_name" >
</activity>
<activity
android:screenOrientation="portrait"
android:name="xxxxxxxxxxx.Splash"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.google.android.gms.ads.AdActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
</application>
</manifest>
*****////////************основна дейност java************* *********
package cxxxxxxxxxxxxxxxxxxx;
import com.alphxxxxxxgxxxxxxxxxx;
import com.google.android.gms.ads.*;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends Activity{
Button setting,start,logs,about;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
AdView adView = (AdView) this.findViewById(R.id.adView);
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);
setting=(Button) findViewById(R.id.button2);
setting.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try{
Class ourClass = Class.forName("com.xxxxxxxxxxxxx.Settings");
Intent ourIntent = new Intent(MainActivity.this, ourClass);
startActivity(ourIntent);
}catch(ClassNotFoundException e){
e.printStackTrace();
}
}
});
start=(Button) findViewById(R.id.button1);
start.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try{
Class ourClass = Class.forName("com.alphaking.ijumprope.Start");
Intent ourIntent = new Intent(MainActivity.this, ourClass);
startActivity(ourIntent);
}catch(ClassNotFoundException e){
e.printStackTrace();
}
}
});
logs=(Button) findViewById(R.id.button3);
logs.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try{
Class ourClass = Class.forName("cxxxxxxxxxxxx
Intent ourIntent = new Intent(MainActivity.this, ourClass);
startActivity(ourIntent);
}catch(ClassNotFoundException e){
e.printStackTrace();
}
}
});
about=(Button) findViewById(R.id.button4);
about.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
try{
Class ourClass = Class.forName("xxxxxxxxxxxxxxAbout");
Intent ourIntent = new Intent(MainActivity.this, ourClass);
startActivity(ourIntent);
}catch(ClassNotFoundException e){
e.printStackTrace();
}
}
});
}
public void onBackPressed() {
}
}
************************xml************************ **********
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:ads="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.alphaking.xxxxxxxxxxxxxActivity"
android:background="@drawable/back"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true" >
<Button
android:id="@+id/button1"
android:layout_width="120dp"
android:layout_height="60dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="40dp"
android:background="@drawable/start" />
<Button
android:id="@+id/button2"
android:layout_width="120dp"
android:layout_height="60dp"
android:layout_alignLeft="@+id/button1"
android:layout_below="@+id/button1"
android:layout_marginTop="30dp"
android:background="@drawable/setup" />
<Button
android:id="@+id/button3"
android:layout_width="120dp"
android:layout_height="60dp"
android:layout_alignLeft="@+id/button2"
android:layout_below="@+id/button2"
android:layout_marginTop="30dp"
android:background="@drawable/logs" />
<Button
android:id="@+id/button4"
android:layout_width="120dp"
android:layout_height="60dp"
android:layout_alignLeft="@+id/button3"
android:layout_below="@+id/button3"
android:layout_marginTop="30dp"
android:background="@drawable/about" />
<com.google.android.gms.ads.AdView
android:layout_width="320dp"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
ads:adSize="BANNER"
ads:adUnitId="ca-app-pub-1278770925901425/7987430192"
ads:loadAdOnCreate="true"
android:gravity="center" >
</com.google.android.gms.ads.AdView>
</RelativeLayout>