Showing posts with label Gradle. Show all posts
Showing posts with label Gradle. Show all posts

Sunday, October 11, 2015

Avoiding AppCompat Proguard Crashes on Samsung Devices

appcompat-v7 v21.0.0 causing crash on Samsung devices with Android v4.2.2

Original Issue: https://code.google.com/p/android/issues/detail?id=78377

Google already provides Proguard rules for some of their libraries through AARs. One major issue that affects Samsung Jellybean devices(Android 4.2), is App Compat's Toolbar.

For those that have devices from Samsung running the same Android OS version or are tracking crash reports, you will most likely see the following error:

java.lang.NoClassDefFoundError: android.support.v7.internal.view.menu.MenuBuilder

Here is the Proguard rules to resolve this issue for (AppCompat-v7, v21,22,23.0.1):



Apply it to your own build.gradle:
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), rootProject.file('proguard-rules.pro')

Tuesday, May 26, 2015

My Repo is Trending on Github!

Trending Repository on Github
 
I recently made this template on Github for people starting software development with Android who want to use Intellij or Android Studio who are planning on using different testing libraries with test coverage. I plan on adding more examples for Mockito and Espresso testing libraries. Here is the

Github link: https://github.com/jaredsburrows/AndroidGradleTemplate

Here is an image of my repository on the Java page!

https://github.com/trending?l=java (wont always be trending)

Sunday, May 17, 2015

How to test Android with Gradle(Robolectric + EasyMock/PowerMock + JaCoCo + TravisCI)

How to test Android with Gradle + Android Studio + Robolectric + Mockito + EasyMock/PowerMock + JaCoCo + TravisCI

Here is my Github example:
https://github.com/jaredsburrows/AndroidGradleTemplate

AndroidGradleTemplate Status Coverage Status

Gradle + Android Studio + Robolectric + Mockito + EasyMock/PowerMock + JaCoCo

Technologies used:

Works with the following Configurations:
  • Multiple Modules
  • Multiple Flavors
  • Android Libraries

Getting Started:

Android Studio or Intellij Support(Simple):

  1. Import/Open this project with Android Studio/Intellij(click on build.gradle)
  2. Change the Build Variant Test Artifact to Unit Tests instead of Instrumentation Tests

Comand Line(Advanced):

Clone with Git:
  • git clone https://github.com/jaredsburrows/AndroidGradleTemplate.git
  • cd AndroidGradleTemplate
Installing/Running with Gradle:
  • Install the debug flavor on your Android Device:
    • gradlew installDebug
  • Install and Run the debug flavor on your Android Device:
    • gradlew runDebug
Testing with Gradle:
  • Run all tests in all flavors:
    • gradlew test
  • Run single test in all flavors:
    • gradlew test --tests="*MainActivityTest*"
  • Run all the debug flavor tests:
    • gradlew testDebug
  • Run single test in the debug flavor:
    • gradlew testDebug --tests="*MainActivityTest*"
  • Run single test in the debug flavor with Jacoco test reports:
    • gradlew testDebug --tests="*MainActivityTest*" jacocoTestReport

License

Copyright (C) 2015 AndroidGradleTemplate by Jared Burrows

Licensed under the Apache License, Version 2.0 (the "License");
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

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Monday, November 17, 2014

Gradle iOS Plugin

Gradle iOS Plugin

This plugin is in Beta and Open Source:

https://github.com/jaredsburrows/gradle-ios-plugin

There is an example repository here:

https://github.com/jaredsburrows/gradle-ios-plugin-example


There is an Android Plugin for Gradle, why isn't there one for iOS?

Example "build.gradle":

buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'burrows.apps.ios:gradle:0.0.1'
    }
}

apply plugin: 'com.ios.application'

ios {
    compileSdkVersion '8.1'     //  iOS SDK version
    buildToolsVersion '6.1'     //  XCode version

    defaultConfig {
        minSdkVersion 8         // Minimum iOS SDK version
        targetSdkVersion 19     // Target iOS SDK version
        versionCode 1           // *optional*
        versionName '1.0'       // *optional*
    }

    // Cocoa Pods
    pods {
        pod 'Google-Mobile-Ads-SDK'
        pod 'GoogleAnalytics-iOS-SDK'
    }
}

dependencies {
    ...
}