I create a project, both build.gradle
(Project) and build.gradle
(Module) are listed in Android folder structure normally, look likes Old Image 1, then I sync the project to remote GitHub in Android Studio 3.4.1.
I clone the project from GitHub in another PC, I find that build.gradle
(Project) disappear in Android folder structure in the another PC, look likes New Image 1, but I can find it in Project folder structure, look likes New Image 2. Why? BTW, the clone project can work well.
It seems that Github cause the problem, how can I fix it? Thanks!
Old Image 1
New Image 1
New Image 2
To InsurgentPointerException:
This is project level 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
}
Again to InsurgentPointerException:
You can test it by clone from
https://github.com/mycwcgr/aa
You can download the project source code of Android Studio at
https://www.dropbox.com/s/ko8stedl135ohnt/MyTest.zip?dl=0
gradle file is located inside your project folder under app/build. gradle.
Open your gradle. properties file in Android Studio. Restart Android Studio for your changes to take effect. Click Sync Project with Gradle Files to sync your project.
It could be that you are using gradle in offline mode. To uncheck it go to File > Settings > Gradle , uncheck the Offline Work checkbox, and click Apply Make sure you have internet connection and sync the project again.
Android | build.gradle. Gradle is a build system (open source) which is used to automate building, testing, deployment etc. “Build.gradle” are scripts where one can automate the tasks. For example, the simple task to copy some files from one directory to another can be performed by Gradle build script before the actual build process happens.
What does the error, Gradle project sync failed Please fix your project and try again” in Android Studio mean? Gradle sync is one of the Gradle tasks which checks for all the dependencies present in the build. Gradle files.
Starting in Gradle 7.0, file watching is enabled by default. If you are working on Mac OS and your project is saved under /System/Volumes/Data, Gradle file watching will not properly track file changes. This will cause the Build System to not see any file changes and it will therefore not update the APK (s).
dependencies – This specify the dependencies that are needed to build the project. Both the top-level and module-level build.gradle files are the main script files for automating the tasks in an android project and are used by the Gradle for generating the APK from the source files.
So it seems like the Developers did that intentionally. IDK there probably used to be some setting for it but now I can't find it. This solution is a (rather lengthy) workaround.
build.gradle
and app/build.gradle
in the the Android View > Gradle Scripts (Optional)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With