2017-03-03 1 views
0

enter image description hereAndroid NDK Arrêter Abandon, Impossible de créer NDK construire

# Copyright (C) 2010 The Android Open Source Project 
# 
# Licensed under the Apache License, Version 2.0 (the "License"); 
# you may not use this file except in compliance with the License. 
# You may obtain a copy of the License at 
# 
#  http://www.apache.org/licenses/LICENSE-2.0 
# 
# Unless required by applicable law or agreed to in writing, software 
# distributed under the License is distributed on an "AS IS" BASIS, 
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
# See the License for the specific language governing permissions and 
# limitations under the License. 
# 

# this file is included from prebuilt-shared-library.mk or 
# prebuilt-static-library.mk to declare prebuilt library binaries. 
# 

$(call assert-defined, LOCAL_BUILD_SCRIPT LOCAL_MAKEFILE LOCAL_PREBUILT_PREFIX LOCAL_PREBUILT_SUFFIX) 

$(call check-defined-LOCAL_MODULE,$(LOCAL_BUILD_SCRIPT)) 
$(call check-LOCAL_MODULE,$(LOCAL_MAKEFILE)) 
$(call check-LOCAL_MODULE_FILENAME) 

# Check that LOCAL_SRC_FILES contains only the path to one library 
ifneq ($(words $(LOCAL_SRC_FILES)),1) 
$(call __ndk_info,ERROR:$(LOCAL_MAKEFILE):$(LOCAL_MODULE): The LOCAL_SRC_FILES for a prebuilt library should only contain one item)) 
$(call __ndk_error,Aborting) 
endif 

bad_prebuilts := $(filter-out %$(LOCAL_PREBUILT_SUFFIX),$(LOCAL_SRC_FILES)) 
ifdef bad_prebuilts 
$(call __ndk_info,ERROR:$(LOCAL_MAKEFILE):$(LOCAL_MODULE): LOCAL_SRC_FILES should point to a file ending with "$(LOCAL_PREBUILT_SUFFIX)") 
$(call __ndk_info,The following file is unsupported: $(bad_prebuilts)) 
$(call __ndk_error,Aborting) 
endif 

prebuilt_path := $(call local-prebuilt-path,$(LOCAL_SRC_FILES)) 
prebuilt := $(strip $(wildcard $(prebuilt_path))) 

ifndef prebuilt 
$(call __ndk_info,ERROR:$(LOCAL_MAKEFILE):$(LOCAL_MODULE): LOCAL_SRC_FILES points to a missing file) 
$(call __ndk_info,Check that $(prebuilt_path) exists, or that its path is correct) 
$(call __ndk_error,Aborting) 
endif 

# If LOCAL_MODULE_FILENAME is defined, it will be used to name the file 
# in the TARGET_OUT directory, and then the installation one. Note that 
# it shouldn't have an .a or .so extension nor contain directory separators. 
# 
# If the variable is not defined, we determine its value from LOCAL_SRC_FILES 
# 
LOCAL_MODULE_FILENAME := $(strip $(LOCAL_MODULE_FILENAME)) 
ifndef LOCAL_MODULE_FILENAME 
    LOCAL_MODULE_FILENAME := $(notdir $(LOCAL_SRC_FILES)) 
    LOCAL_MODULE_FILENAME := $(LOCAL_MODULE_FILENAME:%$(LOCAL_PREBUILT_SUFFIX)=%) 
endif 
$(eval $(call ev-check-module-filename)) 

# If LOCAL_BUILT_MODULE is not defined, then ensure that the prebuilt is 
# copied to TARGET_OUT during the build. 
LOCAL_BUILT_MODULE := $(strip $(LOCAL_BUILT_MODULE)) 
ifndef LOCAL_BUILT_MODULE 
    LOCAL_BUILT_MODULE := $(TARGET_OUT)/$(LOCAL_MODULE_FILENAME)$(LOCAL_PREBUILT_SUFFIX) 
    LOCAL_OBJECTS  := $(prebuilt) 

    $(LOCAL_BUILT_MODULE): $(LOCAL_OBJECTS) 
endif 

LOCAL_OBJS_DIR := $(TARGET_OBJS)/$(LOCAL_MODULE) 
LOCAL_SRC_FILES := 

include $(BUILD_SYSTEM)/build-module.mk 

Je reçois NDK erreur d'arrêt dans Abandon ce fichier prebuilt-library.mk. Le fichier est donné ci-dessus. Il montre également échoué à construire NDK &-NDK-construction fini avec la valeur de sortie non nulle 2.

Comment puis-je corriger cette erreur?

Merci d'avance.

+0

Affichez le reste du message d'erreur.Tout ce que nous savons de cela, c'est qu'il a échoué, pas ce qu'il faisait quand il l'a fait. –

+0

@GabeSechan a posté l'image. –

+0

@AvijitKarmakar Veuillez vous assurer que votre projet Android et votre chemin NDK ne contiennent pas d'espace blanc. – Lawrance

Répondre

1

Remarque: Si vous avez déjà créé un projet et que vous installez Android NDK, CMake et LLDB via SDK Tools, alors votre projet risque de ne pas générer d'erreur. Make Project.

Suivez les étapes ci-dessous:

  1. Installer Android NDK, CMake et LLDB
  2. Créer un nouveau projet dans Android et vérifié Inclure le support de Center image description here
  3. Enfin Activer Exception support & Runtime Type information Supportenter image description here
  4. Appuyez pour terminer.

Au niveau de l'application build.gradle.

  • AJOUTZ lignes avant apply plugin:...

    import org.apache.tools.ant.taskdefs.condition.Os 
    
    Properties properties = new Properties() 
    properties.load(project.rootProject.file('local.properties').newDataInputStream()) 
    def ndkDir = properties.getProperty('ndk.dir') 
    
  • Ajouter à android ->defaultConfig

    externalNativeBuild {{ CMake CPPFLAGS "-frtti -fexceptions" }}

  • AJOUTZ lignes après buildTypes {} tag

    externalNativeBuild {{ CMake chemin "CMakeLists.txt" }} tâche ndkBuild (type: Exec) {if ( Os.isFamily (Os.FAMILY_WINDOWS)) { commandLine ndkDir + '/ndk-build.cmd', '-C', fichier ('src/main'). AbsolutePath } else { commandLine ndkDir + '/ ndk-build', '-C', fichier ('src/main'). absolutePath } }

    tâches.withType (JavaCompi le) { compileTask -> compileTask.dependsOn ndkBuild }

espérons qu'il vous aidera. !!