【问题标题】:Manifest attribute in Android using Eclipse使用 Eclipse 在 Android 中的清单属性
【发布时间】:2021-02-10 18:43:38
【问题描述】:

我是 android 编程新手,在学习 Youtube 上的一些教程时遇到了一些错误。

Manifest attribute 'minSdkVersion' is set to 'R'. Integer is expected.

代码如下:

import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, 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);
    }
}

这是 AndroidManifest.xml | 再次,我只是一个初学者,请帮助谢谢!

【问题讨论】:

  • Eclipse 多年来一直不支持 Android 开发。 android-studio 是您应该使用的。任何使用 Eclipse 的教程都已过时。
  • 请分享您的 AndroidManifest 文件。
  • @greg-449 哦,好的,谢谢!
  • @PriyankaRajput 我添加了它
  • 添加xml文件的代码

标签: android eclipse


【解决方案1】:

您需要更改 minSdkVersion 版本如下

android:minSdkVersion="21"

【讨论】:

    猜你喜欢
    • 2013-06-03
    • 1970-01-01
    • 2015-10-19
    • 2016-10-20
    • 1970-01-01
    • 1970-01-01
    • 2013-12-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多