[Q] installing of app on device failed - Android Studio

I've recently returned to work on an app I developed while ago (targeted then to 4.4). at the time I had a galaxy s2 for debugging and now I have s4 (i9500).
I tried to run the app while my phone connected and got installation failed. So I installed Android studio and imported (converted) and changed target to 5.0.1 (my phone's version).
When I hit run (or debug) I get this message:
HTML:
nstalling myapp.leff.app
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/myapp.leff.app"
Aborted
Launching application: myapp.leff.app/myapp.leff.app.myappAppActivity.
DEVICE SHELL COMMAND: am start -n "myapp.leff.app/myapp.leff.app.myappAppActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Aborted
filltering the log-cat (Android) i've noticed this lines:
HTML:
06-24 02:20:34.641 3269-3685/? D/SettingsProvider﹕ name = verifier_verify_adb_installs
06-24 02:21:30.331 3576-3576/? W/Settings﹕ Setting install_non_market_apps has moved from android.provider.Settings.Global to android.provider.Settings.Secure, returning read-only value.
06-24 02:21:30.426 3576-3576/? W/Settings﹕ Setting install_non_market_apps has moved from android.provider.Settings.Global to android.provider.Settings.Secure, returning read-only value.
06-24 02:21:46.231 9094-9094/? I/MultiDex﹕ install
06-24 02:21:46.261 9094-9094/? I/ProviderInstaller﹕ Insert disabled by gate 'gms:security:enable_conscrypt_in_gms_application'
06-24 02:21:49.656 3576-3576/? W/Settings﹕ Setting install_non_market_apps has moved from android.provider.Settings.Global to android.provider.Settings.Secure, returning read-only value.
06-24 02:21:49.716 3576-3576/? W/Settings﹕ Setting install_non_market_apps has moved from android.provider.Settings.Global to android.provider.Settings.Secure, returning read-only value.
06-24 02:22:00.016 3269-3269/? I/ActivityManager﹕ Killing 4849:com.samsung.android.app.filterinstaller/1000 (adj 15): empty for 1806s
I've re-installed new version of my custom rom - result is the same
I took another phone (samsung s5) and install was success. connected my s4 again. same error.
And ideas on how to resolve this?
note: usb-debugging is active

Hello,
Your project before conversion was built with Eclipse, if I understood it correctly? If so,
in Android Studio, the API targeting is not being read from the Android Manifest, but from the Gradle files.
In Android Studio, open (on your Project tree on the left), under the Gradle Scripts the build.gradle (Module: app) and check if inside the defaultConfig the targetSdkVersion has the correct API level. Then, press Build->Clean project from the menu bar on the top
If your application works with this String: INSTALL_NON_MARKET_APPS from the Settings.Global class , it is deprecated in API level 21, so use INSTALL_NON_MARKET_APPS from the Settings.Secure class instead. Check here.
I think it has to do with this class, the getString method with the above String that has been deprecated. I could help you further if I knew how is your app accessing this class or any code related to that
The S5 you tested has custom rom? Can you post the full logcat with the S4?
If you still need help, let me know

Related

[Q]what are mount points ,there use and how to set them for specific devices!

I have a kindle fire hd 7 and i have been trying to get Linux on my tablet for learning Linux at an introductory level. The terminal though keeps telling me that there are no user defines mount points!!! Although Linux works through the terminal.....I am unable to get GUI rendering using android vnc please help me out
Here is the code
[email protected]:/ $
[email protected]:/ $ cd /sdcard/debian
[email protected]:/sdcard/debian $ su
sh /data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh /sdcard/debian/debian.img
sh /data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh /sdcard/debian/debian.img
h /data/data/com.zpwebsites.linuxonandroid/files/bootscript.sh /sdcard/debian/debian.img <
Checking loop device... MISSING
Creating loop device... OK
mount: mounting /storage on /data/local/mnt/external_sd failed: Invalid argument
No user defined mount points
net.ipv4.ip_forward = 1
Config file not found, using defaults!(/root/cfg/debian.img.config)
Starting first boot setup.......
Creating User account (named debian)
Adding user `debian' ...
Adding new group `debian' (1000) ...
Adding new user `debian' (1000) with group `debian' ...
Creating home directory `/home/debian' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for debian
Enter the new value, or press ENTER for the default
Full Name []: aman srivastab
Room Number []:
Work Phone []: 8898016729
Home Phone []:
Other []:
Is the information correct? [Y/n] y
usermod: unknown group admin
chown: cannot access `external_sd': No such file or directory
Start VNC server? (y/n)
y
Start SSH server? (y/n)
y
Now enter the screen size you want in pixels (e.g. 800x480), followed by [ENTER]:
1280x800
xauth: creating new authority file /home/debian/.Xauthority
New 'X' desktop is localhost:0
Starting applications specified in /home/debian/.vnc/xstartup
Log file is /home/debian/.vnc/localhost:0.log
If you see the message 'New 'X' Desktop is localhost:0' then you are ready to VNC into your debian OS..
If connection from a different machine on the same network as the android device use the address below:
eth0: error fetching interface information: Device not found
If using androidVNC, change the 'Color Format' setting to 24-bit colour, and once you've VNC'd in, change the 'input mode' to touchpad (in settings)
Starting OpenBSD Secure Shell server: sshd.
Save settings as defaults? (y/n) (You can always change it later in the app)
y
Config saved to /root/cfg/debian.img.config
To shut down the Linux environment, just enter 'exit' at this terminal - and WAIT for all shutdown routines to finish!
localhost:~#
I think its a GUI rendering problem with the debian.img file and not the mount point error but I still want to understand how to mount to system and stuff like that . please help out!!!!

Read-only file system on Virtual Device

I am trying to get a simple "Hello World" app running in Android Studio but am having a surprising amount of trouble. My current issue seems to be that Android Studio is unable to write to the virtual device. Although my virtual device takes a long time to start up it does eventually get going and seems to present as 'working'.
The output for the device in the "Run" windows shows:
C:\Users\Slarti\AppData\Local\Android\sdk\tools\emulator.exe -netdelay none -netspeed full -avd Nexus_5_API_23_x86
emulator: device fd:928
HAXM is working and emulator runs in fast virt mode
creating window 43 59 329 583
emulator: emulator window was out of view and was recentered
emulator: UpdateChecker: skipped version check​However the output in the "app" log of the "Run" window reads:
Target device: Nexus_5_API_23_x86 [emulator-5554]
Installing APK: C:\Users\Slarti\Documents\...
Uploading file to: /data/local/tmp/...
com.android.ddmlib.SyncException: Read-only file system​
and the "Event Log" shows:
2:01:53 PM Gradle sync started
2:04:30 PM Gradle sync completed
2:04:35 PM Executing tasks: [:app:generateDebugSources, :app:generateDebugAndroidTestSources]
2:04:56 PM Gradle build finished in 25s 136ms
2:10:33 PM Unable to obtain result of 'adb version'
2:11:03 PM Executing tasks: [:app:assembleDebug]
2:11:40 PM Gradle build finished in 36s 851ms
2:11:43 PM transfer error: Read-only file system
2:11:43 PM Error during Sync: Read-only file system​
I've spent a lot of time searching for a solution for this, including re-installing Android Studio but I still keep having the same problem. Does anyone know what could be causing this and how I can fix it? The program itself is a very simple "Hello World!" program and I have left most things in Android Studio at their default values but clearly something somewhere must be set incorrectly. Any ideas as to what it could be?
Thanks for any help,
Slarti.

[Solved] ERROR: 32-bit Linux Android emulator binaries are DEPRECATED

Hello,
I am taking my first steps into trying to create an Android app.
In installed Android Studio 1.5.1 on Linux Mint 17.3 (kernel 3.19.0-32-generic, 64-bit). JRE version is 1.7.0_95-b00 amd64 (according to the about box).
I try to run the app in the emulator. I have created a virtual device, with the following details:
Code:
Name: Moto_X_Play_API_23
CPU/ABI: Google APIs Intel Atom (x86_64)
Path: /home/gewe/.android/avd/Moto_X_Play_API_23.avd
Target: Google APIs (API level 23)
Skin: nexus_5x
Snapshot: no
hw.lcd.density: 400
hw.dPad: no
avd.ini.encoding: UTF-8
hw.camera.back: none
disk.dataPartition.size: 200M
hw.gpu.enabled: yes
runtime.network.latency: none
skin.dynamic: yes
hw.keyboard: yes
runtime.network.speed: full
hw.device.hash2: MD5:3f75bdae5e6cbfeae9214f0ae67b97b4
hw.ramSize: 1536
tag.id: google_apis
tag.display: Google APIs
hw.sdCard: yes
hw.device.manufacturer: User
hw.mainKeys: no
hw.accelerometer: yes
hw.trackBall: no
hw.device.name: Moto X Play
hw.sensors.proximity: yes
hw.battery: yes
AvdId: Moto_X_Play_API_23
hw.sensors.orientation: yes
hw.audioInput: yes
hw.camera.front: none
hw.gps: yes
avd.ini.displayname: Moto X Play API 23
snapshot.present: no
vm.heapSize: 64
runtime.scalefactor: auto
If I select this virtual device I get the following error message:
Code:
Cannot launch AVD in emulator.
Output:
WARNING: Cannot decide host bitness because $SHELL is not properly defined; 32 bits assumed.
ERROR: 32-bit Linux Android emulator binaries are DEPRECATED, to use them
you will have to do at least one of the following:
- Use the '-force-32bit' option when invoking 'emulator'.
- Set ANDROID_EMULATOR_FORCE_32BIT to 'true' in your environment.
Either one will allow you to use the 32-bit binaries, but please be
aware that these will disappear in a future Android SDK release.
Consider moving to a 64-bit Linux system before that happens.
I downloaded an example app, but that results in the same error.
Why does Android Studio or the emulator think it is running on a 32-bit system?
How can I get rid of this error?
The emulator uses the shell to define if you are running a 32 or 64 bits machine.
The $SHELL environment variable doesn't seem to be defined in your case
Try to launch Android Studio from a terminal:
Code:
$ <YOUR_ANDROID_STUDIO_INSTALL_DIR>/bin/studio.sh
If this works, try to create a menu entry starting the following command:
/bin/bash <YOUR_ANDROID_STUDIO_INSTALL_DIR>/bin/studio.sh
I am running Android Studio from a terminal, I don't have a menu entry for it.
If I change the command into
Code:
export SHELL=/bin/bash && android-studio/bin/studio.sh
the emulator runs fine.
Another account on the same machine has the environment variable SHELL set automatically. Both accounts do not have a .bashrc in their home directory. The both have identical .pam_environment and .profile files.
From where could it have been set?
gewe said:
I am running Android Studio from a terminal, I don't have a menu entry for it.
If I change the command into
Code:
export SHELL=/bin/bash && android-studio/bin/studio.sh
the emulator runs fine.
Another account on the same machine has the environment variable SHELL set automatically. Both accounts do not have a .bashrc in their home directory. The both have identical .pam_environment and .profile files.
From where could it have been set?
Click to expand...
Click to collapse
Well AFAIK, the SHELL environment variable is set by the shell executable itself when it starts. It looks like something unsets it on your system.
You already checked the 3 files that came to my mind.
Maybe one of the global environment file (/etc/environment, /etc/bash.bashrc, /etc/profile or /etc/profile.d/*) But I doubt it as you would have the same issue with your other account
With some help from the Linux Mint forum the problem is solved. In /etc/passwd some accounts did not have a default shell specified. Adding that solved the problem.
Thanks for pointing me in the right direction!

A problem occurred configuring project

I am trying to compile some C++ source files into a native library using Android studio, NDK and Cmake, but upon building, I get the error:
Code:
A problem occurred configuring project ':mobile'.
> C:\Users\User\Documents\B3d\mobile\.externalNativeBuild\cmake\debug\armeabi-v7a\compile_commands.json
I went to the folder mentioned in the error and 'compile_commands.json' does not exist there. What could be the problem?
After upgrading gradle plugin, I get the error:
Code:
C:\Users\User\Documents\B3d\mobile\CMakeLists.txt : C/C++ debug|armeabi-v7a : Could not get version from cmake.dir path '"C:\Android\android-sdk\cmake\3.19.0"'.
I removed the quotes from cmake.dir path in local.properties and this error was gone, next I got another error:
Code:
exception while building Json $C:\Users\User\Documents\B3d\tv\.cxx\cmake\debug\armeabi-v7a\compile_commands.json (The system cannot find the file specified)

Android Studio 4.1.1 has built- in compilation failures

I have installed the latest Android Studio onto a new machine, and have installed Flutter plugin into the new installation. I then created a Flutter project, taking all the default settings.
After creating the project, I set up an emulator and tried to compile and run the flutter app. Unfortunately I get the following error:
Code:
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\rbrown3\AndroidStudioProjects\flutter_app\android\build.gradle' line: 26
* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
> Uninitialized object exists on backward branch 142
Exception Details:
Location:
com/android/build/gradle/internal/pipeline/VariantInfoImpl.<init>(Lcom/android/build/gradle/internal/scope/VariantScope;)V @200: goto
Reason:
Error exists in the bytecode
Bytecode:
...bytecode listing omitted for brevity...
Note that I also took a look at the build.gradle file that contained the offending line . Line 26 just contains:
Code:
project.evaluationDependsOn(':app')
I did not edit that line at all. In fact, I did not change anything, not even in the main.dart file.
Have I found a bug in the Flutter plugin? Or is it an Android Studio bug? Why does a pristine installation of Android Studio fail to compile default code due to a flaw in a gradle build file??? More importantly, what is the flaw causig these compilation failures and how do I fix it?

Categories

Resources