Posts

Showing posts with the label Android Gradle Plugin

Android Studio 3.1.1 CreateProcess Error=206, The Filename Or Extension Is Too Long

Answer : I guess you are the windows user, there is a file path limit of 8191 in Windows XP and above. http://support.microsoft.com/kb/830473/en-us The simplest way this shorten the file path, like change the project folder into D:\, and refact your project path, and always use ASCII chars for the folder name. UTF-8 chars use 2-3 bytes. or move useless dependency. or change to MAC platform. ;) The reason is at the compile step, there is a command like javac xxxx, combine all dependences's path in one line. For me this worked. Go to Build -> Clean. File -> Invalidate Cache and Restart Or It might be due to network issue. Please check connectivity.

Cannot Enable Gradle's Offline Mode On Android Studio 3.6

Image
Answer : From the Android Studio 3.6 new features blog post: New location to toggle Gradle's offline mode To enable or disable Gradle's offline mode, first select View > Tool Windows > Gradle from the menu bar. Then, near the top of the Gradle window, click Toggle Offline Mode Gradle offline button in the Gradle panel.. Here is the link -- hope that helps! To enable or disable Gradle's offline mode, select View > Tool Windows > Gradle from the menu bar and near the top of the Gradle window, click Toggle Offline Mode To clarify it. In your Android Studio... View > Tool Windows > Gradle And then this... And this...

Android Studio 3.2.1 - Cannot Sync Project With Gradle Files: Argument For @NotNull Parameter 'message' Of ... Must Not Be Null

Answer : Ok, I was finally able to figure out the reason. The problem was, that my project folder resided on a different hard disk partition, than my home folder. The folder containing my android projects was linked to my home folder with a symbolic link. I can't tell whether its the symbolic link, or the other partition, that is causing the problem. I haven't checked that. Maybe it works if you have it on the same partition but linked with a symbolic link. Maybe it works when used on another partition without symbolic links. But for anyone experiencing this problem -> Check if one of these might be your cause as well. Some extra information: My android project folder resided on a hard disk partition formatted with ZFS. I saw a version of this with just now on Android Studio 3.4: the only error message I saw in the IDE was that Gradle sync failed, but in idea.log there was a NullPointerException and its traceback originated at com.intellij.openapi.extensions.Exte...

Android Studio: How To Generate Signed Apk Using Gradle?

Answer : There are three ways to generate your build as per the buildType . (In your case, it's release but it can be named anything you want.) Go to Gradle Task in right panel of Android Studio and search for assembleRelease or assemble(#your_defined_buildtype) under Module Tasks Go to Build Variant in Left Panel and select the build from drop down Go to project root directory in File Explore and open cmd/terminal and run: Linux: ./gradlew assembleRelease or assemble(#your_defined_buildtype) Windows: gradlew assembleRelease or assemble(#your_defined_buildtype) If you want to do a release build (only), you can use Build > Generate Signed apk . For other build types, only the above three options are available. You can find the generated APK in your module/build directory having the build type name in it. It is possible to take any existing Android Studio gradle project and build/sign it from the command line without editing any files. This makes it very n...