2017-07-06 4 views
1

NDKを使用してlibusbを構築しようとしています。ここに私のAndroid.mkApplication.mkこのスレッドをチェックしたAndroid NDK: No rule to make targetしかし、それは私のためには機能しませんでした。Android NDK:make:***ターゲットを作成するルールはありません。停止

Android.mk

include $(CLEAR_VARS) 
LOCAL_MODULE := libusb 
LOCAL_SRC_FILES := libusb/core.c libusb/descriptor.c libusb/io.c libusb/sync.c libusb/os/linux_usbfs.c 

LOCAL_LDLIBS := -llog 
include $(BUILD_SHARED_LIBRARY) 

Application.mk

APP_ABI:= all 
APP_LDFLAGS:= -llog 
APP_STL:= stlport_shared 
APP_CPP_FEATURES:= exceptions 
APP_PLATFORM:= android-21 
APP_CFLAGS:= -g 

build.gradle

apply plugin: 'com.android.application' 

apply plugin: 'kotlin-android' 

apply plugin: 'kotlin-android-extensions' 

android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.0" 
    defaultConfig { 
     applicationId "com.williams.libusbpoc" 
     minSdkVersion 21 
     targetSdkVersion 26 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    implementation fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestImplementation ('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" 
    implementation 'com.android.support:appcompat-v7:26.0.0-beta2' 
    testImplementation 'junit:junit:4.12' 
    implementation 'com.android.support.constraint:constraint-layout:1.0.2' 
} 

local.properties

ndk.dir=C\:\\android-ndk-r15 

プロジェクト構造は以下のようになります。

enter image description here

私はndk-buildを実行している、私は

ndk-build 
Android NDK: WARNING: APP_PLATFORM android-21 is higher than android:minSdkVersion 1 in D:/williams/android/libusbpoc/app/src/main/AndroidManifest.xml. NDK binaries will *not* be comptible with devices older than android-21. See https://android.googlesource.com/platform/ndk/+/master/docs/user/common_problems.md for more information. 
make: *** No rule to make target `C:/android-ndk-r15/build//../sources/cxx-stl/stlport/libusb/core.c', needed by `D:/williams/android/libusbpoc/app/src/main/obj/local/arm64-v8a/objs/usb/libusb/core.o'. Stop. 

を取得誰もが私が間違っているのか知っていますか?

答えて

1

あなたは、すなわちあなたのAndroid.mkあなたが持つべきで、LOCAL_PATHを設定するのを忘れているように見えます:

LOCAL_PATH := $(call my-dir) 
include $(CLEAR_VARS) 
# ..etc as before.. 
関連する問題