2017-02-27 2 views
0

私はちょうど私のプロジェクトを終えて、それがうまく働いたが、私はそれにアンドロイドスタジオを通じてfirebaseアシスタントをFirebaseを統合することを決めたときにプロジェクトが同期していないと私はこれらのエラーを取得し、Iどうすればいいのか分からないようです。libGDXプロジェクトは

android { 
buildToolsVersion '23.0.3' 
compileSdkVersion 23 
defaultConfig { 

    minSdkVersion 9 
    targetSdkVersion 25 
    // Enabling multidex support. 
    multiDexEnabled true 
} 
dexOptions { 
    preDexLibraries = false 
    javaMaxHeapSize "4G" 

} 

sourceSets { 
    main { 
     manifest.srcFile 'AndroidManifest.xml' 
     java.srcDirs = ['src'] 
     aidl.srcDirs = ['src'] 
     renderscript.srcDirs = ['src'] 
     res.srcDirs = ['res'] 
     assets.srcDirs = ['assets'] 
     jniLibs.srcDirs = ['libs'] 
    } 

    instrumentTest.setRoot('tests') 
} 
}/* 
// needed to add JNI shared libraries to APK when compiling on CLI 
tasks.withType(com.android.build.gradle.tasks.PackageApplication) { pkgTask -> 
pkgTask.jniFolders = new HashSet<File>() 
pkgTask.jniFolders.add(new File(projectDir, 'libs')) 
}*/ 
// called every time gradle gets executed, takes the native dependencies of 
// the natives configuration, and extracts them to the proper libs/ folders 
// so they get packed with the APK. 
task copyAndroidNatives() { 
file("libs/armeabi/").mkdirs(); 
file("libs/armeabi-v7a/").mkdirs(); 
file("libs/x86/").mkdirs(); 

configurations.natives.files.each { jar -> 
    def outputDir = null 
    if (jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a") 
    if (jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi") 
    if (jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86") 
    if (outputDir != null) { 
     copy { 
      from zipTree(jar) 
      into outputDir 
      include "*.so" 
     } 
    } 
} 
} 
afterEvaluate { 
tasks.matching { 
    it.name.startsWith('dex') 
}.each { dx -> 
    if (dx.additionalParameters == null) { 
     dx.additionalParameters = ['--multi-dex'] 
    } else { 
     dx.additionalParameters += '--multi-dex' 
    } 
} 
} 

task run(type: Exec) { 
def path 
def localProperties = project.file("../local.properties") 
if (localProperties.exists()) { 
    Properties properties = new Properties() 
    localProperties.withInputStream { instr -> 
     properties.load(instr) 
    } 
    def sdkDir = properties.getProperty('sdk.dir') 
    if (sdkDir) { 
     path = sdkDir 
    } else { 
     path = "$System.env.ANDROID_HOME" 
    } 
} else { 
    path = "$System.env.ANDROID_HOME" 
} 

def adb = path + "/platform-tools/adb" 
commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.buzz.dodge/AndroidLauncher' 
} 
// sets up the Android Eclipse project, using the old Ant based build. 
eclipse { 
// need to specify Java source sets explicitely, SpringSource Gradle Eclipse plugin 
// ignores any nodes added in classpath.file.withXml 
sourceSets { 
    main { 
     java.srcDirs "src", 'gen' 
    } 
} 


classpath { 
    plusConfigurations += [project.configurations.compile] 
    containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES' 
} 

project { 
    name = appName + "-android" 
    natures 'com.android.ide.eclipse.adt.AndroidNature' 
    buildCommands.clear(); 
    buildCommand "com.android.ide.eclipse.adt.ResourceManagerBuilder" 
    buildCommand "com.android.ide.eclipse.adt.PreCompilerBuilder" 
    buildCommand "org.eclipse.jdt.core.javabuilder" 
    buildCommand "com.android.ide.eclipse.adt.ApkBuilder" 
} 
} 
// sets up the Android Idea project, using the old Ant based build. 
idea { 
module { 
    sourceDirs += file("src"); 
    scopes = [COMPILE: [plus: [project.configurations.compile]]] 

    iml { 
     withXml { 
      def node = it.asNode() 
      def builder = NodeBuilder.newInstance(); 
      builder.current = node; 
      builder.component(name: "FacetManager") { 
       facet(type: "android", name: "Android") { 
        configuration { 
         option(name: "UPDATE_PROPERTY_FILES", value: "true") 
        } 
       } 
      } 
     } 
    } 
} 
} 
dependencies { 
compile 'com.google.android.gms:play-services-analytics:10.0.1' 
compile 'com.android.support:multidex:1.0.1' 
compile 'com.google.firebase:firebase-messaging:10.0.1' 
compile 'com.google.firebase:firebase-core:10.0.1' 
} 

apply plugin: 'com.google.gms.google-services' 

BaseGameUtilsが

apply plugin: 'com.android.library' 

repositories { 
mavenCentral() 
} 

buildscript { 
repositories { 
    mavenCentral() 
    } 

dependencies { 
    classpath 'com.android.tools.build:gradle:2.2.2' 

    } 
} 

dependencies { 
compile 'com.android.support:appcompat-v7:23.4.0' 
compile 'com.android.support:support-v4:23.4.0' 
compile "com.google.android.gms:play-services-games:10.0.1" 
compile "com.google.android.gms:play-services-plus:10.0.1" 
compile 'com.android.support:multidex:1.0.1' 
} 
afterEvaluate { 
tasks.matching { 
    it.name.startsWith('dex') 
}.each { dx -> 
    if (dx.additionalParameters == null) { 
     dx.additionalParameters = ['--multi-dex'] 
    } else { 
     dx.additionalParameters += '--multi-dex' 
    } 
} 
} 

android { 
compileSdkVersion 23 
buildToolsVersion '23.0.3' 
defaultConfig { 

    minSdkVersion 9 
    targetSdkVersion 22 
    // Enabling multidex support. 
    multiDexEnabled true 
} 
dexOptions { 
    preDexLibraries = false 
    javaMaxHeapSize "4G" 
} 
} 

をbuild.gradle

**ERROR'S** 
Error:(23, 34) error: package com.google.android.gms.ads does not exist 
Error:(24, 34) error: package com.google.android.gms.ads does not exist 
Error:(25, 34) error: package com.google.android.gms.ads does not exist 
Error:(26, 34) error: package com.google.android.gms.ads does not exist 
Error:(27, 34) error: package com.google.android.gms.ads does not exist 
Error:(56, 15) error: cannot find symbol class AdView 
Error:(58, 5) error: cannot find symbol class AdView 
Error:(59, 13) error: cannot find symbol class InterstitialAd 
Error:(343, 13) error: cannot find symbol class AdView 
Error:(373, 35) error: cannot find symbol class AdView 
Error:(129, 30) error: cannot find symbol class InterstitialAd 
Error:(131, 42) error: cannot find symbol class AdListener 
Error:(344, 22) error: cannot find symbol class AdView 
Error:(345, 26) error: cannot find symbol variable AdSize 
Error:(374, 9) error: cannot find symbol class AdRequest 
Error:(374, 44) error: package AdRequest does not exist 
Error:(425, 29) error: cannot find symbol class AdRequest 
Error:(425, 74) error: package AdRequest does not exist 
Error:Execution failed for task ':android:compileDebugJavaWithJavac'. 

Compilation failed; see the compiler error output for details.

事前にアンドロイドのGradleを私は、Web上のすべての可能な答えを試してみましたが、何も感謝を動いていないようにみえ構築かわします。 Gradleの

buildscript { 
repositories { 
    mavenCentral() 
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 
} 
dependencies { 
    classpath 'com.android.tools.build:gradle:2.2.2' 
    classpath 'com.google.gms:google-services:3.0.0' 
} 
} 

allprojects { 
apply plugin: "eclipse" 
apply plugin: "idea" 

version = '1.0' 
ext { 
    appName = 'Smove' 
    gdxVersion = '1.5.6' 
    roboVMVersion = '1.0.0' 
    box2DLightsVersion = '1.3' 
    ashleyVersion = '1.3.1' 
    aiVersion = '1.5.0' 
} 

repositories { 
    mavenCentral() 
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 
    maven { url "https://oss.sonatype.org/content/repositories/releases/" } 
} 
} 

project(":desktop") { 
apply plugin: "java" 


dependencies { 
    compile project(":core") 
    compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion" 
    compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" 

} 
    } 

project(":core")  { 
apply plugin: "java" 


dependencies { 
    compile "com.badlogicgames.gdx:gdx:$gdxVersion" 
    compile fileTree(dir: '../libs', include: '*.jar') 
} 
} 

project(":android") { 
apply plugin: "android" 

configurations { natives } 

dependencies { 
    compile project(":core") 
    compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion" 
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi" 
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a" 
    natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" 
    compile project(":BaseGameUtils") 
    compile fileTree(dir: '../libs', include: '*.jar') 
} 
} 

tasks.eclipse.doLast { 
delete ".project" 
} 
0エラーは簡単です、あなたは 9.0.0

の最小値を必要とする

+0

コメントは、拡張された議論のためではありません。この会話は[チャットに移動]されています(http://chat.stackoverflow.com/rooms/136826/discussion-on-question-by-l-kohli-libgdx-project-not-building-after-adding-fireb) 。 –

答えて

0

Version: 7.8.0 is lower than the minimum version (9.0.0) required

何AppState マネージャー

そして、あなたはこれをコンパイルする場合がありAppStateはありませんが、latest versions here

Error:(32, 39) error: package com.google.android.gms.appstate does not exist
Error:(293, 28) error: cannot find symbol variable AppStateManager
Error:(294, 30) error: cannot find symbol variable AppStateManager

を参照してください。

compile "com.google.android.gms:play-services-games:10.0.1" 

パッケージがないこと、実際には、存在します。

com.google.android.gms.appstate

あなたがそのリンクを開く場合は、AppStateManagerが全く存在しません。だから、古いかAppStateManagerのいずれかのコードをコピーして使用したと思います。あなたが他の場所からインクルードできなかったクラスです。


とき

compile "com.google.android.gms:play-services-ads:10.0.1" 

com.google.android.gms.ads


同様に、このパッケージには、我々がGoogle games Github samplesに表示された場合、このコメントは私の答えを確認して存在しています。

Appstate API is gone after 7.8

+0

import com.google.android.gms.appstate.AppStateManagerを削除しました。しかし、今ではより多くのエラーが発生していますl –

+0

あなたが使用しているクラスを含まないGooglePlayServicesのバージョンが必要なため、あなたが求めている方法でFirebaseを含めることはできません。 Firebase Javascript APIを使用してWebサーバーを設定することもできます。それに対してREST要求を実行します。 –

+0

firebaseの解析機能を使いたいだけです。 –

0

compile 'com.google.android.gms:play-services-ads:10.0.1'をあなたのandroid build.gradleファイルに依存するものとして追加します。あなたは、私は同じエラーを取得火災ベースを追加しようとした場合、私は同じ問題を抱えています

+0

もう一度ご迷惑をおかけして申し訳ありませんが、私はFirebaseAnalyticsオブジェクトを自分のアクティビティの先頭に宣言し、onCreate()メソッドで初期化してコンパイルしましたが、今はこれらのエラーが表示されますエラー:(85,30) find symbol変数FirebaseAnalyticsエラー:(63,13)エラー:シンボルクラスFirebaseAnalyticsを見つけることができません –

+0

FirebaseAnalyticsはcom.google.firebase:firebase-coreライブラリにあり、既に追加しています – Aryan

+0

FirebaseAnalyticsオブジェクトを初期化する方法は? – Aryan

0

は、BasicGamesUtilは「8.4.0」に対してコンパイルされます。残念ながらFire Baseを追加できず、古いPlay Service Analyticsを使用しています。 Base Game Utilsは新しいPlayサービスに対してコンパイルすることはなく、コンパイルするためのあらゆる種類の方法を試しました。自分のような欠けているアイテムを手に入れます。

関連する問題