Trying to use Room on Android Studio - java

I am trying to create an app using Room persistence library in Android Studio. The problem is that is not working when I try to run, it gives me this message:
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.UnsatisfiedLinkError: org.sqlite.core.NativeDB._open_utf8([BI)V
I am following everything from this https://www.youtube.com/watch?v=KAHAQunQkDE tutorial, and it worked with the guy on the video. Maybe is something that I should install, but I dont know what. (I double checked every step on the video and everything is ok, except that mine dont run)

My error in this case was due to /tmp being mounted with the noexec flag. If you're on linux, you can check if this is the case with a grep /tmp /proc/mounts to see the mount options. The sqlite JDBC repo has an issue about this problem.
In my case, I fixed it by remounting /tmp without the noexec option. If you don't want to (or can't), it seems to be suggested to set GRADLE_OPTS=-Djava.io.tmpdir=/some/other/path. The issue linked above also mentions settingorg.sqlite.tmpdir`. Unfortunately, neither of those seemed to work for my by setting gradle opts in Android Studio.

Related

Android Studio reports "Unable to start the daemon process"

I have searched the internet, trying to fix this and nothing has worked.
I have:
deleted my .gradle folder and let Android Studio generate a new one,
changed JVM options,
changed Java global variables in Windows,
updated sdk, ndk, jre, jdk, Android Studio and Windows
changed file paths of these things so they don't have spaces.
and I can't get rid of this error in Android Studio.
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.6/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
And that's all it says. I have no idea how to solve this.

I get "':mergeDebugAssets"-Error when compiling my App with Ionic

Hello Stackoverflow Team,
when i run the following command:
ionic build android
I get the following:
Execution failed for task ':mergeDebugAssets'.
[www/node_modules/semver/semver.browser.js] /home/felix/Entwicklungen/TryMe/platforms/android/assets/www/node_modules/semver/semver.browser.js [www/node_modules/semver/semver.browser.js] /home/felix/Entwicklungen/TryMe/platforms/android/assets/www/node_modules/semver/semver.browser.js.gz: Error: Duplicate resources
[www/node_modules/bower/lib/node_modules/semver/semver.browser.js] /home/felix/Entwicklungen/TryMe/platforms/android/assets/www/node_modules/bower/lib/node_modules/semver/semver.browser.js [www/node_modules/bower/lib/node_modules/semver/semver.browser.js] /home/felix/Entwicklungen/TryMe/platforms/android/assets/www/node_modules/bower/lib/node_modules/semver/semver.browser.js.gz: Error: Duplicate resources
[www/node_modules/semver/semver.min.js] /home/felix/Entwicklungen/TryMe/platforms/android/assets/www/node_modules/semver/semver.min.js.gz [www/node_modules/semver/semver.min.js] /home/felix/Entwicklungen/TryMe/platforms/android/assets/www/node_modules/semver/semver.min.js: Error: Duplicate resources
[www/node_modules/bower/lib/node_modules/semver/semver.min.js] /home/felix/Entwicklungen/TryMe/platforms/android/assets/www/node_modules/bower/lib/node_modules/semver/semver.min.js.gz [www/node_modules/bower/lib/node_modules/semver/semver.min.js] /home/felix/Entwicklungen/TryMe/platforms/android/assets/www/node_modules/bower/lib/node_modules/semver/semver.min.js: Error: Duplicate resources
When I just compile a blank app, everything works fine. Can someone tell me whats happened here?
I also tried to remove platform android and add it again but nothing happened.
Thank you!
The solution was to delete the semver directory.
I've just spent a long time trying to fix the same problem on my computer, after creating a new windows user.
I tried deleting the .gz-files, but for one of my plugins, the .gz-files was recreated every time I ran
$ ionic cordova run android
I tried different versions of android platform-tools, build-tools etc..
Different cordova versions.. Different node and npm versions.
I also messed around with the environment variables.
But what I finally discovered (and what I suspect caused the problem for me), was that I hadn't correctly cloned the repository from bitbucket.
I had used:
git clone
https://creators_username#bitbucket.org/creators_username/repository_name.git
instead of:
git clone
https://my_username#bitbucket.org/creators_username/repository_name.git
After cloning again, using my own username, everything seems well. And I haven't got any node_modules folders inside
platforms/android/assets/www
or it's subfolders. And my theory is, you're not supposed to.
Remove the build folder inside www and try again.. good luck.

Cannot launch AVD in emulator. ?android studio

my emulator is not runnnig and gives the error in image below
error image
and test at run window
C:\Users\Wahlah\AppData\Local\Android\sdk\tools\emulator.exe
-netdelay gprs -netspeed full -avd Nexus_4_API_21
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
terminate called after throwing an instance of 'std::logic_error'
what(): basic_string::_S_construct null not valid
and second error exist is this image
ERROR 2
I got the same problem with the same logged warnings and errors (and the alert as well).
Although from the first logged line (C:\...emulator.exe) it looked like the tools did find the emulator - my problem was resolved only after I followed this answer, and changed the ANDROID_SDK_ROOT environment variable (which pointed to a folder above the sdk instead to the sdk's folder itself).
So I changed it from
C:\Users\<username>\AppData\Local\Android
to
C:\Users\<username>\AppData\Local\Android\sdk
and... voila! The emulator is running properly.
I should note that I'm working on Windows and from the question it looks like AIR TRAVELS was as well.
I had the same problem and fixed it by selecting Cold Boot from the Tools > Android > AVD Manager > Edit > Show Advanced > Boot option from Quick Boot to Cold Boot.
Hope this helps.
You can fix this error, need configure the device again. Download all the necessary libraries through the SDK manager.

Exported APK Not Working

I've just published an app of mine to the Google Play Store and it seems that it keeps force closing and crashing on the users.
I am not asking for a solution as to why, but i am curious.
On eclipse i have the Emulator and the target API of my app was Android-19 (it's 17 now because i'm changing that to see if it'll help). And while in eclipse and while running the emulator, with several devices (tablets, nexus one and such) , and the app works perfectly fine.
My friend has sent me a screenshot and the message that comes up once they try to open the app is "Unfortunately, Data Tool has stopped."
Any brainstorming ideas?
-Colt
THIS ISSUE IS NOW FIXED!
Here's a way to locally test your app's release APK outside of Eclipse. It's written for Linux, but should be pretty close for other development hosts.
adb uninstall my.package.name; adb install -r my.package.apk && adb shell monkey -p my.package.name -s 0 1
This assumes the simplest case where you only have a single device connected. If you want a more versatile version that allows for easy switching between devices and/or versions, let me know and I'll add it.
Try building it without proguard first and test. If that works then its proguard configuration file issue.

assembleDebug error in Android Studio

I have updated to the latest Android SDK and set JAVA_HOME in .bash_profile using
export JAVA_HOME=$(/usr/libexec/java_home), and I'm getting the following error:
Error Gradle:
FAILURE: Could not determine which tasks to execute.
* What went wrong:
Task 'assembleDebug' not found in project ':CrystalBall'.
* Try:
Run gradle tasks to get a list of available tasks.
Error: Could not execute build using Gradle distribution
http://services.gradle.org/distributions/gradle-1.6-bin.zip
I've attached a screenshot:
What should I do?
The second error in your screenshot seems more important to me. You have to make sure, that the Android Studio is able to download and execute the gradle binary. If you are using a proxy you have to configure it in the Android Studio.
To check the gradle tasks, go to your project folder on the command line and type "gradlew tasks"
You can also configure a proxy for gradle. Just create a gradle.properties file in (your project folder) with these properties:
systemProp.http.proxyHost=www.example.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxy.com|localhost
I don't believe this is the issue the poster had, but for the benefit of others I'll add what I found as I was helping someone on Windows XP who was getting the same error.
It appears the issue in his case was that the path to the Android Studio project had spaces in it (since Windows XP uses the Documents and Settings directory). I had him generate a new project into a directory without spaces in it and it built and ran without problems. Might have actually been something else, but as usual it is best to avoid spaces in paths.

Categories

Resources