Things not going well building the project? See the known issues below and some solutions. If you're a user of the app, check out our FAQ.
In your gradle.properties file in the root of the project, add:
org.gradle.jvmargs=-Xmx2048m
This must be at least 2 Gb to take advantage of Dex In Process. See this post for more info.
You're most likely trying to run the obaAmazon build variant on an Google Android device, or the obaGoogle build flavor on an Amazon device.
To build the version of OneBusAway on Google Play, you'll want to select the obaGoogleDebug build variant.
Steps to set the build variant:
- In Android Studio, you'll see a "Build Variant" button on the very left side of the screen, collapsed in the dock. Click on this, and select either
obaGoogleDebugfor Google devices, orobaAmazonDebugfor Amazon devices: - From the command line, run
gradlew installObaGoogleDebugfor Google devices, orgradlew installObaAmazonDebugfor Amazon devices.
See the documentation at the top of the readme for more information on building via Android Studio or the command line.
When running the project I get prompted to install Amazon Maps. I already have Google Maps installed. What's going on?
This is likely due to running the obaAmazon build variant on an Google Android device. See the top troubleshooting question, and make sure you select the obaGoogleDebug build variant.
When running the project I get prompted to install Google Play Services. I have an Amazon Fire Phone that doesn't have Google Play Services. What's going on?
This is likely due to running the obaGoogle build variant on an Amazon Fire Phone. See the top troubleshooting question, and make sure you select the obaAmazonDebug build variant.
When importing to Android Studio, I get an error "You are using an old, unsupported version of Gradle..."
If you're using Android Studio v0.4.2 or lower, when importing, please be sure to select the settings.gradle file in the root, NOT the project directory.
You will get the above error if you select the project directory / name of the project.
Open the Android SDK Manager and make sure the following are installed:
- Under Tools
- Android SDK Tools
- Android SDK Platform-tools
- Android SDK Build-tools
- Under the currently used SDK version (see
compileSdkVersioninonebusaway-android/build.gradle)- SDK Platform
- Google APIs
- Extras
- Android Support Repository
- Android Support Library
- Google Play services
- Google Repository
Make sure that you're consistently using the same Android SDK throughout Android Studio and your environmental variables. Android Studio comes bundled with an Android SDK, and can get confused if you're pointing to this SDK within Android Studio but have your environmental variables pointed elsewhere. Click "File->Project Structure", and then under "Android SDK" make sure you "Android SDK Location" is the correct location of your Android SDK.
Also, make sure you've set the ANDROID_HOME environmental variable to your Android SDK location and
the JAVA_HOME environmental variables to point to your JDK folder.
