android-build

Add custom.xml file to AOSP etc folder

余生颓废 提交于 2019-12-04 11:23:48
I wanted to add a resource file/ xml file to etc folder in AOSP. I would like to have my resource file available just like platform.xml file. So I basically added my xml file in AOSP/frameworks/base/data/etc folder and correspondingly added the following lines in the make file Android.mk ######################## include $(CLEAR_VARS) LOCAL_MODULE := custom.xml LOCAL_MODULE_TAGS := optional LOCAL_MODULE_CLASS := ETC # This will install the file in /system/etc/permissions # LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/permissions LOCAL_SRC_FILES := $(LOCAL_MODULE) include $(BUILD_PREBUILT) EDIT With

Android Studio 2.1.1 running old .apk file

吃可爱长大的小学妹 提交于 2019-12-04 09:35:22
Start of with, I tried all the suggestions in SO and none helped me. Suggestion1 , Suggestion2 , Suggestion3 . I'm doing some debugging (Just running the app on my device through Android Studio ) and I noticed that time after time, changes that I made in the app does not applied to the .apk AS is running. The only solution I know is to delete the app from my device and then running again and it compiles with the changes I made in the code. Alternatively, I restart Android Studio and it fixes that too. I try all suggestions on the site including: file -> invalidate Chaches / Restart ->

How to define v7 appcompat dependency correctly?

痴心易碎 提交于 2019-12-04 09:08:49
问题 I'm trying to get an (inherited) Android project to build. I'm using Ant & command line tools (and IDEA). In styles.xml, there are references that cannot be resolved such as: <style name="AppBaseTheme" parent="@style/Theme.AppCompat.Light"> This is the original error I ran into: [...]/res/values/styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name '@style/Theme.AppCompat.Light'. I then noticed that project.properties has this appcompat reference

What's the difference between principles of useLibrary and compile files('') in build.gradle?

别等时光非礼了梦想. 提交于 2019-12-04 07:56:34
After Android 6.0 releases, Support for the Apache HTTP client is removed. If our app is using this client and targets Android 2.3 (API level 9) or higher , HttpURLConnection class is recommended. It's said that this API is more efficient because it reduces network use through transparent compression and response caching, and minimizes power consumption. If we want to continue using the Apache HTTP API s, you must first declare the following compile-time dependency in our build.gradl e file: android { useLibrary 'org.apache.http.legacy' } The legacy jar is in Android SDK , whose path is sdk

Build android shared lib using ndk-build without have jni folder

好久不见. 提交于 2019-12-03 20:18:01
I am able to build a android shared library using ndk-build only when all my src are in the jni foler, but, I would like to build a shared library using ndk-build without need jni folder, because my project doesn't have java code, so how could I do that? my simple Android.mk: LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := ctest LOCAL_SRC_FILES := main.cpp # for logging LOCAL_LDLIBS += -llog # for native asset manager LOCAL_LDLIBS += -landroid include $(BUILD_SHARED_LIBRARY) worked as follows: ndk-build APP_BUILD_SCRIPT=path/to/path/to/project/Android.mk NDK_PROJECT_PATH

Android Databinding build fail after Gradle plugin update with migration to annotationProcessor

怎甘沉沦 提交于 2019-12-03 12:45:35
To support Instant Run in my version of Android Studio, I needed to upgrade my Gradle plugin from version 2.2.3 to 2.3.3 I'm aware I'm supposed to migrate to annoationProcessor and I believe I've followed that guide correctly after doing so, the Android DataBinding code generation fails The migration guide linked earlier states that all I need is to Make sure you are on the Android Gradle 2.2 plugin or newer Remove the android-apt plugin from your build scripts Change all apt, androidTestApt and testApt dependencies to their new format This should be all that's needed to successfully build the

How to build my own Android SDK

流过昼夜 提交于 2019-12-03 07:42:29
问题 I work on my own android device which has many new APIs (but @hide decorated). My goal is to provide an android sdk to develop on it and use these new APIs. So my questions is : How to build my own android sdk with these new APIs ? If the @hide decorated is a problem, i can remove them (I don't have to respect the CDD) 回答1: You can use this command make -j8 PRODUCT-sdk-sdk showcommands dist here, you can a discussion about it : https://groups.google.com/forum/?fromgroups=#!topic/android

Change apk output folder in Gradle 4.1

纵然是瞬间 提交于 2019-12-03 05:55:05
问题 I would like to change the APK output folder and this is what I used to do: applicationVariants.all { variant -> variant.outputs.all { def filePath = "${rootProject.rootDir.absolutePath}/apks/${variant.name}" println("My Path: " + filePath) outputFileName = filePath } } However, it didn't work in Gradle 4.1 (Android studio 3.0 preview). Instead of generating the folder as the path above, it generated the above path inside old debug folder like image below: Does anyone have a solution for this

Android Studio: Switching a URL depending on buildtype? (used for testing in debug /release)

纵然是瞬间 提交于 2019-12-03 04:52:27
问题 I have been reading something about variants and buildtypes and I don't know if I am understanding it right but I would like to store a URL for locahost (testing) and one for production (live site on the internet). And I need to switch them depending on which buildtype. Is this the right way to do this ? or is there another alternative ? Does anyone have a small example ? Is there a way of storing this information in a file that I do not need to commit to source control ? I am using the

Slow SDK download through Android SDK manager

血红的双手。 提交于 2019-12-03 04:00:47
问题 When I run Android SDK manager to download SDK platform, the download speed is 8 KiB/s. It would take more than 2 hours to download one platform like Android 2.2, API 8. There is no problem with download stuff through browser. Does anyone know how to fix this problem? 回答1: I have not experienced this issue. Force or unforce HTTPS (there is an option for this under Settings), and see if this improves the quality of your connection. 回答2: I also have this problems and found a solution online and