googlecodelabs / tensorflow-for-poets-2

Apache License 2.0
508 stars 463 forks source link

build gradle err! #112

Open OOOOOldZhu opened 5 years ago

OOOOOldZhu commented 5 years ago
sync failed 2 m 21 s 26 ms
Run build 2 m 20 s 764 ms
Load build 66 ms
Configure build 100 ms
allprojects  
null  
/Users/z/code/tensorflow-for-poets-2/android/tflite  
app/build.gradle  
Unable to resolve dependency for ':app@debug/compileClasspath': Could not download tensorflow-lite.aar (org.tensorflow:tensorflow-lite:1.12.0)  
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download tensorflow-lite.aar (org.tensorflow:tensorflow-lite:1.12.0)  
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not download tensorflow-lite.aar (org.tensorflow:tensorflow-lite:1.12.0)  
Unable to resolve dependency for ':app@release/compileClasspath': Could not download tensorflow-lite.aar (org.tensorflow:tensorflow-lite:1.12.0)  
Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not download tensorflow-lite.aar (org.tensorflow:tensorflow-lite:1.12.0)  

Unable to resolve dependency for ':app@debug/compileClasspath': Could not download tensorflow-lite.aar (org.tensorflow:tensorflow-lite:1.12.0) Open File Show Details

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not download tensorflow-lite.aar (org.tensorflow:tensorflow-lite:1.12.0) Open File Show Details

Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not download tensorflow-lite.aar (org.tensorflow:tensorflow-lite:1.12.0) Open File Show Details

Unable to resolve dependency for ':app@release/compileClasspath': Could not download tensorflow-lite.aar (org.tensorflow:tensorflow-lite:1.12.0) Open File Show Details

Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not download tensorflow-lite.aar (org.tensorflow:tensorflow-lite:1.12.0) Open File Show Details

OOOOOldZhu commented 5 years ago

1, my gradle version is 4.6 . in project.gradle : change`dependencies { classpath 'com.android.tools.build:gradle:3.0.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}`

to: `dependencies { classpath 'com.android.tools.build:gradle:3.2.1'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}`

2, delete <uses-sdk android:minSdkVersion="21" />this code line in manifest.xml 3, change compile to implementation in app.gradle(Module gradle)

philipwutw commented 5 years ago

Below is my solution. Environment: ubuntu 18.04 + android studio 3.3.1

  1. change dependencies { classpath 'com.android.tools.build:gradle:3.3.1 } in build.gradle(Project: tflite)
  2. delete <uses-sdk android:minSdkVersion="21" /> in manifest.xml
  3. change compile to implementation in build.gradle(Module:app)
  4. delete testCompile 'junit:junit:4.12' in build.gradle(Module:app)
  5. delete buildToolsVersion '27.0.3' in build.gradle(Module:app)
  6. delete androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) in build.gradle(Module:app)