def unlink_android(self, path, pkg):
        """ Unlink's the android project to this library.

            1. In the app's android/settings.gradle, it removes the following 
            lines (if they exist):
                    include ':<project-name>'
                    project(':<project-name>').projectDir = new File(
                    rootProject.projectDir, 
                        '../venv/packages/<project-name>/android')

            2. In the app's android/app/build.gradle, it removes the following 
            line (if present)
                    compile project(':<project-name>')

            3. In the app's
             android/app/src/main/java/<bundle/id>/MainApplication.java, 
             it removes:
                    import <package>.<Name>Package;
                     new <Name>Package(), 
                     
                  If no comma exists it will remove the comma from the previous 
                  line.
                    
        """
        bundle_id = self.ctx['bundle_id']

        #: Check if it's already linked
        with open(join('android', 'settings.gradle')) as f:
            settings_gradle = f.read()
        with open(join('android', 'app', 'build.gradle')) as f:
            build_gradle = f.read()

        #: Find the MainApplication.java
        main_app_java_path = join('android', 'app', 'src', 'main', 'java',
                                  join(*bundle_id.split(".")),
                                  'MainApplication.java')
        with open(main_app_java_path) as f:
            main_application_java = f.read()

        try:
            #: Now link all the EnamlPackages we can find in the new "package"
            new_packages = Link.find_packages(join(path, 'android', pkg))
            if not new_packages:
                print(Colors.RED+"\t[Android] {} No EnamlPackages found to "
                                 "unlink!".format(pkg)+Colors.RESET)
                return

            #: Unlink settings.gradle
            if Link.is_settings_linked(settings_gradle, pkg):
                #: Remove the two statements
                new_settings = [
                    line for line in settings_gradle.split("\n")
                    if line.strip() not in [
                        "include ':{name}'".format(name=pkg),
                        "project(':{name}').projectDir = "
                        "new File(rootProject.projectDir, "
                        "'../{path}/android/{name}')".format(path=path,
                                                             name=pkg)
                    ]
                ]

                with open(join('android', 'settings.gradle'), 'w') as f:
                    f.write("\n".join(new_settings))
                print("\t[Android] {} unlinked settings.gradle!".format(pkg))
            else:
                print("\t[Android] {} was not linked in "
                      "settings.gradle!".format(pkg))

            #: Unlink app/build.gradle
            if Link.is_build_linked(build_gradle, pkg):
                #: Add two statements
                new_build = [
                    line for line in build_gradle.split("\n")
                    if line.strip() not in [
                        "compile project(':{name}')".format(name=pkg),
                        "api project(':{name}')".format(name=pkg),
                    ]
                ]

                with open(join('android', 'app', 'build.gradle'), 'w') as f:
                    f.write("\n".join(new_build))

                print("\t[Android] {} unlinked in "
                      "app/build.gradle!".format(pkg))
            else:
                print("\t[Android] {} was not linked in "
                      "app/build.gradle!".format(pkg))

            new_app_java = []
            for package in new_packages:
                #: Add our import statement
                javacls = os.path.splitext(package)[0].replace("/", ".")

                if Link.is_app_linked(main_application_java, pkg, javacls):
                    #: Reuse previous if avialable
                    new_app_java = (new_app_java or
                                    main_application_java.split("\n"))

                    new_app_java = [
                        line for line in new_app_java
                        if line.strip() not in [
                            "import {};".format(javacls),
                            "new {}()".format(javacls.split(".")[-1]),
                            "new {}(),".format(javacls.split(".")[-1]),
                        ]
                    ]

                    #: Now find the last package and remove the comma if it
                    #: exists
                    found = False
                    j = 0
                    for i, line in enumerate(new_app_java):
                        if fnmatch.fnmatch(line.strip(), "new *Package()"):
                            found = True
                        elif fnmatch.fnmatch(line.strip(), "new *Package(),"):
                            j = i

                    #: We removed the last package so add a comma
                    if not found:
                        #: This kills any whitespace...
                        new_app_java[j] = new_app_java[j][
                                          :new_app_java[j].rfind(',')]

                else:
                    print("\t[Android] {} was not linked in {}!".format(
                        pkg, main_app_java_path))

            if new_app_java:
                with open(main_app_java_path, 'w') as f:
                    f.write("\n".join(new_app_java))

            print(Colors.GREEN+"\t[Android] {} unlinked successfully!".format(
                  pkg)+Colors.RESET)

        except Exception as e:
            print(Colors.RED+"\t[Android] {} Failed to unlink. "
                  "Reverting due to error: {}".format(pkg, e)+Colors.RESET)

            #: Undo any changes
            with open(join('android', 'settings.gradle'), 'w') as f:
                f.write(settings_gradle)
            with open(join('android', 'app', 'build.gradle'), 'w') as f:
                f.write(build_gradle)
            with open(main_app_java_path, 'w') as f:
                f.write(main_application_java)

            #: Now blow up
            raise