Reputation: 35
I was working on a project, following error showed up:
ERROR: Failed to resolve: com.android.support:design:29.3.0 Add Google Maven repository and sync project Show in Project Structure dialog Affected Modules: app ERROR: Failed to resolve: com.android.support:appcompat-v7:29.3.0 Add Google Maven repository and sync project Show in Project Structure dialog Affected Modules: app
Here is the code for the XML:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/tan_background"
android:orientation="vertical"
tools:context="com.example.android.miwok.MainActivity">
<TextView
android:id="@+id/numbers"
style="@style/CategoryStyle"
android:background="@color/category_numbers"
android:text="@string/category_numbers" />
<TextView
android:id="@+id/family"
style="@style/CategoryStyle"
android:background="@color/category_family"
android:text="@string/category_family" />
<TextView
android:id="@+id/colors"
style="@style/CategoryStyle"
android:background="@color/category_colors"
android:text="@string/category_colors" />
<TextView
android:id="@+id/phrases"
style="@style/CategoryStyle"
android:background="@color/category_phrases"
android:text="@string/category_phrases" />
</LinearLayout>
And Java:
package com.example.android.myprejoct;
import android.os.Bundle;
import androidx.annotation.*;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
What do I do?
Upvotes: 0
Views: 97
Reputation: 1049
Add this line in gradle file
allprojects {
repositories {
google()
// If you're using a version of Gradle lower than 4.1, you must
// instead use:
//
// maven {
// url 'https://maven.google.com'
// }
}
}
Hope this will work!
Upvotes: 1