2016-12-19 15 views
0

Netbeans 8からapkを生成しようとしましたが、例外が発生しています。私はすでにインストールされているGluonを使用してAPKファイルを作成できません

buildscript { 
    repositories { 
     maven { 
      url 'https://oss.sonatype.org/content/repositories/snapshots' 
     } 
     jcenter() 
    } 
    dependencies { 
     classpath 'org.javafxports:jfxmobile-plugin:1.3.0-SNAPSHOT' 
    } 
} 

apply plugin: 'org.javafxports.jfxmobile' 

repositories { 
    jcenter() 
    maven { 
     url 'http://nexus.gluonhq.com/nexus/content/repositories/releases' 
    } 
} 

mainClassName = 'com.testgluon.TestGluonMob' 

dependencies { 
    compile 'com.gluonhq:charm:4.2.0' 

    } 

jfxmobile { 
    android { 
     manifest = 'src/android/AndroidManifest.xml' 
     compileSdkVersion = '25' 


    } 
} 

multidex-1.0.1.aar

が、私はこのanswerが、運を見ていない は、ここに私のGradleファイルの内容です。それは私を助けません。

編集:

:applyRetrolambda (Thread[Daemon worker Thread 3,5,main]) completed. Took 21.933 secs. 
:mergeClassesIntoJar (Thread[Daemon worker Thread 3,5,main]) started. 
:mergeClassesIntoJar 
Putting task artifact state for task ':mergeClassesIntoJar' into context took 0.001 secs. 
Task :mergeClassesIntoJar class loader hash: 83f3637f6805a7b149525a93c5faad58 
Task :mergeClassesIntoJar actions class loader hash: fde60ab3b9776111ebd9bf87f24df716 
Executing task ':mergeClassesIntoJar' (up-to-date check took 0.172 secs) due to: 
    Output property 'archivePath' file P:\javafxGluon\TestGluonMob\build\javafxports\tmp\android\multi-dex\allclasses.jar has changed. 
:mergeClassesIntoJar (Thread[Daemon worker Thread 3,5,main]) completed. Took 3.91 secs. 
:shrinkMultiDexComponents (Thread[Daemon worker Thread 3,5,main]) started. 
:shrinkMultiDexComponents 
Putting task artifact state for task ':shrinkMultiDexComponents' into context took 0.033 secs. 
Task :shrinkMultiDexComponents class loader hash: c54ece983c65e20d963e3e8bb57cfcb0 
Task :shrinkMultiDexComponents actions class loader hash: b6f3644e00f5f8abdc2639cc044bf52b 
Executing task ':shrinkMultiDexComponents' (up-to-date check took 0.061 secs) due to: 
    Output property 'outJarFileCollection' file P:\javafxGluon\TestGluonMob\build\javafxports\tmp\android\multi-dex\componentClasses.jar has changed. 
ProGuard, version 5.1 
Reading program jar [P:\javafxGluon\TestGluonMob\build\javafxports\tmp\android\multi-dex\allclasses.jar] 
Reading library jar [C:\Program Files\Android\android-sdk\build-tools\25.0.1\lib\shrinkedAndroid.jar] 
Preparing output jar [P:\javafxGluon\TestGluonMob\build\javafxports\tmp\android\multi-dex\componentClasses.jar] 
    Copying resources from program jar [P:\javafxGluon\TestGluonMob\build\javafxports\tmp\android\multi-dex\allclasses.jar] 
:shrinkMultiDexComponents (Thread[Daemon worker Thread 3,5,main]) completed. Took 7.079 secs. 
:createMainDexList (Thread[Daemon worker Thread 3,5,main]) started. 
:createMainDexList 
Putting task artifact state for task ':createMainDexList' into context took 0.03 secs. 
Task :createMainDexList class loader hash: c54ece983c65e20d963e3e8bb57cfcb0 
Task :createMainDexList actions class loader hash: b6f3644e00f5f8abdc2639cc044bf52b 
Executing task ':createMainDexList' (up-to-date check took 0.005 secs) due to: 
    Output property 'outputFile' file P:\javafxGluon\TestGluonMob\build\javafxports\tmp\android\multi-dex\maindexlist.txt has changed. 
:createMainDexList (Thread[Daemon worker Thread 3,5,main]) completed. Took 3.276 secs. 
:writeInputListFile (Thread[Daemon worker Thread 3,5,main]) started. 
:writeInputListFile 
Putting task artifact state for task ':writeInputListFile' into context took 0.029 secs. 
Task :writeInputListFile class loader hash: c54ece983c65e20d963e3e8bb57cfcb0 
Task :writeInputListFile actions class loader hash: b6f3644e00f5f8abdc2639cc044bf52b 
Executing task ':writeInputListFile' (up-to-date check took 0.034 secs) due to: 
    Output property 'inputListFile' file P:\javafxGluon\TestGluonMob\build\javafxports\tmp\android\dex\inputList.txt has changed. 
:writeInputListFile (Thread[Daemon worker Thread 3,5,main]) completed. Took 0.108 secs. 
:dex (Thread[Daemon worker Thread 3,5,main]) started. 
:dex 
Putting task artifact state for task ':dex' into context took 0.034 secs. 
Task :dex class loader hash: c54ece983c65e20d963e3e8bb57cfcb0 
Task :dex actions class loader hash: b6f3644e00f5f8abdc2639cc044bf52b 
Executing task ':dex' (up-to-date check took 0.002 secs) due to: 
    No history is available. 
[ant:java] Java Result: 1 
:dex FAILED 
:dex (Thread[Daemon worker Thread 3,5,main]) completed. Took 0.246 secs. 

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':dex'. 
> org.gradle.api.GradleException (no error message) 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. 

BUILD FAILED 

注:

私は必要としない25.私は使用することができます次は(Netbeansのから--infoオプションを使用して)スタックトレースの一部です。古いバージョン。 私はcompileSdkVersion = '25'を削除すると、私はこの例外を取得:gradle -v cammandをrunnig

Executing: gradle :android 
Arguments: [--info] 

The client will now receive all logging from the daemon (pid: 5056). The daemon log file: C:\Users\user\.gradle\daemon\3.2.1\daemon-5056.out.log 
Starting 14th build in daemon [uptime: 1 hrs 0 mins 21.185 secs, performance: 100%, no major garbage collections] 
Executing build with daemon context: DefaultDaemonContext[uid=42b5a162-e19a-4659-8796-8ca0d6e5684c,javaHome=C:\Program Files\Java\jdk1.8.0_60,daemonRegistryDir=C:\Users\user\.gradle\daemon,pid=5056,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=windows-1252,-Duser.country=FR,-Duser.language=fr,-Duser.variant] 
Starting Build 
Settings evaluated using settings file 'P:\master\settings.gradle'. 
Projects loaded. Root project using build file 'P:\javafxGluon\TestGluonMob\build.gradle'. 
Included projects: [root project 'TestGluonMob'] 
Evaluating root project 'TestGluonMob' using build file 'P:\javafxGluon\TestGluonMob\build.gradle'. 
Android install directory: P:\javafxGluon\TestGluonMob\build\javafxports\android 
Android temporary output directory: P:\javafxGluon\TestGluonMob\build\javafxports\tmp\android 
Resources directory: P:\javafxGluon\TestGluonMob\build\javafxports\tmp\android\resources 
Multi-dex output directory: P:\javafxGluon\TestGluonMob\build\javafxports\tmp\android\multi-dex 
Dex output directory: P:\javafxGluon\TestGluonMob\build\javafxports\tmp\android\dex 
iOS install directory: P:\javafxGluon\TestGluonMob\build\javafxports\ios 
iOS temporary output directory: P:\javafxGluon\TestGluonMob\build\javafxports\tmp\ios 
Adding C:\Program Files\Android\android-sdk\extras\android\m2repository to project repositories. 
Adding C:\Program Files\Android\android-sdk\extras\google\m2repository to project repositories. 
All projects evaluated. 
Selected primary task ':android' from project : 
Tasks to be executed: [task ':validateManifest', task ':collectMultiDexComponents', task ':compileJava', task ':processResources', task ':classes', task ':compileAndroidJava', task ':copyClassesForRetrolambda', task ':applyRetrolambda', task ':mergeClassesIntoJar', task ':shrinkMultiDexComponents', task ':createMainDexList', task ':writeInputListFile', task ':dex', task ':mergeAndroidAssets', task ':mergeAndroidResources', task ':processAndroidResources', task ':processAndroidResourcesDebug', task ':validateSigningDebug', task ':apkDebug', task ':zipalignDebug', task ':android'] 
Using javafxports version 8.60.8 
Configuring Build for Android 
Using javafxports dalvik sdk from location C:\Users\user\.gradle\caches\modules-2\files-2.1\org.javafxports\dalvik-sdk\8.60.8\6630ec66e4703c910ac3fd6151a8494c8b59186b\unpacked\dalvik-sdk 
Using androidSdk from location: C:\Program Files\Android\android-sdk 
There was no buildToolsVersion specified, looking for most recent installed version automatically 
Using the following automatically detected buildToolsVersion: 25.0.1 

FAILURE: Build failed with an exception. 

* What went wrong: 
Configured compileSdkVersion is invalid: 21 (C:\Program Files\Android\android-sdk/platforms/android-21 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. 

BUILD FAILED 

は私を与える:

------------------------------------------------------------ 
Gradle 3.2.1 
------------------------------------------------------------ 

Build time: 2016-11-22 15:19:54 UTC 
Revision:  83b485b914fd4f335ad0e66af9d14aad458d2cc5 

Groovy:  2.4.7 
Ant:   Apache Ant(TM) version 1.9.6 compiled on June 29 2015 
JVM:   1.8.0_60 (Oracle Corporation 25.60-b23) 
OS:   Windows Vista 6.0 x86 

下記のリンクは既にインストールされているAndroidのSDKツールを示しています。 Android SDK tools installed

+0

Charmを4.2.0にアップデートし、 'gralew.bat clean build android --info'を実行してプロジェクトルートからコマンドラインから試してみてください。 'gradlew'を使用すると、おそらくより新しいgradle版が使用されます。 –

+0

以下の例外が発生しました: 'Executing task ':dex'(最新のチェックには0.005秒かかりました): 履歴がありません。 [ant:java] Javaの結果:1 :dex FAILED :dex(Thread [main、5、main])が完了しました。 0.152秒かかりました。 FAILURE:例外が発生してビルドに失敗しました。 ' – user7233170

+0

今は別のエラーが発生しているようです。質問を編集してスタックトレースを投稿できるので、失敗した場所を確認できますか?あなたはまた、SDの下位バージョンを試すことができますか?厳密に25を要求していますか? –

答えて

0
jfxmobile { 
downConfig { 
    version = '3.0.0' 
    plugins 'display', 'lifecycle', 'statusbar', 'storage' 
} 
android { 
    manifest = 'src/android/AndroidManifest.xml' 
    compileSdkVersion=25 
    buildToolsVersion = '25.0.0' 
    androidSdk='/Users/USERNAME/Library/Android/sdk' 
} 
ios { 
    infoPList = file('src/ios/Default-Info.plist') 
    forceLinkClasses = [ 
      'com.gluonapplication.**.*', 
      'com.gluonhq.**.*', 
      'javax.annotations.**.*', 
      'javax.inject.**.*', 
      'javax.json.**.*', 
      'org.glassfish.json.**.*' 
    ] 

} 

上のコードに示すようにあなたのアンドロイドSDKのパスを設定します。あなたがアンドロイドSDKを持っていない場合、あなたは(罰金です)あなたはアンドロイドスタジオをダウンロードします。この場合には、ここで

https://developer.android.com/studio/index.html

からダウンロードすることができます。それをダウンロードし、必要なバージョンのSDKをインストールします。

関連する問題