简体   繁体   English

无法使用Google-Cloud-Storage客户端库运行空的AndroidStudio 0.8.14项目

[英]Can not run empty AndroidStudio 0.8.14 project with google-cloud-storage client library

I am creating a simple Android app that would take a picture and upload it to Google cloud storage. 我正在创建一个简单的Android应用程序,该应用程序将拍照并将其上传到Google云存储。 The simplest (and recommended) way is to use the provided client library . 最简单(也是推荐的方法)是使用提供的客户端库

But even the empty AndroidStudio with dependency to gcs fails to run. 但是,即使依赖于gcs的空AndroidStudio也无法运行。 It compiles, but fails to run with the failures: 它可以编译,但无法运行并显示以下错误:

  1. WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android. 警告:依赖项org.apache.httpcomponents:httpclient:4.0.1在调试时将被忽略,因为它可能与Android提供的内部版本冲突。 In case of problem, please repackage it with jarjar to change the class packages. 如有问题,请用jarjar重新打包以更改类包。

  2. Error:Execution failed for task ':app:preDexDebug'. 错误:任务':app:preDexDebug'的执行失败。

    com.android.ide.common.internal.LoggedErrorException: com.android.ide.common.internal.LoggedErrorException:

    Failed to run command: /home/milan/AndroidStudioSdk/sdk/build-tools/21.1.1/dx --dex --output /home/milan/AndroidStudioProjects/Test/app/build/intermediates/pre-dexed/debug/transaction-api-1.1-d542431644c5559f18a80700bbbf3a2bc4472ff7.jar /home/milan/.gradle/caches/modules-2/files-2.1/javax.transaction/transaction-api/1.1/2ca09f0b36ca7d71b762e14ea2ff09d5eac57558/transaction-api-1.1.jar 无法运行命令:/home/milan/AndroidStudioSdk/sdk/build-tools/21.1.1/dx --dex --output / home / milan / AndroidStudioProjects / Test / app / build / intermediates / pre-dexed / debug / transaction-api-1.1-d542431644c5559f18a80700bbbf3a2bc4472ff7.jar /home/milan/.gradle/caches/modules-2/files-2.1/javax.transaction/transaction-api/1.1/2ca09f0b36ca7d71b762e14ea2ff09d5eac57558/jaraction-api

    Error Code: 1 错误代码:1

    Output: trouble processing "javax/transaction/HeuristicCommitException.class": Ill-advised or mistaken usage of a core class (java.* or javax.*) when not building a core library........... 输出:无法处理“ javax / transaction / HeuristicCommitException.class”:在不构建核心库时对核心类(java。*或javax。*)的不良使用或错误使用。

I am using AndroidStudio 0.8.14 on Kubuntu 14.10 with java-7-jdk-oracle (1.7.0_72-b14). 我正在使用Java-7-jdk-oracle(1.7.0_72-b14)在Kubuntu 14.10上使用AndroidStudio 0.8.14。

I have read and tried everything from stackoverflow / web I could find: invalidating cache, cleaning up the project, compile the library from sources, even reinstall of the OS. 我已经阅读并尝试了stackoverflow / web上的所有内容:使缓存无效,清理项目,从源代码编译库,甚至重新安装OS。 Nothing worked so far. 到目前为止没有任何工作。 preDex failed in all cases. preDex在所有情况下均失败。

build.gradle: 的build.gradle:

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.1"
    defaultConfig {
        minSdkVersion 15
        targetSdkVersion 21
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.appengine.tools:appengine-gcs-client:0.4.3'
}

Is there anyone who can create default AndroidStudio 0.8.14 project with project dependency to google cloud services and is able to RUN the application? 有没有人可以创建默认的AndroidStudio 0.8.14项目,该项目具有对Google云服务的项目依赖关系并能够运行该应用程序? Your build.gradle would help a lot. 您的build.gradle将有很大帮助。 I am probably missing something obvious. 我可能缺少明显的东西。

The library you are using is intended to be used as a client on Google App Engine, not on Android. 您正在使用的库旨在用作Google App Engine上的客户端,而不是Android上的客户端。

Take a look at this page for the Java client library for Google Cloud Storage: https://developers.google.com/api-client-library/java/apis/storage/v1 在此页面上查看Google Cloud Storage的Java客户端库: https : //developers.google.com/api-client-library/java/apis/storage/v1

The dependency you need is: 您需要的依赖项是:

compile 'com.google.apis:google-api-services-storage:v1-rev22-1.19.0'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Apache Beam项目中直接使用google-cloud-storage - How to use google-cloud-storage directly in a Apache Beam project IntelliJ无法找到google-cloud-storage类 - IntelliJ can't find google-cloud-storage classes 带有Gradle的Google云端存储Java客户端库 - Google Cloud Storage Java Client Library with Gradle Java/Spring 使用 Google Cloud firebase-admin 与 google-cloud-storage 冲突 - Java/Spring using Google Cloud firebase-admin conflicts with google-cloud-storage 无法使用GCS客户端库+ java将文件从GAE项目上传到Google云存储 - Not able to upload files from GAE project to Google cloud Storage using GCS Client library+java 通过appengine上传到google-cloud-storage时如何向文件添加元数据 - how to add metadata to file when uploading to google-cloud-storage via appengine 如何获取存储在google-cloud-storage桶的子目录中的图像的URL - How do I get the URL for an image stored in a subdirectory of a google-cloud-storage bucket Java `https.proxyHost` 和 `https.proxyPort` 在使用 google-cloud-storage 时成功然后失败 - Java `https.proxyHost` and `https.proxyPort` succeed then fail when using google-cloud-storage 使用Java的Google Cloud Storage客户端库检索特定文件的ACL - Retrieve ACL of specific file with Google Cloud Storage Client Library for Java 使用Java客户端库创建Google Cloud Storage存储桶 - Create a Google Cloud Storage bucket with the Java client library
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM