clojure-android / lein-droid

A Leiningen plugin for building Clojure/Android projects
Eclipse Public License 1.0
645 stars 56 forks source link

Can't install more than one lein-droid app onto my device #53

Closed krisc closed 11 years ago

krisc commented 11 years ago

I am using the app generated by the Tutorial as a template for my own app. It is exactly the same so far but with changed names (and target sdk "17"). The original app installs and runs just fine. When I run 'lein droid doall' on my copy there is an error on the install step:

Installing APK...
/home/kris/adt-bundle-linux-x86_64-20130522/sdk/platform-tools/adb -s TA30000IVO install -r /home/kris/src/myapp/target/myapp-debug.apk
3731 KB/s (2133932 bytes in 0.558s)
    pkg: /data/local/tmp/myapp-debug.apk
Failure [INSTALL_FAILED_OLDER_SDK]

Abort execution.

I wonder why this happens because it targets the same sdk as the app which does install. Is it because only one lein-droid app can be installed on a single device?

I am using: clojure-android 1.5.1-SNAPSHOT neko 3.0.0-SNAPSHOT lein 2.3.1 java 1.6.0_45

alexander-yakushev commented 11 years ago

Hi Kris,

I can certainly tell you that you can have more than one Clojure/Android application on your device, so the problem is not in this. Although I've never seen any error like this. What device are you using and what's its Android version?

krisc commented 11 years ago

Motorola Atrix Model Number: MB886 Android Version: 4.1.1

I tried changing the target sdk in project.clj to 16, 17, and then 18, and I get the same error.

alexander-yakushev commented 11 years ago

But it does work with the same project and target-sdk 15, doesn't it?

krisc commented 11 years ago

same error with target-sdk 15...

alexander-yakushev commented 11 years ago

Same here, can you do adb logcat while installing the application and see if there is anything interesting there?

krisc commented 11 years ago

During the Installing APK... part, adb logcat just exits. Here are the last few lines:

08-22 11:31:21.467   896   896 I SBar.NetworkController: onDataActivity: direction=4
08-22 11:31:41.118   728  1032 D PowerManagerService: acquireWakeLock flags=0x1 tag=RILJ
08-22 11:31:41.118   728  1090 D PowerManagerService: releaseWakeLock flags=0x1 tag=RILJ
08-22 11:31:41.128  1077  1077 D ModemStatsService: onSignalStrengthsChanged
08-22 11:31:41.128  1077  1077 D ModemStatsService: LTE, mRssi=-109
08-22 11:31:41.128   896   896 I SBar.NetworkController: onSignalStrengthsChanged SignalStrength: 99 0 -120 -160 -120 -1 -1 16 -109 -8 82 2147483647 gsm|lte 14 -82 0 true 4 4 0 0 2 0 0 0 5 5 5 5 5 0 0 0 level=2
08-22 11:31:41.138   896   896 I SBar.NetworkController: refreshSignalCluster: mobile: Signal=zz_moto_stat_sys_signal_5bar_2_fully Roaming=(none) mSimIconId=(none) Accessibility="Phone two bars.","Not roaming.",""
08-22 11:31:44.962   728 30448 D PowerManagerService: acquireWakeLock flags=0x1 tag=RILJ
08-22 11:31:44.962   728  1057 D PowerManagerService: releaseWakeLock flags=0x1 tag=RILJ
08-22 11:31:44.962  1077  1077 D ModemStatsService: onSignalStrengthsChanged
08-22 11:31:44.972  1077  1077 D ModemStatsService: LTE, mRssi=-105
krisc commented 11 years ago

I edited my AndroidManifest.xml and changed the minimum SDK version to the version of my phone:

  <uses-sdk android:minSdkVersion="16" />

Now it works :)

alexander-yakushev commented 11 years ago

Great to hear that! So, what was the value of minimal version, 17?

krisc commented 11 years ago

Yes, it was 17 then I changed it to 16. Do you know if there is a way to deal with this in project.clj or through other lein tools? I couldn't find anything in the docs.

alexander-yakushev commented 11 years ago

Well, by default it gets created with version 15, since now Neko uses Android 4.0+ extensively. I don't want to duplicate anything AndroidManifest.xml provides in project.clj, because AndroidManifest eventually ends up on the device. Also, project.clj specifies target version (which is the version everything is complied with) and minSdkVersion is a minimal version allowed (minSdk can be lower than targetSdk).

Although I should have recognized the error you where having before, this would solve a lot of trouble. Sorry for that.