gpt4 book ai didi

android - 使用 AOSP 树构建 Android 6 消息应用程序

转载 作者:行者123 更新时间:2023-11-30 01:11:25 27 4
gpt4 key购买 nike

我正在尝试为 Android 6 构建消息应用....我已经将 packages/app/Messaging 导入到 Android Studio 中......并创建了以下 build.gradle 文件:

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.+'
}
}

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}

// Move the tests to tests/java, tests/res, etc...
instrumentTest.setRoot('tests')

// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}

defaultConfig {
applicationId "com.android.messaging"
minSdkVersion 23
targetSdkVersion 23

ndk {
moduleName "libgiftranscode"
}

repositories {
mavenCentral()
}

testApplicationId "com.android.messaging.test"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
}

dependencies {
compile "com.android.support:support-v4:+"
compile "com.android.support:appcompat-v7:+"
compile "com.android.support:recyclerview-v7:+"
compile "com.android.support:palette-v7:+"
compile "com.android.support:support-v13:+"
compile group: 'com.google.guava', name: 'guava', version: '18.0'
compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.0'
compile group: 'com.googlecode.libphonenumber', name: 'libphonenumber', version: '3.5'
compile group: 'com.klinkerapps', name: 'android-chips', version: '1.0.2'
// https://mvnrepository.com/artifact/com.google.collections/google-collections
compile group: 'com.google.collections', name: 'google-collections', version: '1.0'
// https://mvnrepository.com/artifact/com.1gravity/android-colorpicker
compile group: 'com.1gravity', name: 'android-colorpicker', version: '2.0.1'
// https://mvnrepository.com/artifact/com.googlecode.ez-vcard/ez-vcard
compile group: 'com.googlecode.ez-vcard', name: 'ez-vcard', version: '0.4.1'
// https://mvnrepository.com/artifact/javax.annotation/jsr250-api
compile group: 'javax.annotation', name: 'jsr250-api', version: '1.0'
// https://mvnrepository.com/artifact/com.google.guava/guava-annotations
compile group: 'com.google.guava', name: 'guava-annotations', version: 'r03'






}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}

它的构建基本没问题,但最后我得到了:

Starting process 'command '/home/vadim/Android/Sdk/build-tools/23.0.2/aapt''. Working directory: /home/vadim/work/Messaging2 Command: /home/vadim/Android/Sdk/build-tools/23.0.2/aapt package -f --no-crunch -I /home/vadim/Android/Sdk/platforms/android-23/android.jar -M /home/vadim/work/Messaging2/build/intermediates/manifests/full/debug/AndroidManifest.xml -S /home/vadim/work/Messaging2/build/intermediates/res/merged/debug -A /home/vadim/work/Messaging2/build/intermediates/assets/debug -m -J /home/vadim/work/Messaging2/build/generated/source/r/debug -F /home/vadim/work/Messaging2/build/intermediates/res/resources-debug.ap_ --debug-mode --custom-package com.android.messaging -0 apk --output-text-symbols /home/vadim/work/Messaging2/build/intermediates/symbols/debug Successfully started process 'command '/home/vadim/Android/Sdk/build-tools/23.0.2/aapt'' /home/vadim/work/Messaging2/res/values/styles.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'PhotoViewTheme.Translucent'.

:processDebugResources FAILED :processDebugResources (Thread[main,5,main]) completed. Took 1.175 secs.

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':processDebugResources'.

    com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/vadim/Android/Sdk/build-tools/23.0.2/aapt'' finished with non-zero exit value 1

  • 尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --debug 选项运行以获得更多日志输出。

缺少样式“PhotoViewTheme.Translucent”似乎驻留在 appcompat 库中,但我的构建没有找到它...关于如何修复它的任何想法?

谢谢

最佳答案

很抱歉让您失望,但您不能从源导入特定文件并将其作为常规 apk 在 Gradle 中构建。
系统应用程序是使用 GNU make 在 linux 环境中构建的,而不是使用常规的 apks Gradle。
要编译系统应用程序,您需要构建整个 AOSP第一的。 (如果是第一次,大约需要一个星期)

我会在线搜索应用程序(或类似应用程序)的 Gradle 版本。

关于android - 使用 AOSP 树构建 Android 6 消息应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38403927/

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