2016-11-23 3 views
1

Android NDKの新機能です。今日私はAndroid Studio Wizardを使ってプロジェクトを設定しました。一般的なSdk開発と異なるのは、「Include C++ Support」をチェックしたことです。開発ゾーンに入ると、gradle syncに失敗しました.--「エラー: :ARM64_V8A "を参照してください。エラー:有効なABIを保証する呼び出し元が必要です:ARM64_V8A

マイevironmentを開発するには、次のとおりです。

アンドロイドStudio2.2.2

JRE:1.8.0

OS:Windowsの10家族のバージョン

以下のようにエラーログ:

2016-11-23 11:35:03,111 [12186031] WARN - nal.AbstractExternalSystemTask - Expected caller to ensure valid ABI: ARM64_V8A 
com.intellij.openapi.externalSystem.model.ExternalSystemException: Expected caller to ensure valid ABI: ARM64_V8A 
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectImportErrorHandler.createUserFriendlyError(AbstractProjectImportErrorHandler.java:106) 
    at org.jetbrains.plugins.gradle.service.project.BaseProjectImportErrorHandler.getUserFriendlyError(BaseProjectImportErrorHandler.java:158) 
    at org.jetbrains.plugins.gradle.service.project.BaseGradleProjectResolverExtension.getUserFriendlyError(BaseGradleProjectResolverExtension.java:579) 
    at org.jetbrains.plugins.gradle.service.project.AbstractProjectResolverExtension.getUserFriendlyError(AbstractProjectResolverExtension.java:158) 
    at com.android.tools.idea.gradle.project.AndroidGradleProjectResolver.getUserFriendlyError(AndroidGradleProjectResolver.java:405) 
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:772) 
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver$ProjectConnectionDataNodeFunction.fun(GradleProjectResolver.java:752) 
    at org.jetbrains.plugins.gradle.service.execution.GradleExecutionHelper.execute(GradleExecutionHelper.java:238) 
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:112) 
    at org.jetbrains.plugins.gradle.service.project.GradleProjectResolver.resolveProjectInfo(GradleProjectResolver.java:73) 
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:41) 
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl$1.produce(RemoteExternalSystemProjectResolverImpl.java:37) 
    at com.intellij.openapi.externalSystem.service.remote.AbstractRemoteExternalSystemService.execute(AbstractRemoteExternalSystemService.java:59) 
    at com.intellij.openapi.externalSystem.service.remote.RemoteExternalSystemProjectResolverImpl.resolveProjectInfo(RemoteExternalSystemProjectResolverImpl.java:37) 
    at com.intellij.openapi.externalSystem.service.remote.wrapper.ExternalSystemProjectResolverWrapper.resolveProjectInfo(ExternalSystemProjectResolverWrapper.java:49) 
    at com.intellij.openapi.externalSystem.service.internal.ExternalSystemResolveProjectTask.doExecute(ExternalSystemResolveProjectTask.java:51) 
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:138) 
    at com.intellij.openapi.externalSystem.service.internal.AbstractExternalSystemTask.execute(AbstractExternalSystemTask.java:124) 
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$3.execute(ExternalSystemUtil.java:419) 
    at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$4$2.run(ExternalSystemUtil.java:500) 
    at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563) 
    at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142) 
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:446) 
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392) 
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54) 
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127) 
    at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126) 
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:369) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 

慎重に検索した結果、build.gradにいくつかのコンテンツが追加されていますle(アプリ)

externalNativeBuild { 
    cmake { 
     path "CMakeLists.txt" 
    } 
} 

削除した後は問題ありません。内容は次のとおりです。

# Sets the minimum version of CMake required to build the native 
# library. You should either keep the default value or only pass a 
# value of 3.4.0 or lower. 

#cmake_minimum_required(VERSION 3.4.1) 


# Creates and names a library, sets it as either STATIC 
# or SHARED, and provides the relative paths to its source code. 
# You can define multiple libraries, and CMake builds it for you. 
# Gradle automatically packages shared libraries with your APK. 

add_library(# Sets the name of the library. 
     native-lib 

     # Sets the library as a shared library. 
     SHARED 

     # Provides a relative path to your source file(s). 
     # Associated headers in the same location as their source 
     # file are automatically included. 
     src/main/cpp/native-lib.cpp) 

# Searches for a specified prebuilt library and stores the path as a 
# variable. Because system libraries are included in the search path by 
# default, you only need to specify the name of the public NDK library 
# you want to add. CMake verifies that the library exists before 
# completing its build. 

find_library(# Sets the name of the path variable. 
      log-lib 

      # Specifies the name of the NDK library that 
      # you want CMake to locate. 
      log) 

# Specifies libraries CMake should link to your target library. You 
# can link multiple libraries, such as libraries you define in the 
# build script, prebuilt third-party libraries, or system libraries. 

target_link_libraries(# Specifies the target library. 
        native-lib 

        # Links the target library to the log library 
        # included in the NDK. 
        ${log-lib}) 

私はAndroid Studio bug reportに報告しました。

私の責任であるかどうかわかりません。何か説明があります。

+0

先週もこのエラーが発生しました。これはASの新しいバージョンに結びついているようです:|私の同僚は、File - > Invalidate Caches/Restartに進み、動作しませんでしたが、動作しました。 – Sipty

+0

@Siptyそれは私にとってはうまくいかない。 –

+0

ナイトリービルドのASに更新しようとするとどうなりますか?古いバージョンに戻すことはできますか?私は99%がユーザーのエラーではなく、バージョンのバグであることを確信しています! – Sipty

答えて

0

今日、私は「エコー」NDK例をインポートするとき、それは私に私のコンピュータや他のコンピュータのNDK-buildディレクトリを検索した後

Error:Expected NDK STL shared object file at E:\Android_Sdk\ndk-bundle\sources\cxx-stl\llvm-libc++\libs\armeabi-v7a\libc++_shared.so

を警告し、私は問題を見つけます。 それは私の不注意なせいで、別のコンピュータからndk-buildディレクトリをコピーしましたが、コピーは完了していません。コピーした後、もう一度問題を解決してください。

私は不注意に本当に申し訳ありません。この投稿を削除する必要があるかどうかわかりません。必要があれば、教えてください。

関連する問題