android-studio-2.0

Add JavaML library to Android Project

 ̄綄美尐妖づ 提交于 2019-12-12 05:12:03
问题 I'm new to Android, even new to Java. I'm also new to SO, so I can't post more than 2 links, sorry :/. I need to use a LibSVM object contained in JavaML library (java-ml.sourceforge.net), and every time I want to use it, I import libsvm.LibSVM (no failure there), and use LibSVM test = new LibSVM(); . At this moment my app crashes with a NoClassDefFoudError : 05-31 16:25:42.692 1353-1353/myapp E/dalvikvm: Could not find class 'libsvm.LibSVM$1', referenced from method libsvm.LibSVM.<clinit> 05

How to set the about page library in android studio

落花浮王杯 提交于 2019-12-12 03:46:04
问题 I am trying to set the about page library with compile 'com.github.medyo:android-about-page:1.0.2' But I am getting a run time error I have set as it is given in the github here is my java code: import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.view.View; import mehdi.sakout.aboutpage.AboutPage; import mehdi.sakout.aboutpage.Element; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) {

Android Studio 2.0 launch APK on another device

大城市里の小女人 提交于 2019-12-10 12:30:50
问题 Since Android Studio 2.0 and its reworked "build / run" mechanism, I can't "launch" an APK on a second device anymore. Once the APK has been loaded on the first device, I can't choose to launch a build to another device. "Run" will target the current device "Re-run" will stop the application running on the current device and upload it to the "second" device. So my question is : "How can I launch a "second" build targeting a different device than the first device I builded on without

Editing AndroidManifest.xml in Gradle task processManifest.doLast has no effect when running app from Android Studio

时光总嘲笑我的痴心妄想 提交于 2019-12-07 01:56:55
问题 I use the following Gradle script to make some modifications to the AndroidManifest.xml at compile time. In this example I want to inject a <meta-data> element. The code is based on this answer. android { // ... applicationVariants.all { variant -> variant.outputs.each { output -> output.processManifest.doLast { def manifestOutFile = output.processManifest.manifestOutputFile def newFileContents = manifestOutFile.getText('UTF-8').replace("</application>", "<meta-data ... /></application>")

Error:(144) Attribute “srcCompat” has already been defined

牧云@^-^@ 提交于 2019-12-05 09:20:25
问题 I've coded an application which can post tweets and you can see user timelines and search timelines with it. I did that with the TwitterAPI and fabric.io. And if I want to generate an APK file or sync the Gradle file, I get these errors: C:\Users\Alexander\AndroidStudioProjects\FacebookPlus\app\build\intermediates\res\merged\debug\values\values.xml Error:(140) Attribute "srcCompat" has already been defined Error:Execution failed for task ':app:processDebugResources'. com.android.ide.common

Editing AndroidManifest.xml in Gradle task processManifest.doLast has no effect when running app from Android Studio

本秂侑毒 提交于 2019-12-05 08:11:47
I use the following Gradle script to make some modifications to the AndroidManifest.xml at compile time. In this example I want to inject a <meta-data> element. The code is based on this answer . android { // ... applicationVariants.all { variant -> variant.outputs.each { output -> output.processManifest.doLast { def manifestOutFile = output.processManifest.manifestOutputFile def newFileContents = manifestOutFile.getText('UTF-8').replace("</application>", "<meta-data ... /></application>") manifestOutFile.write(newFileContents, 'UTF-8') } } } } This works as expected when I do a Gradle sync in

Android Studio 2.0 update - public static volatile com.android.tools.fd.runtime.IncrementalChange

こ雲淡風輕ζ 提交于 2019-12-05 07:59:17
After I update with Android 2.0 a new field has been added into my models object public static volatile com.android.tools.fd.runtime.IncrementalChange com.pr4.models.User.$change What problem I have faced : i.e I was reading the field using reflection package and creating a dynamic table using fields, and my app get crashed due to new field $change, If i put a check to skip particular modifier field then I have to make lot of changes. Why a new field was added at runtime in my code, how to get rid of it? Best Coder It happens due to Instant Run a new feature introduced in 2.0 Android studio

Starting an app with android studio 'instant run' is very slow

久未见 提交于 2019-12-04 16:06:48
问题 I just enabled instant run for my project. Building and uploading is faster but my app startup time has increased from a few hundreds of milliseconds to a few seconds. I'm generally happy with that compromise. I just wanted to know if I was the only one noticing this and if there can be any chance to optimize that too ? 回答1: This is a known bug in Android Studio I've been facing this problem for a long time and I came across a Reddit thread that explains the actual cause of the problem...

Gradle sync failed: Failed to update Android plugin to version '2.0.0'

你离开我真会死。 提交于 2019-12-04 06:08:59
I've recently updated Android Studio to 2.0. I am working on a part time course and I have to work on a project provided. When gradle tried to build the project a dialog popped up asking me to update the android studio gradle plugin. When I clicked update, I got an error which is in the title. My gradle files are as follows: Gradle Wrapper: #Wed Sep 30 11:56:02 PDT 2015 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists distributionUrl=http\://services.gradle.org/distributions/gradle-2.2-bin.zip Module Gradle: apply plugin:

Android Emulator: missing right panel

天涯浪子 提交于 2019-12-04 03:26:16
问题 It seems to be that in the latest version of Android studio, Google includes a new skin for the emulator. I noticed that their is a side panel at the right of the emulator. In my case, this panel is missing. I've searched for hours but with no result. Could anyone show me how to enable this panel in the emulator PS: I'm using Ubuntu 14.04 回答1: Put mouse at top right conner(Cursor change to double head arrow) left click mouse and drag out to right. The panel will display again. 回答2: Minimise