我在 android studio 到 3.4.2 在 macOs Mojave 上遇到了这个错误,尽管同一个项目在我的 Windows 笔记本电脑上使用相同的配置。
我正在使用 gradle-2.10 和 ndk 版本 ndk-bundle-r12b
我试图降级到早期版本,但它没有帮助。我无法更改 gradle 版本,因为它会导致其他兼容性问题
INFO - .project.GradleProjectResolver - Gradle project resolve error
java.lang.UnsupportedOperationException: Unsupported method: NativeArtifact.getAbi()
at com.android.ide.common.gradle.model.IdeNativeArtifact.getAbi(IdeNativeArtifact.java:97)
at com.android.tools.idea.gradle.project.model.NdkModuleModel.populateForFullVariantsSync(NdkModuleModel.java:120)
at com.android.tools.idea.gradle.project.model.NdkModuleModel.populateModuleFields(NdkModuleModel.java:102)
at com.android.tools.idea.gradle.project.model.NdkModuleModel.<init>(NdkModuleModel.java:94)
at com.android.tools.idea.gradle.project.sync.idea.AndroidGradleProjectResolver.populateModuleContentRoots(AndroidGradleProjectResolver.java:258)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:96)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:96)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:96)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:96)
at org.jetbrains.kotlin.android.configure.KotlinAndroidMPPGradleProjectResolver.populateModuleContentRoots(KotlinAndroidMPPGradleProjectResolver.kt:51)
at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.populateModuleContentRoots(AbstractProjectResolverExtension.java:96)
at org.jetbrains.plugins.gradle.service.project.TracedProjectResolverExtension.populateModuleContentRoots(TracedProjectResolverExtension.java:62)