Java (UNVOVD)Android碎片活动错误

Java (UNVOVD)Android碎片活动错误,java,android,eclipse,google-maps,dependencies,Java,Android,Eclipse,Google Maps,Dependencies,早上好 在Eclipse中设置Android依赖项时,我遇到了很多问题 自从修复了原始错误(依赖性)之后,我现在遇到了一些新的错误,这些错误似乎不是由于以前的XML和targetSDK错误而发生的,而是其他一些错误 我想创建一个简单的应用程序,但是它需要我使用谷歌地图api,从本周开始,我基本上一直在努力正确设置依赖项 我已经做了一切,从重新安装ADT,SDK,额外的和更多的-但没有用。我已经学习了谷歌开发人员关于android环境的教程 当前错误: Description Resour

早上好

在Eclipse中设置Android依赖项时,我遇到了很多问题

自从修复了原始错误(依赖性)之后,我现在遇到了一些新的错误,这些错误似乎不是由于以前的XML和targetSDK错误而发生的,而是其他一些错误

我想创建一个简单的应用程序,但是它需要我使用谷歌地图api,从本周开始,我基本上一直在努力正确设置依赖项

我已经做了一切,从重新安装ADT,SDK,额外的和更多的-但没有用。我已经学习了谷歌开发人员关于android环境的教程

当前错误:

  Description   Resource    Path    Location    Type
FragmentActivity cannot be resolved to a type   Startup.java    /birdview/src/com/example/birdview  line 14 Java Problem
FragmentActivity cannot be resolved to a type   Startup.java    /birdview/src/com/example/birdview  line 19 Java Problem
FragmentActivity cannot be resolved to a type   Startup.java    /birdview/src/com/example/birdview  line 42 Java Problem
The method getFragmentManager() is undefined for the type Startup   Startup.java    /birdview/src/com/example/birdview  line 22 Java Problem
The method getMenuInflater() is undefined for the type Startup  Startup.java    /birdview/src/com/example/birdview  line 29 Java Problem
The method onCreate(Bundle) of type Startup must override or implement a supertype method   Startup.java    /birdview/src/com/example/birdview  line 18 Java Problem
The method onCreateOptionsMenu(Menu) of type Startup must override or implement a supertype method  Startup.java    /birdview/src/com/example/birdview  line 27 Java Problem
The method onOptionsItemSelected(MenuItem) of type Startup must override or implement a supertype method    Startup.java    /birdview/src/com/example/birdview  line 34 Java Problem
The method setContentView(int) is undefined for the type Startup    Startup.java    /birdview/src/com/example/birdview  line 20 Java Problem
Unable to resolve target 'android-19' until the SDK is loaded.  hello       Unknown Android Target Problem
Unable to resolve target 'android-21' until the SDK is loaded.  birdview        Unknown Android Target Problem
Unable to resolve target 'android-21' until the SDK is loaded.  google-play-services_lib        Unknown Android Target Problem
自从更改targetSDK以来,依赖性错误现在消失了,但是上面的错误已经取代了它

我已尝试删除该项目,并重新添加它。还尝试重新安装这些工具,以防它们干扰我

我不确定你们还需要什么样的代码来帮助我,所以请继续告诉我你们是否需要更多的代码片段

任何关于这个问题的帮助都将不胜感激

致以最良好的祝愿, 约金

编辑(渐变文件):


编辑:仍然需要帮助。

添加最新的支持和设计依赖项,并重建项目

compile 'com.android.support:design:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'

这是因为您的
compiledSdkVersion
。您应该将其设置为21或更高,因为API级别21中引入了
@android:style/Theme.Material.Light.DialogWhenLarge.NoActionBar
。请参阅。

发布您的渐变文件,请参见编辑。非常感谢。试图将其添加到依赖项{}中并重建项目(clean..build),但它没有做任何事情…知道它可能是什么吗?这确实解决了依赖项问题。然而,现在我面临着各种其他错误,比如:“FragmentActivity无法解析为类型”。有关更多信息,请参阅我的启动编辑(仅活动)。您可能希望查看此。
    package com.example.birdview;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;

public class Startup extends FragmentActivity 
implements OnMapReadyCallback {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_startup);
        if (savedInstanceState == null) {
            getFragmentManager().beginTransaction().add(R.id.container, new PlaceholderFragment()).commit();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.startup, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    /**
     * A placeholder fragment containing a simple view.
     */
    public static class PlaceholderFragment extends Fragment {

        public PlaceholderFragment() {
        }

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
            View rootView = inflater.inflate(R.layout.fragment_startup, container, false);
            return rootView;
        }
    }

    @Override
    public void onMapReady(GoogleMap googleMap) {
        // TODO Auto-generated method stub

    }
}
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'