就我而言,就像source code like this
然后,我单击“下载源”,但看到此错误: error
java.util.NoSuchElementException
at java.util.Collections$EmptyIterator.next(Collections.java:4189)
at org.jetbrains.plugins.gradle.util.GradleAttachSourcesProvider.getSourceFile(GradleAttachSourcesProvider.java:160)
at org.jetbrains.plugins.gradle.util.GradleAttachSourcesProvider.access$100(GradleAttachSourcesProvider.java:59)
at org.jetbrains.plugins.gradle.util.GradleAttachSourcesProvider$1$1.onSuccess(GradleAttachSourcesProvider.java:126)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$7.execute(ExternalSystemUtil.java:943)
at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$9.run(ExternalSystemUtil.java:972)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:736)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:157)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:580)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:525)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:85)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:144)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:395)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
我确定我的网络正常。对于许多其他库来说,这还可以。所以,我对此感到困惑。有人可以告诉我为什么会发生问题吗?我还想知道android studio如何下载源代码并附加它们,为此是否有任何文档?
答案 0 :(得分:0)
由于某些未知的原因,当前的 ConstraintLayout 依赖项(请参阅您的 build.gradle )不附带源代码!我正在使用“ hack”:
(A)使用浏览器将正式文档保存到路径取决于您的SDK位置的文件中。 (您将必须创建任何空的中间文件夹)。
https://developer.android.com/reference/androidx/constraintlayout/widget/ConstraintLayout
file:///[your SDK]/docs/reference/androidx/constraintlayout/widget/ConstraintLayout.html
(B)在Android Studio Project 视图中,单击 外部文件 ,然后导航至您的依赖项。例如:
Gradle: androidx.constraintlayout:constraintlayout:2.0.0-beta3@aar
(C)右键单击-> 库属性 -> 指定文档URL :
file:///[your SDK]/docs/reference
不是很好,但是总比没有好。我对 MotionLayout 和其他一些重复了。