www.91084.com

GVKun编程网logo

Android Studio 添加 JetBrainsMono 字体(android studio添加文字)

8

本篇文章给大家谈谈AndroidStudio添加JetBrainsMono字体,以及androidstudio添加文字的知识点,同时本文还将给你拓展AndroidAnnotations框架配置Andr

本篇文章给大家谈谈Android Studio 添加 JetBrainsMono 字体,以及android studio添加文字的知识点,同时本文还将给你拓展Android Annotations框架配置Android Studio的操作步骤、Android Studio 1.2 中配置 androidannotations、Android Studio 1.2中配置androidannotations、Android Studio 3.1:找不到org.jetbrains.trove4j:trove4j:20160824等相关知识,希望对各位有所帮助,不要忘了收藏本站喔。

本文目录一览:

Android Studio 添加 JetBrainsMono 字体(android studio添加文字)

Android Studio 添加 JetBrainsMono 字体(android studio添加文字)

根据Android Studio使用的JDK环境分两种情况:
1、Android Studio 使用自身安装目录下的JDK,此时把JetBrainsMono字体文件拷贝到安装目录下的jre/jre/lib/fonts目录下。
2、Android Studio使用的是系统的JAVA环境,把JetBrainsMono拷贝到$JAVA_HOME/jre/lib/fonts目录下。
重新启动 Android Studio 即可看到 JetBrainsMono 字体,如果要安装其他的字体也可以参考此方法。

Android Annotations框架配置Android Studio的操作步骤

Android Annotations框架配置Android Studio的操作步骤

1.配置gradle(Project):
  classpath ''com.neenbedankt.gradle.plugins:android-apt:1.8''

allprojects {
 repositories {
    mavenCentral()
        mavenLocal()
        maven {
            url ''https://repo.spring.io/libs-snapshot''
        }
    }
}
2.配置gradle(app):
添加:
apply plugin: ''android-apt''
def AAVersion = ''版本号''

apt {
    arguments {
        androidManifestFile variant.outputs[0]?.processResources?.manifestFile(新版本写这一句)
        // if you have multiple outputs (when using splits), you may want to have other index than 0

        // you should set your package name here if you are using different application IDs
        //  resourcePackageName "com.example.hp.myapplication"

        // You can set optional annotation processing options here, like these commented options:
        // logLevel ''INFO''
        // logFile ''/var/log/aa.log''
    }
}
dependencies {
 compile ''com.android.support:appcompat-v7:23.3.0''
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
    }

     到这里位置已经可以正常使用AndroidAnnotations,包括 @EActiivty 等.
     (注意:在使用过注解工具之后点击Build中的Make Project,
     后台会自动生成一个比类名多一个下划线的类,比如:MainActivity生成之后就是MainActivity_,
     这时候去MainFests中把android: name=“  "类名"中的类名后加上"_"点击Make Project就行了)

 要是使用网络Rest注解工具在gradle(app)中添加:

//添加的是为了防止重复引用
  packagingOptions {
        exclude ''META-INF/DEPENDENCIES.txt''
        exclude ''META-INF/LICENSE.txt''
        exclude ''META-INF/NOTICE.txt''
        exclude ''META-INF/NOTICE''
        exclude ''META-INF/LICENSE''
        exclude ''META-INF/DEPENDENCIES''
        exclude ''META-INF/notice.txt''
        exclude ''META-INF/license.txt''
        exclude ''META-INF/dependencies.txt''
        exclude ''META-INF/LGPL2.1''
    }
//添加的是第三方包
dependencies {
apt "org.androidannotations:rest-spring:$AAVersion"
    compile "org.androidannotations:rest-spring-api:$AAVersion"
    compile ''org.springframework.android:spring-android-rest-template:2.0.0.BUILD-SNAPSHOT''
    compile ''org.springframework.android:spring-android-core:2.0.0.BUILD-SNAPSHOT''
    compile files(''libs/jackson-annotations-2.8.0-20160517.060412-45.jar'')
    compile files(''libs/jackson-core-2.8.0-20160515.013135-115.jar'')
    compile files(''libs/jackson-databind-2.8.0-20160517.061118-256.jar'')

}
 

Android Studio 1.2 中配置 androidannotations

Android Studio 1.2 中配置 androidannotations

Gradle 版本 2.2.1

Android Studio 1.2


apply plugin: ''com.android.application''
apply plugin: ''android-apt''
def AAVersion = ''3.2+''

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.adndroid.demo"
        minSdkVersion 11
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }

    lintOptions {
        abortOnError false
    }

    buildTypes {
        release {
            minifyEnabled false
            //shrinkResources true
            proguardFiles getDefaultProguardFile(''proguard-android.txt''), ''proguard-rules.pro''
        }
    }
}

apt{
    arguments{
        androidManifestFile variant.outputs[0].processResources.manifestFile
    }
}

dependencies {
    compile fileTree(dir: ''libs'', include: [''*.jar''])
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
    compile ''com.android.support:appcompat-v7:22.0.0''
}

Android Studio 1.2中配置androidannotations

Android Studio 1.2中配置androidannotations

Gradle版本2.2.1

Android Studio 1.2


apply plugin: ''com.android.application''
apply plugin: ''android-apt''
def AAVersion = ''3.2+''

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.adndroid.demo"
        minSdkVersion 11
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }

    lintOptions {
        abortOnError false
    }

    buildTypes {
        release {
            minifyEnabled false
            //shrinkResources true
            proguardFiles getDefaultProguardFile(''proguard-android.txt''), ''proguard-rules.pro''
        }
    }
}

apt{
    arguments{
        androidManifestFile variant.outputs[0].processResources.manifestFile
    }
}

dependencies {
    compile fileTree(dir: ''libs'', include: [''*.jar''])
    apt "org.androidannotations:androidannotations:$AAVersion"
    compile "org.androidannotations:androidannotations-api:$AAVersion"
    compile ''com.android.support:appcompat-v7:22.0.0''
}

Android Studio 3.1:找不到org.jetbrains.trove4j:trove4j:20160824

Android Studio 3.1:找不到org.jetbrains.trove4j:trove4j:20160824

昨天,我将 Android Studio更新为3.1,我收到此错误:
Could not find org.jetbrains.trove4j:trove4j:20160824.
Searched in the following locations:
    https://repo.maven.apache.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
    https://repo.maven.apache.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
    https://dl.google.com/dl/android/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
    https://dl.google.com/dl/android/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.jar
required by:
    project :library > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 > com.android.tools.lint:lint:26.0.1 > com.android.tools.lint:lint-checks:26.0.1 > com.android.tools.lint:lint-api:26.0.1 > com.android.tools.external.com-intellij:intellij-core:26.0.1

这是我项目的gradle文件:

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
//        classpath 'com.google.gms:google-services:1.5.0-beta2'
        classpath 'com.google.gms:google-services:3.1.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url 'https://maven.fabric.io/public' }

        maven {
            url 'https://maven.google.com/'

        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

这是我的gradle-wrapper-properties的distdistributionUrl:

distdistributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip

解决方法

尝试在gradle构建中用jcenter()替换所有出现的mavenCentral()

关于Android Studio 添加 JetBrainsMono 字体android studio添加文字的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于Android Annotations框架配置Android Studio的操作步骤、Android Studio 1.2 中配置 androidannotations、Android Studio 1.2中配置androidannotations、Android Studio 3.1:找不到org.jetbrains.trove4j:trove4j:20160824等相关内容,可以在本站寻找。

本文标签: