[英]Minecraft forge mod compiling error
我做了一個mod,現在我想編譯它,我遵循了一個教程並試圖編譯,但是我有一個錯誤。 請告訴我我做錯了。 謝謝。
終奌站:
* Where:
Build file '/Users/Will/Dropbox/forge/build.gradle' line: 20
* What went wrong:
Could not compile build file '/Users/Will/Dropbox/forge/build.gradle'.
> startup failed:
build file '/Users/Will/Dropbox/forge/build.gradle': 20: Invalid variable name. Must start with a letter but was: “1”
. At [20:11] @ line 20, column 11.
version = “1”
^
1 error
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 6.669 secs
Build.grade:
buildscript {
repositories {
mavenCentral()
maven {
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT'
}
}
apply plugin: 'forge'
version = “1”
group = “com.candymod.mincoder”
archivesBaseName = “Candymod”
minecraft {
version = "1.7.10-10.13.2.1230"
runDir = "eclipse"
}
dependencies {
// you may put jars on which you depend on in ./libs
// or you may define them like so..
//compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"
// real examples
//compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
//compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
}
processResources
{
// this will ensure that this task is redone when the versions change.
inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// replace stuff in mcmod.info, nothing else
from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info'
// replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version
}
// copy everything else, thats not the mcmod.info
from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info'
}
}
多謝您決定協助。
如果您使用的是Mac (我假設您是Mac的用戶) ,並且使用的是可怕的TextEdit程序,那么您需要進入設置並關閉“智能引號” 。 鍵入時,TextEdit中的“智能引號”功能會自動將常規引號"
替換為引號“
。
即
version = “1”
應該
version = "1"
細微的差別,但是就在那里。 無論在何處使用這些工具,都會遇到相同的問題,例如
group = “com.candymod.mincoder”
archivesBaseName = “Candymod”
長期解決方案
獲取面向代碼的編輯器,例如Sublime,以替換您對TextEdit的使用,TextEdit具有許多優點,包括導航和語法着色,使編碼更容易。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.