2016-04-06 18 views
0

私たちはAndroidに移植し、J2objcとprotobufを使っています。これまでのところ、私たちは問題を解決するために取り組んでいます(私たちはAndroidには新しく、その多くは学習曲線によるものです)。J2Ojbcネイティブコンパイルグーバヘッダーがありません

この特定の問題は、j2objc-1.0-2.2の最新バージョンのバグのようです。翻訳された目的の実装クラスの#includeは、ラクダのケースに変更されていません。誰もこの行動を見たことがありますか?これはバグか何かが欠けているのでしょうか?

ありがとうございました。ここで

は、コンパイル・エラーである:ここで

GcatMobile/shared/build/j2objcSrcGenMain/com/gcatconsult/shared/remote/NetworkBase.m:14:10: fatal error: 
'com/google/common/io/BaseEncoding.h' file not found 

#include "com/google/common/io/BaseEncoding.h" 

はNetworkBase.m、私の翻訳実装クラス内の#includeです:

:ここ

#include "IOSClass.h" 
#include "IOSPrimitiveArray.h" 
#include "J2ObjC_source.h" 
#include "com/gcatconsult/shared/messages/nano/Resp.h" 
#include "com/gcatconsult/shared/remote/NetworkBase.h" 
#include "com/google/common/io/BaseEncoding.h" 
#include "com/google/protobuf/nano/MessageNano.h" 
#include "java/io/BufferedInputStream.h" 
#include "java/io/ByteArrayOutputStream.h" 
#include "java/io/InputStream.h" 
#include "java/io/OutputStream.h" 
#include "java/io/PrintStream.h" 
#include "java/lang/Exception.h" 
#include "java/lang/Integer.h" 
#include "java/lang/System.h" 
#include "java/net/HttpURLConnection.h" 
#include "java/net/MalformedURLException.h" 
#include "java/net/URL.h" 
#include "java/net/URLConnection.h" 
#include "java/util/zip/GZIPOutputStream.h" 

はbuild.gradleファイルです

plugins { 
    id 'java' 
    id "com.github.j2objccontrib.j2objcgradle" version "0.6.0-alpha" 
    id "com.google.protobuf" version "0.7.5" 
} 

sourceSets { 
    main.java.srcDirs += 'src/main/javanano' 
} 

dependencies { 
    // Any libraries you depend on, like Guava or JUnit 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.google.guava:guava:19.0' 
    compile 'com.google.protobuf.nano:protobuf-javanano:3.0.0-alpha-5' 
    testCompile 'junit:junit:4.12' 
} 

protobuf { 
    protoc { 
     artifact = "com.google.protobuf:protoc:3.0.0-beta-2" 
    } 

    generateProtoTasks { 
     all().each { task -> 
      task.builtins { 
       remove java 
       javanano { 
        option 'java_multiple_files=true' 
        option 'ignore_services=true' 
       } 
      } 
     } 
    } 
    generatedFilesBaseDir = "$projectDir/src" 
} 


// Plugin settings; put these at the bottom of the file. 
j2objcConfig { 
    // Sets up libraries you depend on 
    autoConfigureDeps true 
    skipJ2objcVerification true 
    translateClasspaths = ["../../SoftwareDev/NgCalDev/External/j2objc-1.0-2.2/lib/guava-19.0.jar"] 
    translateArgs '--prefixes', 'src/main/resources/prefixes.properties' 
// testMinExpectedTests 0 

    // Omit these two lines if you don't configure your Xcode project with CocoaPods 
// xcodeProjectDir '../../NGCalDev/AuthTouchId' // suggested directory name 
// xcodeTargetsIos 'IOS-APP', 'IOS-APPTests' // replace with your iOS targets 

    finalConfigure()   // Must be last call to configuration 
} 

最新バージョンのXcodeバージョン7.3(7D175)、OS X El Capitanバージョン10.11.4

答えて

0

GuavaはAPIをJava 8にアップグレードしているため、開発者はさまざまなバージョンを組み込む必要があります。したがって、Guavaのインクルードは/ include/guava /に移動されました。そのため、そのパスをヘッダー検索パスに追加する必要があります。

+0

ありがとうございました。プラグインのj2objcConfig:extraObjcCompilerArgs + = "-I/Users/developer/SoftwareDev/External/j2objc-1.0-2.2/include/guava"で次のフラグを見つけました。助けてくれてありがとう。これで、Xcode側のテストを開始できます。 – Gjchoza

関連する問題