android-studio

Setting up JNI in Android Studio 3

大城市里の小女人 提交于 2020-01-06 05:01:52
问题 I am using JNI in an Android Studio project I am working on. Currently, I have a C++ library that looks similar to this. #include <jni.h> ... extern "C" { JNIEXPORT jobject JNICALL Java_com_cerbyarms_cerbyarms_esra_camera_CameraActivity_FindFeatures(JNIEnv* env, jobject, jlong maskMat) { ... jclass rectClass = env->FindClass("org/opencv/core/Rect"); jmethodID rectID = env->GetMethodID(rectClass, "<init>", "(IIII)V"); return env->NewObject(rectClass, rectID, x, y, width, height); } } This

In Android studio, I'm getting an error that says “Packages unavailable” and that a package I need is not available

不问归期 提交于 2020-01-06 04:59:07
问题 In Android Studio, I'm getting an error about building my app. Error:Failed to find Build Tools revision 26.1.0 <a href="install.build.tools">Install Build Tools 26.1.0 and sync project</a> This results in a blue install link, but when I click it I get an error telling me that, "Package Unavailable" and that "Packages are unavailable." Here's what my build.gradle looks like apply plugin: 'com.android.application' android { compileSdkVersion 26 lintOptions { abortOnError false } defaultConfig

Can't change position of elements in webview

雨燕双飞 提交于 2020-01-06 04:47:06
问题 I developed a simple webview app which is working fine. Now I have to add a back button. I added it as a child of "FrameLayout". I can change the size, but I can't change the position of the button, it just sits at the top left... This seems to be the case for any element, I just tried it with ImageView and I have the same problems with it. I also tried to use "RelativeLayout" instead of "FrameLayout" as adviced in this answer, but it makes no difference Any help is appreciated. 回答1: I

Disable Instant Run Android Studio 2.2 Preview 5

好久不见. 提交于 2020-01-06 04:23:24
问题 I am Unable to disable my Instant Run , and i want to disable it because i am facing different kind of problems with Libraries like SugarORM , Here is what i am doing. File -> Other Settings -> Default Settings There is No Instant Run Option There !!! Where is instant run , and how can i disable it in MAC/windows 回答1: I had the same exact isuue with SugarORM lib. here what I did : (I'll give you two ways to achive that one disable for specefic project, and second for whole android studio): if

java.lang.ClassNotFoundException: android.net.Network

≯℡__Kan透↙ 提交于 2020-01-06 04:15:07
问题 This is little related to Payubiz payment gateway sdk integration. However, the main problem is related to building a project. Whenever we try to run the application on emulator. We get the following failure: What went wrong: Execution failed for task ':app:transformClassesWithInstantRunForAppDebug'. java.lang.ClassNotFoundException: android.net.Network However, the application builds and run smoothly on running on a device. We have already contacted the Payu Team for the issue. But as it is

String variables becomes null outside setOnClickListener() function

坚强是说给别人听的谎言 提交于 2020-01-06 04:10:26
问题 I have a simple android app in which I want to get the user input (String). So I have an "EditText" box and an "Enter" button. When the user types something and hits Enter, I am trying to display that text and it works as long as I do all that inside the 'setOnClickListener()' function. The string variables becomes null outside the function. Here is my code: public class MainActivity extends AppCompatActivity { Button hitButton; EditText userInput; String myVariable; @Override protected void

Android Studio cannot find default activity

扶醉桌前 提交于 2020-01-06 04:06:22
问题 I've struggled with this for two days now.No matter what I do, Android Studio 2.1.1 , running on windows 10 64 keeps throwing Could not identify launch activity: Default Activity not found Error while Launching activity . Also, syntax highlighting for java files isn't working either, i.e. my MainActivity.java file has no syntax checking at all. I've had no luck with any SO answers which mainly included one or more of the below: I've tried 1- Invalidating caches and restarting android studio 2

How to remove ReadOnly status from android emulator file system?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-06 03:36:13
问题 I`m trying to edit my android emulator (AVD) hosts file, so it can acess a virtual host i have in my Mac OS host machine. I try following the instructions on this link: http://borkweb.com/story/setting-etchosts-on-an-android-emulator-using-a-mac But i keep receiving "REad Only File System" messages. I`ve tried it using Android Device Monitor, from Android Studio, but it also ReadOnly. How can I remove the ReadOnly status from my emulator file system? 回答1: To update the hosts file in the

Google Play game services - Android samples errors

前提是你 提交于 2020-01-06 03:32:10
问题 Based on Android docs (https://developers.google.com/games/services/android/quickstart#before_you_begin) for learning how to configure Google Play game APIs onto a sample app such as TypeANumber, I was wondering why I get the following resource errors from the BaseGameUtils library after importing the project, BasicSamples, from their GitHub's (https://github.com/playgameservices/android-basic-samples) source files: ... Based on the directory in the left panel, did I import it properly? All I

Gradle 2.5 Experimental : include .so library and call from JNI

不羁岁月 提交于 2020-01-06 02:57:10
问题 My problem is that I fail to find some proper documents/guides to follow in order to set up my environment correctly. Basically I am using Android Studio 1.3.2 (latest stable as of 22nd september 2015) with Gradle Experimental version 2.5. I followed Google official documentation here : http://tools.android.com/tech-docs/new-build-system/gradle-experimental but I find no help when it comes to JNI Libs. I tried many other solutions but they do not work because they seem to be obsolete. I have