英文:
Design editor is Unavailable Until after successful project sync
问题
我是Android的新手,当我尝试在首个应用的设计编辑器中设计UI时,我遇到了一个错误:“在成功项目同步之后才可以使用设计编辑器”,然后我意识到同步面板中也有问题,而这一切都与`build.gradle`中的依赖项有关。为了解决这个问题,我应该如何更改依赖项?以下是`build.gradle`中的依赖项:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}
以下是同步错误:
错误:未能解析:junit
错误:未能解析:espresso-idling-source
错误:未能解析:runner
错误:未能解析:core
错误:未能解析:espresso-core
错误:未能解析:monitor
英文:
I am new to Android and when I tried to design UI in design editor for the first app I faced an error "Design editor is Unavailable Until after successful project sync", then I realized that I had also issues in sync panel and that was all about dependencies in build.gradle
. How should I change dependencies to solve this issue? Below are dependencies in build.gradle
:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}
And below are sync errors:
ERROR:Failed to resolve:junit
ERROR:Failed to resolve:epresso-idling-source
ERROR:Failed to resolve:runner
ERROR:Failed to resolve:core
ERROR:Failed to resolve:epresso-core
ERROR:Failed to resolve:monitor
答案1
得分: 1
我刚刚从依赖项中删除了下面的这些行,并且它运行正常,
testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
但我不知道这是否会在将来引发问题。
英文:
I just removed these below lines from dependencies and it worked,
> testImplementation 'junit:junit:4.12'
> androidTestImplementation 'androidx.test.ext:junit:1.1.1'
> androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
but i dont know that will cause an issue in future or not..
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论