无法解析模板"Class". [英] Unable to parse template "Class"

查看:826
本文介绍了无法解析模板"Class".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在android中创建类,但出现此错误

I am trying to create class in android but i got this error

无法解析模板类" 错误消息:此模板未产生Java类或接口

Unable to parse template "Class" Error message: This template did not produce a Java class or an interface

在事件日志中,我收到此错误

and in Event log I got this error

FileNotFoundException:/D:/Android%20Studio/lib/idea.jar

FileNotFoundException: Entry fileTemplates//code/Google Test Fixture SetUp Method.cc.ft not found in /D:/Android%20Studio/lib/idea.jar

这是我的应用程序摇篮

apply plugin: 'com.android.application'

android
  {

compileSdkVersion 23
buildToolsVersion '25.0.0'

defaultConfig {
    applicationId "com.hh.ss.msed"
    minSdkVersion 14
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    multiDexEnabled true


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


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.google.firebase:firebase-core:11.0.1'
    compile 'com.google.firebase:firebase-database:11.0.1'
    compile 'com.google.firebase:firebase-crash:11.0.1'
    compile 'com.google.firebase:firebase-storage:11.0.1'
    compile 'com.android.support:recyclerview-v7:23.0.0'
    compile 'com.android.support:cardview-v7:23.0.0'
    compile 'com.firebaseui:firebase-ui-database:0.6.2'


    compile 'com.firebase:firebase-client-android:2.4.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.android.support:support-v4:23.0.0'


}


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'
   }
  }
  apply plugin: 'com.google.gms.google-services'

这个buldle gradle项目

this bulid gradle project

// Top-level build file where you can add configuration options common to all sub-projects/modules.

  buildscript {
  repositories {
    jcenter()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:2.3.3'
    classpath 'com.google.gms:google-services:3.1.0'

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

 allprojects {
  repositories {
    jcenter()
  }
}

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

怎么了?

推荐答案

转到文件"->设置"->编辑器"->文件和代码模板",在文件"选项卡中选择类",然后将其粘贴:

Go to File->setting->editor->file and code templates, select Class in the files tab and paste this:

#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end #parse("File Header.java") public class ${NAME} { }

这篇关于无法解析模板"Class".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆