设计编辑器在成功项目同步之后才可用。

huangapple go评论74阅读模式
英文:

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..

huangapple
  • 本文由 发表于 2020年9月12日 00:12:40
  • 转载请务必保留本文链接:https://go.coder-hub.com/63850693.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定