gpt4 book ai didi

android - Gradle构建DeployApkTask.perform返回NullPointerException

转载 作者:行者123 更新时间:2023-12-03 05:13:32 28 4
gpt4 key购买 nike

我正在使用gradle构建一个NDK项目,当Android Studio尝试将apk放到我的模拟器上时,出现错误。它读出gradle完成了项目的构建,只是不会部署到模拟器。这是错误:

null
java.lang.NullPointerException
at com.android.tools.idea.run.tasks.DeployApkTask.perform(DeployApkTask.java:89)
at com.android.tools.idea.run.LaunchTaskRunner.run(LaunchTaskRunner.java:103)
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:366)
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)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)

和我的主要 build.gradle:

安卓/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
maven {
url "http://dl.bintray.com/android/android-tools"
}
}
dependencies {
classpath 'com.android.tools.build:gradle-experimental:0.8.0-alpha5'
}
}

allprojects {
repositories {
mavenCentral()
}
}

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

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

model {
android {
compileSdkVersion = 23
buildToolsVersion = '23.0.2'

dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}

defaultConfig.with {
applicationId = 'com.example.SanAngeles'
minSdkVersion.apiLevel = 11
targetSdkVersion.apiLevel = 23

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

buildTypes {
release {
minifyEnabled = false
proguardFiles.add(file('proguard-rules.txt'))
}
}

ndk {
moduleName "sanangeles"
stl "stlport_static"
CFlags.add("-I../../common/freetype/include")
CFlags.add("-DANDROID_NDK")
CFlags.add("-DDISABLE_IMPORTGL")
CFlags.add("-DFT2_BUILD_LIBRARY=1")
ldLibs.add("EGL")
ldLibs.add("android")
ldLibs.add("GLESv2")
ldLibs.add("dl")
ldLibs.add("log")
ldLibs.add("mui")
}

sources {
main {
java {
source {
srcDir "src"
}
}
jni {
exportedHeaders {
srcDirs = ["../../common/freetype/include"]
srcDirs += ["../../common/freetype/include/freetype"]
srcDirs += ["../../common/freetype/include/freetype/config"]
}
source {
srcDir "../../common/src"

include "../../common/freetype/src/autofit/autofit.c"
include "../../common/freetype/src/base/basepic.c"
include "../../common/freetype/src/base/ftapi.c"
include "../../common/freetype/src/base/ftbase.c"
include "../../common/freetype/src/base/ftbbox.c"
include "../../common/freetype/src/base/ftbitmap.c"
include "../../common/freetype/src/base/ftdbgmem.c"
include "../../common/freetype/src/base/ftdebug.c"
include "../../common/freetype/src/base/ftglyph.c"
include "../../common/freetype/src/base/ftinit.c"
include "../../common/freetype/src/base/ftpic.c"
include "../../common/freetype/src/base/ftstroke.c"
include "../../common/freetype/src/base/ftsynth.c"
include "../../common/freetype/src/base/ftsystem.c"
include "../../common/freetype/src/cff/cff.c"
include "../../common/freetype/src/pshinter/pshinter.c"
include "../../common/freetype/src/pshinter/pshglob.c"
include "../../common/freetype/src/pshinter/pshpic.c"
include "../../common/freetype/src/pshinter/pshrec.c"
include "../../common/freetype/src/psnames/psnames.c"
include "../../common/freetype/src/psnames/pspic.c"
include "../../common/freetype/src/raster/raster.c"
include "../../common/freetype/src/raster/rastpic.c"
include "../../common/freetype/src/sfnt/pngshim.c"
include "../../common/freetype/src/sfnt/sfntpic.c"
include "../../common/freetype/src/sfnt/ttbdf.c"
include "../../common/freetype/src/sfnt/ttkern.c"
include "../../common/freetype/src/sfnt/ttload.c"
include "../../common/freetype/src/sfnt/ttmtx.c"
include "../../common/freetype/src/sfnt/ttpost.c"
include "../../common/freetype/src/sfnt/ttsbit.c"
include "../../common/freetype/src/sfnt/sfobjs.c"
include "../../common/freetype/src/sfnt/ttcmap.c"
include "../../common/freetype/src/sfnt/sfdriver.c"
include "../../common/freetype/src/smooth/smooth.c"
include "../../common/freetype/src/smooth/ftspic.c"
include "../../common/freetype/src/truetype/truetype.c"
include "../../common/freetype/src/type1/t1driver.c"
include "../../common/freetype/src/cid/cidgload.c"
include "../../common/freetype/src/cid/cidload.c"
include "../../common/freetype/src/cid/cidobjs.c"
include "../../common/freetype/src/cid/cidparse.c"
include "../../common/freetype/src/cid/cidriver.c"
include "../../common/freetype/src/pfr/pfr.c"
include "../../common/freetype/src/pfr/pfrgload.c"
include "../../common/freetype/src/pfr/pfrload.c"
include "../../common/freetype/src/pfr/pfrobjs.c"
include "../../common/freetype/src/pfr/pfrsbit.c"
include "../../common/freetype/src/type42/t42objs.c"
include "../../common/freetype/src/type42/t42parse.c"
include "../../common/freetype/src/type42/type42.c"
include "../../common/freetype/src/winfonts/winfnt.c"
include "../../common/freetype/src/pcf/pcfread.c"
include "../../common/freetype/src/pcf/pcfutil.c"
include "../../common/freetype/src/pcf/pcfdrivr.c"
include "../../common/freetype/src/psaux/afmparse.c"
include "../../common/freetype/src/psaux/psaux.c"
include "../../common/freetype/src/psaux/psconv.c"
include "../../common/freetype/src/psaux/psobjs.c"
include "../../common/freetype/src/psaux/t1decode.c"
include "../../common/freetype/src/tools/apinames.c"
include "../../common/freetype/src/type1/t1afm.c"
include "../../common/freetype/src/type1/t1gload.c"
include "../../common/freetype/src/type1/t1load.c"
include "../../common/freetype/src/type1/t1objs.c"
include "../../common/freetype/src/type1/t1parse."
include "../../common/freetype/src/bdf/bdfdrivr."
include "../../common/freetype/src/bdf/bdflib."
include "../../common/freetype/src/gzip/ftgzip."
include "../../common/freetype/src/lzw/ftlzw.c"
}
}
}
}
}
}

最佳答案

仍然不确定发生了什么,但是我通过将0.8.0-alpha5降级为0.8.0-alpha4来解决此问题。

关于android - Gradle构建DeployApkTask.perform返回NullPointerException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38445791/

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