生成命令失败,执行过程出错

时间:2019-01-15 15:49:16

标签: android c++ gradle cmake ndk-build

我正在尝试从Android Studio导出.apk文件,而我已经做到了

“ 1。在项目窗格中,右键单击模块,然后选择“将C ++项目与Gradle链接”。 2。根据您的项目,从下拉菜单中选择CMake或ndk-build

a。如果选择了CMake,请在项目中指定CMakeLists.txt脚本

b。如果选择了ndk-build,请指定Android.mk。“

(我只是复制粘贴了@Janman的答案)

这是错误

  

保存新副本并编辑纯文本Twitter   1个   2   3   4   5   6   7   8   9   10   11   12   生成命令失败。   使用参数{NDK_PROJECT_PATH = null APP_BUILD_SCRIPT = C:\ Users \ costy \ AndroidStudioProjects \ android1 \ app \ build执行进程C:\ Users \ costy \ AppData \ Local \ Android \ Sdk \ ndk-bundle \ ndk-build.cmd时出错\ intermediates \ ndk \ debug \ Android.mk APP_ABI = x86_64 NDK_ALL_ABIS = x86_64 NDK_DEBUG = 1 APP_PLATFORM = android-16 NDK_OUT = C:/ Users / costy / AndroidStudioProjects / android1 / app / build / intermediates / ndkBuild / debug / obj NDK_LIBS_OUT = C:\ Users \ costy \ AndroidStudioProjects \ android1 \ app \ build \ intermediates \ ndkBuild \ debug \ lib C:/ Users / costy / AndroidStudioProjects / android1 / app / build / intermediates / ndkBuild / debug / obj / local / x86_64 / libplayer_shared 。所以}   Android NDK:警告:模块player_shared在C:\ Users \ costy \ AndroidStudioProjects \ android1 \ app \ build \ intermediates \ ndk \ debug \ Android.mk中不受支持的源文件扩展名
  Android NDK:C:\ Users \ costy \ AndroidStudioProjects \ android1 \ app \ src \ main \ jni \ Android.mk C:\ Users \ costy \ AndroidStudioProjects \ android1 \ app \ src \ main \ jni \ Application.mk C:\ Users \ costy \ AndroidStudioProjects \ android1 \ app \ src \ main \ jni \ list.sh
  [x86_64]编译++:player_shared <= main.cpp   C:\ Users \ costy \ AndroidStudioProjects \ android1 \ app \ src \ main \ jni \ main.cpp:1:10:致命错误:找不到'PTPAppDelegate.h'文件#include“ PTPAppDelegate.h”   产生1个错误。   制作:*** [C:/ Users / costy / AndroidStudioProjects / android1 / app / build / intermediates / ndkBuild / debug / obj / local / x86_64 / objs-debug / player_shared / C_ \ Users \ costy \ AndroidStudioProjects \ android1 \ app \ src \ main \ jni \ main.o]错误1

Android Gradle

buildscript {
repositories {
    jcenter()
    google()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
}


 allprojects {
    repositories {
       jcenter()
       google()
}

App Gradle

apply plugin: 'com.android.application'
android {
  compileSdkVersion 26
  buildToolsVersion "28.0.3"

defaultConfig {
    applicationId "com.glitchrun.sapphire"
    minSdkVersion 14
    targetSdkVersion 26

    ndk {
        moduleName "player_shared"
    }
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
    }
}
externalNativeBuild {
    ndkBuild {
        path file('build/intermediates/ndk/debug/Android.mk')
    }
}


dependencies {
   compile 'com.google.android.gms:play-services:+'
   compile files('libs/dagger-1.2.2.jar')
   compile files('libs/javax.inject-1.jar')
   compile files('libs/nineoldandroids-2.4.0.jar')
   compile files('libs/support-v4-19.0.1.jar')

0 个答案:

没有答案