我创建一个项目,build.gradle
(项目)和build.gradle
(模块)都在Android文件夹结构中正常列出,看起来像 Old Image 1 ,然后进行同步将项目迁移到Android Studio 3.4.1中的远程GitHub。
我从另一台PC的GitHub上克隆了项目,我发现build.gradle
(项目)在另一台PC的Android文件夹结构中消失了,看起来像 New Image 1 ,但是我可以在Project文件夹结构中找到它,就像 New Image 2 。为什么?顺便说一句,克隆项目可以很好地工作。
似乎Github引起了问题,我该如何解决?谢谢!
旧图片1
新图片1
新图片2
至InsurgentPointerException:
这是项目级别的build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.40'
ext.anko_version = '0.10.8'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
再次发生InsurgentPointerException:
您可以通过
的克隆对其进行测试您可以在以下位置下载Android Studio的项目源代码
答案 0 :(得分:1)
所以似乎就像开发人员故意那样做。 IDK可能曾经有一些设置,但现在找不到了。此解决方案是一种(相当冗长的)解决方法。
build.gradle
和app/build.gradle