Je sais que cette question a déjà été répondue mais je les ai tous vérifiés et rien n'a fonctionné.Android Studio ne peut pas résoudre R
J'ai un projet simple qui ne peut pas résoudre le signe R pour une raison quelconque.
Code MainActivity
public void onCreate(Bundle savedInstanceState)
{ super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editName = (EditText)findViewById(R.id.editname);
editCode =(EditText)findViewById(R.id.editcode);
bSearch=(Button)findViewById(R.id.bSearch);
}
activity_main Fichier
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:text="Ελληνικά Προϊόντα"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAlignment="center"
android:textSize="20dp"
android:layout_marginBottom="10dp"/>
<TextView android:text="Όνομα"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<EditText android:id="@+id/editname"
android:inputType="number"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView android:text="Κωδικός Προϊόντος"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<EditText android:id="@+id/editcode"
android:inputType="number"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<Button android:id="@+id/bSearch"
android:text="Αναζητηση"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
Android Manifest Fichier
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.seth.greekproducts" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="GreekProducts"
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity android:name=".MainActivity" >
</activity>
</application>
</manifest>
EDIT: à la console d'erreur que je reçois:
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner.Underlined'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'.
et des dizaines d'erreurs similaires.
EDIT: build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Importez-vous 'com.example.seth.greekprducts.R'? –
@bigdestroyer Merci d'avoir répondu. Oui et le R est lu à l'importation aussi! –
C'est une question trop ancienne –