def unlink_android(self, path, pkg):
bundle_id = self.ctx['<STR_LIT>']<EOL>with open(join('<STR_LIT>', '<STR_LIT>')) as f:<EOL><INDENT>settings_gradle = f.read()<EOL><DEDENT>with open(join('<STR_LIT>', '<STR_LIT>', '<STR_LIT>')) as f:<EOL><INDENT>build_gradle = f.read()<EOL><DEDENT>main_app_java_path = join('<STR_LIT>', '<STR_LIT>', '<STR_LIT:src>', '<STR_LIT>', '<STR_LIT>',<EOL>join(*bundle_id.split("<STR_LIT:.>")),<EOL>'<STR_LIT>')<EOL>with open(main_app_java_path) as f:<EOL><INDENT>main_application_java = f.read()<EOL><DEDENT>try:<EOL><INDENT>new_packages = Link.find_packages(join(path, '<STR_LIT>', pkg))<EOL>if not new_packages:<EOL><INDENT>print(Colors.RED+"<STR_LIT>"<EOL>"<STR_LIT>".format(pkg)+Colors.RESET)<EOL>return<EOL><DEDENT>if Link.is_settings_linked(settings_gradle, pkg):<EOL><INDENT>new_settings = [<EOL>line for line in settings_gradle.split("<STR_LIT:\n>")<EOL>if line.strip() not in [<EOL>"<STR_LIT>".format(name=pkg),<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(path=path,<EOL>name=pkg)<EOL>]<EOL>]<EOL>with open(join('<STR_LIT>', '<STR_LIT>'), '<STR_LIT:w>') as f:<EOL><INDENT>f.write("<STR_LIT:\n>".join(new_settings))<EOL><DEDENT>print("<STR_LIT>".format(pkg))<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>"<EOL>"<STR_LIT>".format(pkg))<EOL><DEDENT>if Link.is_build_linked(build_gradle, pkg):<EOL><INDENT>new_build = [<EOL>line for line in build_gradle.split("<STR_LIT:\n>")<EOL>if line.strip() not in [<EOL>"<STR_LIT>".format(name=pkg),<EOL>"<STR_LIT>".format(name=pkg),<EOL>]<EOL>]<EOL>with open(join('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'), '<STR_LIT:w>') as f:<EOL><INDENT>f.write("<STR_LIT:\n>".join(new_build))<EOL><DEDENT>print("<STR_LIT>"<EOL>"<STR_LIT>".format(pkg))<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>"<EOL>"<STR_LIT>".format(pkg))<EOL><DEDENT>new_app_java = []<EOL>for package in new_packages:<EOL><INDENT>javacls = os.path.splitext(package)[<NUM_LIT:0>].replace("<STR_LIT:/>", "<STR_LIT:.>")<EOL>if Link.is_app_linked(main_application_java, pkg, javacls):<EOL><INDENT>new_app_java = (new_app_java or<EOL>main_application_java.split("<STR_LIT:\n>"))<EOL>new_app_java = [<EOL>line for line in new_app_java<EOL>if line.strip() not in [<EOL>"<STR_LIT>".format(javacls),<EOL>"<STR_LIT>".format(javacls.split("<STR_LIT:.>")[-<NUM_LIT:1>]),<EOL>"<STR_LIT>".format(javacls.split("<STR_LIT:.>")[-<NUM_LIT:1>]),<EOL>]<EOL>]<EOL>found = False<EOL>j = <NUM_LIT:0><EOL>for i, line in enumerate(new_app_java):<EOL><INDENT>if fnmatch.fnmatch(line.strip(), "<STR_LIT>"):<EOL><INDENT>found = True<EOL><DEDENT>elif fnmatch.fnmatch(line.strip(), "<STR_LIT>"):<EOL><INDENT>j = i<EOL><DEDENT><DEDENT>if not found:<EOL><INDENT>new_app_java[j] = new_app_java[j][<EOL>:new_app_java[j].rfind('<STR_LIT:U+002C>')]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>print("<STR_LIT>".format(<EOL>pkg, main_app_java_path))<EOL><DEDENT><DEDENT>if new_app_java:<EOL><INDENT>with open(main_app_java_path, '<STR_LIT:w>') as f:<EOL><INDENT>f.write("<STR_LIT:\n>".join(new_app_java))<EOL><DEDENT><DEDENT>print(Colors.GREEN+"<STR_LIT>".format(<EOL>pkg)+Colors.RESET)<EOL><DEDENT>except Exception as e:<EOL><INDENT>print(Colors.RED+"<STR_LIT>"<EOL>"<STR_LIT>".format(pkg, e)+Colors.RESET)<EOL>with open(join('<STR_LIT>', '<STR_LIT>'), '<STR_LIT:w>') as f:<EOL><INDENT>f.write(settings_gradle)<EOL><DEDENT>with open(join('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'), '<STR_LIT:w>') as f:<EOL><INDENT>f.write(build_gradle)<EOL><DEDENT>with open(main_app_java_path, '<STR_LIT:w>') as f:<EOL><INDENT>f.write(main_application_java)<EOL><DEDENT>raise<EOL><DEDENT>
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.