2017-06-27 2 views
0

これはおそらくnoobの質問ですが、答えはインターネットやtheresの直接の答えで見つけることは容易ではありません。LibGdXプロジェクトのアンドロイドターゲット文字列はどこですか?

android-19をターゲットとする古いLibGdxプロジェクトを使用しようとしています。 アンドロイド25以上をターゲットにしたい。 しかし、私はそれらの文字列をどこで変更するかを見つけることができませんでした。 build.gradleで検索しましたが、何も見つかりませんでした。だから、今必要な助け。

私は、全体のAndroid/build.gradleを添付しています:

android { 
    buildToolsVersion project.androidToolsVersion 
    compileSdkVersion project.androidSDKVersion.toInteger() 
    sourceSets { 
     main { 
      manifest.srcFile 'AndroidManifest.xml' 
      java.srcDirs = ['src'] 
      resources.srcDirs = ['src'] 
      aidl.srcDirs = ['src'] 
      renderscript.srcDirs = ['src'] 
      res.srcDirs = ['res'] 
      assets.srcDirs = ['assets'] 
      jniLibs.srcDirs = ['libs'] 
     } 

     instrumentTest.setRoot('tests') 
    } 
} 

// 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" 
      } 
     } 
    } 
} 

task run(type: Exec) { 
    def adb = "$System.env.ANDROID_HOME/platform-tools/adb" 
    commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.badlogicgames.superjumper.android/com.badlogicgames.superjumper.android.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' 
     } 
    } 

    jdt { 
     sourceCompatibility = 1.6 
     targetCompatibility = 1.6 
    } 

    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") 
         } 
        } 
       } 
      } 
     } 
    } 
} 

答えて

0

は、Android/build.gradleに

を見てみましょう更新

それを試してみてください。

android { 
    buildToolsVersion project.androidToolsVersion 
    compileSdkVersion project.androidSDKVersion.toInteger() 
    sourceSets { 
     main { 
      manifest.srcFile 'AndroidManifest.xml' 
      java.srcDirs = ['src'] 
      resources.srcDirs = ['src'] 
      aidl.srcDirs = ['src'] 
      renderscript.srcDirs = ['src'] 
      res.srcDirs = ['res'] 
      assets.srcDirs = ['assets'] 
      jniLibs.srcDirs = ['libs'] 
     } 

     instrumentTest.setRoot('tests') 
    } 

    defaultConfig { 
     applicationId "com.companie.project" // I don't know if it's really usefull in your case 
     minSdkVersion 8 
     targetSdkVersion 25 
    } 
} 
+0

ビルド/グラデルファイルコード全体を添付すると以下のようになります。 – Rifat

+0

通常、ルートにbuild.gradleがあり、各plateformフォルダにbuild.grableがあります。 'targetSdkVersion'を見つけるには、Androidフォルダに移動して、内部にあるbuild.gradleを開きます。 –

+0

アンドロイド用のgradleファイルのコードを更新しました。 – Rifat

0

の中にdefaultConfigを見つけるタグ内のタグbuild.gradleアンドロイドモジュール。

defaultConfig { 
    applicationId "com.its.mygame" 
    minSdkVersion 11 
    targetSdkVersion 23    // This is what you want, change here 
    ... 
} 

もし存在しなければ、あなたのアンドロイドモジュールのAndoidManifest.xmlファイルを開きます。

<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="23" /> //change here 

何の両方の場所に存在する場合?

AndroidManifest.xmlの設定は、defaultConfig build.gradleの設定より優先されます。

関連する問題