diff --git a/android/gradle.properties b/android/gradle.properties index c2d20e32b34..8f461178170 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -17,5 +17,9 @@ # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -android.enableJetifier=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn android.useAndroidX=true +# Automatically convert third-party libraries to use AndroidX +android.enableJetifier=true \ No newline at end of file diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index f6574fba6c0..14a25bff800 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -2,6 +2,6 @@ # $ ./gradlew wrapper --distribution-type=all --gradle-version=NEW_VERSION distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/gradlew b/android/gradlew index b0d6d0ab5de..83f2acfdc31 100755 --- a/android/gradlew +++ b/android/gradlew @@ -7,7 +7,7 @@ # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, @@ -125,8 +125,8 @@ if $darwin; then GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" fi -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` JAVACMD=`cygpath --unix "$JAVACMD"` diff --git a/android/gradlew.bat b/android/gradlew.bat index 15e1ee37a70..24467a141f7 100644 --- a/android/gradlew.bat +++ b/android/gradlew.bat @@ -5,7 +5,7 @@ @rem you may not use this file except in compliance with the License. @rem You may obtain a copy of the License at @rem -@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem https://www.apache.org/licenses/LICENSE-2.0 @rem @rem Unless required by applicable law or agreed to in writing, software @rem distributed under the License is distributed on an "AS IS" BASIS, diff --git a/docs/howto/build-run.md b/docs/howto/build-run.md index aed5cf113d2..c88c2c46042 100644 --- a/docs/howto/build-run.md +++ b/docs/howto/build-run.md @@ -211,6 +211,33 @@ To fix the problem, run `yarn`, which will update your installed packages in `node_modules/` to match the current `package.json`. You might need to restart Metro / `react-native start` after doing so. +### Build failure: java.nio.file.NoSuchFileException: /Users/chrisbobbe/dev/zulip-mobile/android/app/build/intermediates/ + +When trying to build the Android app, you may see this error: + +``` +java.nio.file.NoSuchFileException: /Users/chrisbobbe/dev/zulip-mobile/android/app/build/intermediates/external_file_lib_dex_archives/debug/out + at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) + at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) + at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) + at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:407) +``` + +Try removing `android/.gradle`, running `./gradlew clean` from +`android/`, and building again. + +### Build failure: No file known for: classes.dex + +When trying to build the Android app, you may see this error: + +``` +Execution failed for task ':app:packageDebug'. +> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade + > No file known for: classes.dex +``` + +Try removing `android/.gradle`, running `./gradlew clean` from +`android/`, and building again. ### Build failure: java.lang.UnsupportedClassVersionError, "Unsupported major.minor version 52.0"