android-studio-3.0

Using a prebuilt shared Library in Android Studio (cmake)

左心房为你撑大大i 提交于 2019-12-04 06:33:48
I want to use a C++ shared library inside my Android App. I tried to follow along the hello-libs example from Google's NDK samples, but somehow it doesn't work out. It seems, that my library isn't packed into the APK. All tutorials i found are using *.mk -files, but I want to use cmake . This is my CMakeLists.txt: # Sets the minimum version of CMake required to build the native library. cmake_minimum_required(VERSION 3.4.1) # native lib add_library(native-lib SHARED native-lib.cpp) set(IMPORT_DIR ${CMAKE_SOURCE_DIR}/../jniLibs) # shared lib add_library(shared-lib SHARED IMPORTED) set_target

Lint: “Newer Library Versions Available” when using variables

余生颓废 提交于 2019-12-04 05:50:27
I have a project with 3 sub-projects. I want the 3 sub-projects to use the same dependencies versions so I factored all the versions in the root build.gradle : allprojects { ext.versions = [ supportLibVersion: '26.1.0', playServicesVersion: '11.2.2', retrofitVersion: '2.1.0', retrofitConverterGsonVersion: '2.1.0', retrofitRxjava2AdapterVersion: '1.0.0', rxjava2Version: '2.0.5', rxandroidVersion: '2.0.1', timberVersion: '4.5.1', ... ] } Now lint doesn't highlight new libraries available anymore. It somehow still works for the supportLibs but not for the other ones. Any chance I can have this

Unable to Build Project after update to android studio preview 3.0 canary 3 [duplicate]

妖精的绣舞 提交于 2019-12-04 05:43:17
问题 This question already has answers here : Could not find com.android.tools.build:gradle:3.0.0-alpha1 in circle ci (13 answers) Closed 2 years ago . I Just update my android studio preview 3.0 canary 3. After this I am trying to run the project but showing following error. Error:Could not find com.android.tools.build:gradle:3.0.0. Searched in the following locations: file:/opt/android-studio-preview/gradle/m2repository/com/android/tools/build/gradle/3.0.0/gradle-3.0.0.pom file:/opt/android

OpenCV Android native code build issue

扶醉桌前 提交于 2019-12-04 03:27:11
问题 I am learning how to write C++ code using OpenCV and I want to run it in Android. I use Android Studio. I have created a new simple project with C++ support and then I added my test code to the C++ file. My own files compile and link, it seems. Now something else that I don't think is related to my project is causing many errors. It seems to be something inside NDK. Could it be a bug in the latest version, and if so, what can I do about it? C:/Android/sdk/ndk-bundle/toolchains/x86-4.9

Android Studio 3.0 - Unable to save settings: Failed to save settings. Please restart Android Studio

落花浮王杯 提交于 2019-12-04 03:03:21
问题 Yesterday I was updated my Android Studio version to stable version 3.0 then I am started getting this errors in my studio and unable to build the app. Unable to save plugin settings: The plugin org.jetbrains.android failed to save settings and has been disabled. Please restart Android Studio But I forcefully enabled all plugins in my Studio by going to File-->Settings-->Plugins --> All are enabled. I tried by deleting .AndroidStudio/* folder as suggested here and here I tried by Invalidate

Android Studio flagging error in SQLite pragma command, <pragma value> expected, got 'ON'

时光毁灭记忆、已成空白 提交于 2019-12-04 02:29:25
I think this is a new error since switching to Android Studio 3.0. I am receiving a lint syntax error: <pragma value> expected, got 'ON' I get this error only on the first of the following two methods: private static void setForeignKeyConstraintsEnabled(@NonNull SQLiteDatabase db) { if (!db.isReadOnly()) { db.execSQL("PRAGMA foreign_keys=ON;"); } } private static void setForeignKeyConstraintsDisabled(@NonNull SQLiteDatabase db) { if (!db.isReadOnly()) { db.execSQL("PRAGMA foreign_keys=OFF;"); } } I only found one suggested fix on the internet as of writing . It is in german and says that I

Android Studio 3.0 Unsigned Apk Not Installing

那年仲夏 提交于 2019-12-03 23:38:15
After upgrading to android studio 3.0 the debug apk is saying App not istalled. The package appears to be corrupted Looks like we can not directly use the apk after running on the device from the build->output->apk folder. After upgrading to android studio 3.0 you need to go to Build -> Build Apk(s) then copy the apk from build -> output -> apk -> debug Like this - Fist Click On Build Icon on android studio after that click Build APK(s) then Generate APK the copy Apk. It is working perfact. I needed to create a signed APK for it to install correctly. I have also faced the same problem after

Change encoding of androidManifest.xml to UTF-8 in Android Studio 3

只愿长相守 提交于 2019-12-03 22:29:02
问题 In the beta version of Android Studio 3 it seems that the androidManifest file is encoded forcefully into UTF-8 even if UTF-16 is stated in the header. Is this a bug or is there another way now to change the encoding of the manifest back to UTF-8? 回答1: The app build process using gradle in Android Studio 3 (beta and RC-1) is using aapt2. I compared the AndroidManifest.xml generated by the Android Studio 2.x (gradle version 2.3.x) and Adnroid Studio 3 Beta and RC-1 (gradle version 4.1). The

Android Studio 3.0 gradle 3.0.0-beta2, breaks Kotlin Unit Test Coverage?

旧时模样 提交于 2019-12-03 19:25:05
问题 I have a simple Kotlin classes, as below class MyClass { fun justSayHello(yes: Boolean): String { if (yes) { return "Hello" } else { return "Sorry" } } } I have my test (written in Java here, could be in Kotlin, also) public class MyClassTest { private MyClass myClass = new MyClass(); @Test public void testFirst() { myClass.justSayHello(true); } @Test public void testSecond() { myClass.justSayHello(false); } } When I run a test with Coverage in Android Studio 3.0 Beta-2 using classpath 'com

Android Studio 3.0 Canary 2: attribute 'android:versionCode' not found

扶醉桌前 提交于 2019-12-03 18:49:28
问题 I've updated Android Studio to the latest canary build and now I can't run my app. Every time when I try to build the project I get the following error: Error:F:\...\**app_name**\app\build\intermediates\instant-run-support\debug\slice_0\AndroidManifest.xml:2 attribute 'android:versionCode' not found I tried to manually open the file and the attribute is clearly there: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="****"