Android Question Error installing file to device

DrAlex

Member
Licensed User
Longtime User
Hello,

For several months I was successfully using an HTC One to debug my program. All of the sudden today I cannot install the file to device.

I get the following error:

4A version: 5.50
Parsing code. (0.11s)
Compiling code. (1.30s)
Compiling layouts code. (0.28s)
Generating R file. (0.24s)
Compiling debugger engine code. (1.84s)
Compiling generated Java code. (2.36s)
Convert byte code - optimized dex. (1.96s)
Packaging files. (0.44s)
Copying libraries resources (0.21s)
Found 6 resource files.
Signing package file (debug key). (0.47s)
ZipAlign file. (0.51s)
Installing file to device. Error
pkg: /data/local/tmp/RootsNOffspring_RAPID_DEBUG.apk
Failure [INSTALL_FAILED_UID_CHANGED]

I have built a new build configuration. Then the error has changed to INSTALL_FAILED_DEXOPT. Then I have restarted ADB, and the error became INSTALL_FAILED_UID_CHANGED again.
 

JordiCP

Expert
Licensed User
Longtime User
Do you have a backup of the latest version that you could upload correctly to the device?

Try installing this, then uninstall, and try again with the current one...
 
Upvote 0

DrAlex

Member
Licensed User
Longtime User
Do you have a backup of the latest version that you could upload correctly to the device?

Try installing this, then uninstall, and try again with the current one...

I do have a program, which uploads correctly to the device, but if I add the Phone library, it fails. If I remove the Phone library, it's OK again.
 
Upvote 0

DrAlex

Member
Licensed User
Longtime User
It is hard to believe. I could debug successfully on both HTC phones until about a month ago. Then I took a break, and when I returned to using B4A about a week ago, the problem started. There were no upgrades on HTC One, since it is used for debugging my program only. There is also no antivirus on it.

I have tried also to run the sample program on Asus Transformer Pad TF700T (Android version 4.2.1), using B4A-Bridge. Here I could not install the sample program either with the Phone library or without it.

If you live not far away, maybe I could come to you with my devices. Please call me at 054-5493619.
 
Upvote 0

James Chamblin

Active Member
Licensed User
Longtime User
One thing you might try. Uninstall all versions of B4A you have currently installed. If you have an additional libraries folder, rename it temporarily. After uninstalling, go into the B4A install folder in Program Files(x86)\AnywhereSoftware (or wherever you decided to install) and make sure ALL files and sub-directories have been removed. If anything remains, delete them by hand. Sometimes Windows will randomly lock a file, keeping it from being removed or properly upgraded. If the file wont delete, right-click the file and select properties, make sure the Read Only attribute is not checked. Once all the files have been deleted, try reinstalling B4A. If your project needs libraries not included with B4A, try downloading a fresh copy if you can, otherwise copy only that library from your temporarily renamed additional libraries folder to a new one.

I know that's a lot of work there, but sometimes it is what it takes to fix a problem. If after that, you still can't get things working then I'm not sure what you can do. Do you have access to another computer where you can install B4A? Might be able to eliminate whether it is the computer, or the B4A installation.
 
Upvote 0

DrAlex

Member
Licensed User
Longtime User
I have installed B4A and all prerequisites on my ancient XP laptop, which until now was never used for Android development. Alas, same problem: without the Phone library the sample MySQL program installs and runs smoothly; with the Phone library it fails.
 
Upvote 0

DrAlex

Member
Licensed User
Longtime User
I have tried what you suggested, and it failed with the same error message, INSTALL_FAILED_DEXOPT:

C:\Android\android-sdk\platform-tools>adb install -r D:\Familia\Android\MySql\Objects\MySQL.apk
516 KB/s (9051 bytes in 0.017s)
pkg: /data/local/tmp/MySQL.apk
Failure [INSTALL_FAILED_DEXOPT]

I have the same version of the Phone library, 2.27.

Mine is also a very small app, borrowed from the B4A site. Maybe I shall send it to you?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Please create a new project with this code:
B4X:
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.

End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
   Dim p As Phone
   Msgbox(p.Manufacturer, p.SdkVersion)
End Sub

Try to run it in Release mode. I assume that it will fail. Then upload the apk to this thread.

BTW, are you using the debug key or a different signing key?
 
Upvote 0

DrAlex

Member
Licensed User
Longtime User
I have followed your instructions, and indeed the app could not install.

I attach the apk file.

I am using the debug key.
 

Attachments

  • CheckPhone.apk
    7.4 KB · Views: 138
Upvote 0

DrAlex

Member
Licensed User
Longtime User
I have reinstalled the Android SDK to a new folder, reconfigured paths in the IDE, and still get the same problem (actually, that has not surprised me, as I have already installed the full set of tools on another computer and got the same problem).

I also see that the classes.dex size is 0.
 
Last edited:
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…