0

every time i create a new android studio project, the layout editor will be broken because the dependency com.android.support:appcompat-v7:28.0.0-alpha3 will spoil the layout editor with:

Render problem
Failed to load AppCompat ActionBar with unknown error.

Tip: Try to refresh the layout.

thanks to user JLC answer, the problem is solved, but if i create a new project, the problem will come back

so my question is how can i change it so that every new project will use dependency com.android.support:appcompat-v7:27.1.1 instead? thanks

Community
  • 1
  • 1
wolnavi
  • 183
  • 1
  • 14

1 Answers1

0

If you are using Android Studio 3.0 and above then make sure you are using the same content in build.gradle like-

buildscript {                 
    repositories {
        google()
        jcenter()
    }
    dependencies {            
        classpath 'com.android.tools.build:gradle:3.0.1'

    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

And for below Android Studio 3.0 and starting from support libraries 26.+ your project build.gradle must look like this-

allprojects {
    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
    }
}

For the detailed knowledge check the below docs-

  1. Build Dependencies

  2. Building Android apps

  3. Configure your build

Ankita
  • 1,129
  • 1
  • 8
  • 15
  • hey thanks for answering but i would like to ask how can i change the default project dependencies so that it would use appcompat-v7:27.1.1 instead of 28.0.0-alpha3? – wolnavi Jul 18 '18 at 12:06