gpt4 book ai didi

Android Studio 中的 Android NDK >=1.4

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:58:39 26 4
gpt4 key购买 nike

我不认为这个问题是 this 的重复问题和 this问题,因为它们主要由 this link 回答这不适用于更高版本的 AS。

我可以在 how to integrate Android NDK with Eclipse 上找到很好的信息,但 Eclipse 和 ADT 现在是 considered deprecated由谷歌。

following the instructions为实验性 gradle 插件设置一个项目,我在 cannot Resolve symbol 类型的编辑器中收到许多错误,用于所有新添加的内容以及构建后在下面发布的错误。

项目中的build.gradle。

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle-experimental:0.2.0'
}
}

allprojects {
repositories {
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

还有应用中的build.gradle

apply plugin: 'com.android.model.application'

model{
android {
compileSdkVersion = 22
buildToolsVersion = "23.0.1"

defaultConfig.with {
applicationId = "se.einarsundgren.gstreamandroiddemo"
minSdkVersion.apiLevel = 22
targetSdkVersion.apiLevel = 22
versionCode = 1
versionName = "1.0"

buildConfigFields.with {
create() {
type = "int"
name = "VALUE"
value = "1"
}
}
}

android.buildTypes {
release {
minifyEnabled = false
proguardFiles += file('proguard-rules.pro')
}
}

android.productFlavors {
create("flavor1") {
applicationId = 'com.app'
}
}

android.sources{
main {
java {

source {
srcDir 'src'
}
}
}
}

android.ndk {
moduleName = "native"
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
}

清理和重建项目时出现的错误:

错误:配置根项目“GstreamAndroidDemo”时出现问题。

Could not resolve all dependencies for configuration ':classpath'. Could not resolve com.android.tools.build:gradle-experimental:0.2.0. Required by: :GstreamAndroidDemo:unspecified Could not resolve com.android.tools.build:gradle-experimental:0.2.0. Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle-experimental/0.2.0/gradle-experimental-0.2.0.pom'. Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle-experimental/0.2.0/gradle-experimental-0.2.0.pom'. peer not authenticated

如何将 NDK 与 Android Studio 中的项目集成?先前链接的问题具有适用于早期版本(1.3 之前)的答案,并且说明不适用于 AS 1.4

最佳答案

that this setting where you can point to the location of the NDK is not included in the later versions.

是的,至少在 Linux 上的 Android Studio 1.4.1 上是这样:

Project Structure Dialog, SDK Location Category

How do I integrate the NDK with a project in Android Studio?

据我所知,你关注了 the instructions


更新:关于您的gradle-experimental 问题,当您查看 their Web site 时,0.2.0 和更新版本肯定会出现在 jcenter 中.确保您已按照其余说明进行操作,例如使用 Gradle 2.5。

关于Android Studio 中的 Android NDK >=1.4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33445881/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com