Cannot Resolve symbol 'R' in Android Studio :"manifest merger failed with multiple errors, see logs"

PeterChen

I'm a beginner and I use Android Studio. A problem keeps on bothers me.

It keeps on showing "Cannot Resolve symbol 'R' " everywhere with R.XXX.XXX

I've tried:

1.checking my xml files, including manifest

2.checking SDK whether Build Tools is installed

3.clean project

4.rebuild project

5.sync project with Gradle files

6.every way I could find on Internet

while rebuilding project the message shows "manifest merger failed with multiple errors, see logs"

I briefly paste a part of my activity here:

public class Clock_mainpage extends Activity {

private Button button_start;

private static final int START_LOCATION = 1;

private Item item;


private void findButton()
 {

    button_start = (Button) findViewById(R.id.start);

 }

 private Button.OnClickListener startclock = new Button.OnClickListener() 
 {
    @Override
   public void onClick(View view) 
    {
                Intent intentMap = new Intent(Clock_mainpage.this, MapsActivity.class);

                intentMap.putExtra("lat", item.getLatitude());
                intentMap.putExtra("lng",item.getLongitude());
                intentMap.putExtra("title",item.getTitle());
                intentMap.putExtra("datetime",item.getLocaleDatetime());

                startActivityForResult(intentMap, START_LOCATION);
                finish();

        }
    };

Seems it appears to be something wrong in my Manifest.xml I post it below:

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

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="21" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission      android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!--The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
     Google Maps Android API v2, but are recommended.
-->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

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

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <!-- Google Service edition -->
    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
    <meta-data android:name="com.google.android.gms.version"
    android:value="@integer/google_play_services_version" />

    <!-- Google Map API key -->
    <meta-data
        android:name="com.google.android.maps.v2.API_KEY"
        android:value="@string/google_maps_key" />

    <!-- Map component -->
    <activity
        android:name=".MapsActivity"
        android:label="@string/title_activity_maps" />

        <activity/>

    <application/>

</manifest>

Well, this problem seems to be simple to every of you. But I wasted 3hours or more on it. Appreciate to all of you. Sincerely

mariopce

You didn't past the most important think in such problem with R a imports. Problem is known and simple. For sure you had problem with some resources. R class was not generated. You get info from IDE that R can not be found and IDE propose you quick fix: import R class.

But because your R was not generated at that point and IDE has only android.R avaliable. IDE impot android.R

Please double check imports. In import you should have:

yourpackage.R

Este artigo é coletado da Internet.

Se houver alguma infração, entre em [email protected] Delete.

editar em
0

deixe-me dizer algumas palavras

0comentários
loginDepois de participar da revisão

Artigos relacionados

TOP lista

  1. 1

    R Shiny: use HTML em funções (como textInput, checkboxGroupInput)

  2. 2

    UITextView não está exibindo texto longo

  3. 3

    Dependência circular de diálogo personalizado

  4. 4

    Acessando relatório de campanhas na AdMob usando a API do Adsense

  5. 5

    Como assinar digitalmente um documento PDF com assinatura e texto visíveis usando Java

  6. 6

    R Folheto. Dados de pontos de grupo em células para resumir muitos pontos de dados

  7. 7

    Setas rotuladas horizontais apontando para uma linha vertical

  8. 8

    O Chromium e o Firefox exibem as cores de maneira diferente e não sei qual deles está fazendo certo

  9. 9

    Definir um clipe em uma trama nascida no mar

  10. 10

    Por que meus intervalos de confiança de 95% da minha regressão multivariada estão sendo plotados como uma linha de loess?

  11. 11

    Como dinamizar um Dataframe do pandas em Python?

  12. 12

    regex para destacar novos caracteres de linha no início e no fim

  13. 13

    Why isn't my C# .Net Core Rest API route finding my method?

  14. 14

    Como obter a entrada de trás de diálogo em treeview pyqt5 python 3

  15. 15

    Tabela CSS: barra de rolagem para a primeira coluna e largura automática para a coluna restante

  16. 16

    How to create dynamic navigation menu select from database using Codeigniter?

  17. 17

    Como recuperar parâmetros de entrada usando C #?

  18. 18

    Changing long, lat values of Polygon coordinates in python

  19. 19

    Livros sobre criptografia do muito básico ao muito avançado

  20. 20

    Método \ "POST \" não permitido no framework Django rest com ações extras & ModelViewset

  21. 21

    Pesquisa classificada, conte números abaixo do valor desejado

quentelabel

Arquivo