2017-09-22 1 views
1

Ok, ceci est une erreur bizarre:console Gradle dit Créer succesful, mais avec des erreurs, et l'application ne fonctionne pas

  • L'application fonctionnait très bien il y a un mois, je avais besoin d'introduire une solution aujourd'hui et ne fonctionnait pas. Entre les deux la seule différence que je peux penser est quelques mises à jour Android Studio. Mais d'autres applications fonctionnent encore parfaitement.
  • L'application peut nettoyer projet, Reconstruire le projet et Generate Signé APK, sans erreur
  • Le problème vient quand je tente d'exécuter ou déboguer l'application sur l'émulateur
    • console gradle complet et build.gradle au bas du poteau
    • je n'obtenir un « choisissez dispositif pour lancer » la fenêtre, il arrête avant
    • Construire dit CONSTRUIRE ADAPTEE a, mais dit aussi 682 erreurs
    • dans Gradle Console, il imprime un arbre de dépendances en ASCII
  • Une autre chose: l'APK généré peut être installé sur l'émulateur et fonctionne à la perfection

Quelqu'un at-il rencontré une telle erreur?

Merci d'avance!

build.gradle

buildscript { 
    repositories { 
     maven { url 'https://maven.fabric.io/public' } 
    } 

    dependencies { 
     classpath 'io.fabric.tools:gradle:1.+' 
    } 
} 
apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 

repositories { 
    maven { url 'https://maven.fabric.io/public' } 
} 


android { 
    compileSdkVersion 25 
    buildToolsVersion '25.0.2' 

    defaultConfig { 
     applicationId "uy.com.hermes.tugentman.stecnico" 
     minSdkVersion 17 
     targetSdkVersion 21 
     versionCode 1007 
     versionName "v1.0.07" 
     setProperty("archivesBaseName", "Hermes_Tugentman_STecnico_7inch_$versionCode") 
    } 
    buildTypes { 
     release { 
      shrinkResources true 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    applicationVariants.all { variant -> 
     variant.resValue "string", "app_ver", variant.versionName 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support:design:25.3.1' 
    compile files('libs/mapquest-android-sdk-1.0.5.jar') 
    compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
     transitive = true; 
    } 
    compile('com.mapbox.mapboxsdk:mapbox-android-sdk:[email protected]') { 
     transitive = true; 
    } 
    compile('io.fabric.sdk.android:fabric:[email protected]') { 
     transitive = true; 
    } 
} 

Gradle Console

Executing tasks: [androidDependencies] 

Configuration on demand is an incubating feature. 
Incremental java compilation is an incubating feature. 
:app:androidDependencies 
debug 
+--- com.android.support:appcompat-v7:[email protected] 
| +--- com.android.support:support-annotations:[email protected] 
| +--- com.android.support:support-v4:[email protected] 
| | +--- com.android.support:support-compat:[email protected] 
| | | \--- com.android.support:support-annotations:[email protected] 
| | +--- com.android.support:support-media-compat:[email protected] 
| | | +--- com.android.support:support-annotations:[email protected] 
| | | \--- com.android.support:support-compat:[email protected] 
| | |   \--- com.android.support:support-annotations:[email protected] 
| | +--- com.android.support:support-core-utils:[email protected] 
| | | +--- com.android.support:support-annotations:[email protected] 
... lines removed to fit SO post limit, they are all in this format, full file can be made available if someone need to see it ... 
| |   \--- com.android.support:support-core-utils:[email protected] 
| |    +--- com.android.support:support-annotations:[email protected] 
| |    \--- com.android.support:support-compat:[email protected] 
| |     \--- com.android.support:support-annotations:[email protected] 
| \--- com.squareup.okhttp3:okhttp:[email protected] 
|   \--- com.squareup.okio:okio:[email protected] 
+--- io.fabric.sdk.android:fabric:[email protected] 
+--- __local_jars__:F:\Dropbox\Workspaces\AndroidStudio\Tugentman_STecnico_v1\app\libs\mapquest-android-sdk-1.0.5.jar:[email protected] 
\--- __local_jars__:F:\Dropbox\Workspaces\AndroidStudio\Tugentman_STecnico_v1\app\libs\mapquest-android-sdk-1.0.5.jar:[email protected] 

debugAndroidTest 
No dependencies 

debugUnitTest 
No dependencies 

release 
+--- com.android.support:appcompat-v7:[email protected] 
| +--- com.android.support:support-annotations:[email protected] 
| +--- com.android.support:support-v4:[email protected] 
| | +--- com.android.support:support-compat:[email protected] 
| | | \--- com.android.support:support-annotations:[email protected] 
| | +--- com.android.support:support-media-compat:[email protected] 
| | | +--- com.android.support:support-annotations:[email protected] 
| | | \--- com.android.support:support-compat:[email protected] 
| | |   \--- com.android.support:support-annotations:[email protected] 
| | +--- com.android.support:support-core-utils:[email protected] 
| | | +--- com.android.support:support-annotations:[email protected] 
| | | \--- com.android.support:support-compat:[email protected] 
| | |   \--- com.android.support:support-annotations:[email protected] 
| | +--- com.android.support:support-core-ui:[email protected] 
| | | +--- com.android.support:support-annotations:[email protected] 
| | | \--- com.android.support:support-compat:[email protected] 
| | |   \--- com.android.support:support-annotations:[email protected] 
| | \--- com.android.support:support-fragment:[email protected] 
| |   +--- com.android.support:support-compat:[email protected] 
... lines removed to fit SO post limit, they are all in this format, full file can be made available if someone need to see it ... 
| |   +--- com.android.support:support-core-ui:[email protected] 
| |   | +--- com.android.support:support-annotations:[email protected] 
| |   | \--- com.android.support:support-compat:[email protected] 
| |   |   \--- com.android.support:support-annotations:[email protected] 
| |   \--- com.android.support:support-core-utils:[email protected] 
| |    +--- com.android.support:support-annotations:[email protected] 
| |    \--- com.android.support:support-compat:[email protected] 
| |     \--- com.android.support:support-annotations:[email protected] 
| \--- com.squareup.okhttp3:okhttp:[email protected] 
|   \--- com.squareup.okio:okio:[email protected] 
+--- io.fabric.sdk.android:fabric:[email protected] 
+--- __local_jars__:F:\Dropbox\Workspaces\AndroidStudio\Tugentman_STecnico_v1\app\libs\mapquest-android-sdk-1.0.5.jar:[email protected] 
\--- __local_jars__:F:\Dropbox\Workspaces\AndroidStudio\Tugentman_STecnico_v1\app\libs\mapquest-android-sdk-1.0.5.jar:[email protected] 

releaseUnitTest 
No dependencies 

BUILD SUCCESSFUL 

Total time: 0.466 secs 
+1

Aller à 'Affichage> Outil de Windows> Terminal' et tapez' gradlew construire ». Vous devriez pouvoir voir toute la sortie pendant la construction inclure les messages d'erreur. – Joshua

+0

Merci Joshua! Ce sont les dernières lignes de sortie. Je n'ai rien changé à Java, et d'autres projets ont la même définition Java. Échec: Échec de la génération avec une exception. * Problème: L'exécution a échoué pour la tâche ': app: compileDebugJavaWithJavac'. > Impossible de trouver tools.jar. Vérifiez que C: \ Program Files \ Java \ JRE8 contient une installation JDK valide. * Essayez: Exécutez avec l'option --stacktrace pour obtenir la trace de la pile. Exécutez avec l'option --info ou --debug pour obtenir plus de sortie de journal. –

+1

Google l'erreur. Il semble qu'il a déjà été répondu sur Stackoverflow. – Joshua

Répondre

1

Essayez ce code

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

Merci Ramesh, mais le même résultat ... –