android GooglePlayServicesUtil.isGooglePlayServicesAvailable无效

时间:2015-07-11 16:36:45

标签: android google-maps

我开发了一个Android应用程序。这个应用程序使用谷歌地图SDK并绘制一些多边形,标记等。它的工作非常好。但现在不是。我没有更改任何一行。

此行导致错误

int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);

这是错误日志:

07-11 19:09:43.695  31608-31608/com.ufukugur.notamseurope E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.ufuk.myapp, PID: 31608
    java.lang.NoSuchMethodError: No static method isSupportFragmentClass(Landroid/content/Context;Ljava/lang/String;)Z in class Landroid/support/v4/app/Fragment; or its super classes (declaration of 'android.support.v4.app.Fragment' appears in /data/app/com.google.android.gms-1/base.apk:classes3.dex)
            at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:256)
            at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
            at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
            at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)
            at android.app.Activity.setContentView(Activity.java:2145)
            at android.support.v7.app.ActionBarActivity.superSetContentView(ActionBarActivity.java:216)
            at android.support.v7.app.ActionBarActivityDelegateICS.setContentView(ActionBarActivityDelegateICS.java:110)
            at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:76)
            at com.ufukugur.notamseurope.MainActivity.onCreate(MainActivity.java:160)
            at android.app.Activity.performCreate(Activity.java:5990)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2278)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
            at android.app.ActivityThread.access$800(ActivityThread.java:151)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5254)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
你知道吗?

编辑:应用的第一个活动发生错误。如果我删除此行,则第一个活动运行时没有错误。但第二次活动崩溃了。我认为它与谷歌地图库定义有关 这是第一项活动

package com.ufuk.myapp;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Environment;
import android.provider.Settings;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import org.apache.commons.net.ftp.FTP;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;

public class ekrAcilis extends ActionBarActivity {
    final Context context = this;
    private dbManager dbMgr;
    private String nedir;
    String uyeKayitNo;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (uyeKayitNo.equals("0")) {
            final CharSequence[] FirItems;
            FirItems = new CharSequence[]{
                    getResources().getString(R.string.chkLA), getResources().getString(R.string.chkUD),
                    getResources().getString(R.string.chkLO), getResources().getString(R.string.chkEB),
                    getResources().getString(R.string.chkLQ), getResources().getString(R.string.chkLB)
            };
            final boolean[] FirChecked = dbMgr.readFIRfiltre();

            AlertDialog.Builder firBuilder=new AlertDialog.Builder(this);
            firBuilder.setTitle( getResources().getString(R.string.menuFIR));
            firBuilder.setPositiveButton(getResources().getString(R.string.btnTamam), new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    uyariEkranGoster();
                }
            });
            firBuilder.setMultiChoiceItems(
                    FirItems,
                    FirChecked,
                    new DialogInterface.OnMultiChoiceClickListener() {
                        @Override
                        public void onClick(DialogInterface dialog, int which, boolean isChecked) {
                            String fir[] = {                                      "LA", "UD", "LO", "EB", "LQ", "LB"};
                            FirChecked[which] = isChecked;
                            if (isChecked) {
                                dbMgr.executeSQL("insert into FIRfiltre (FIR) values ('" + fir[which] + "')");
                            } else {
                                dbMgr.executeSQL("delete from FIRfiltre where FIR = '" + fir[which] + "'");
                            }
                        }
                    });
            firBuilder.show();
        } else {
            nedir = "DURUM";
            DownloadWebPageTask task = new DownloadWebPageTask();
            task.execute(new String[]{"http://www.some.com/mobil.aspx?req=DURUM&id=" + uyeKayitNo});
            beklet();
        }
// this is the line
        int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);

0 个答案:

没有答案