sbt-android简单示例失败,“[错误]没有找到动作'android.intent.action.MAIN'”

时间:2016-08-07 19:04:46

标签: android sbt-android

知道如何解决这个问题吗?

主分支:

> android:test
[warn] [UnusedAttribute] src/main/AndroidManifest.xml:13:Attribute installLocation is only used in API level 8 and higher (current min is 7)
[warn]                  android:installLocation="auto">
[warn]                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[warn] lint found 1 warning
[info] Packaging resources: resources-debug.ap_
[warn] Warning: AndroidManifest.xml already defines debuggable (in http://schemas.android.com/apk/res/android); using existing value in manifest.
[info] Finding dependency references for: classes.jar
ProGuard, version 5.0
ProGuard is released under the GNU General Public License. You therefore
must ensure that programs that link to it (android, ...)
carry the GNU General Public License as well. Alternatively, you can
apply for an exception with the author of ProGuard.
Reading input...
Reading program jar [/Users/joco/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.2.jar] (filtered)
Reading program jar [/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/classes.jar] (filtered)
Reading library jar [/Users/joco/Library/Android/sdk/platforms/android-17/android.jar]
Initializing...
Ignoring unused library classes...
  Original number of library classes: 3259
  Final number of library classes:    429
Shrinking...
Removing unused program classes and class elements...
  Original number of program classes: 3896
  Final number of program classes:    589
Writing output...
Preparing output jar [/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/proguard/classes.proguard.jar]
  Copying resources from program jar [/Users/joco/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.2.jar] (filtered)
  Copying resources from program jar [/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/classes.jar] (filtered)
[info] Creating proguard cache: proguard-cache-bc48b41614facee8c23102b3a1a44318045dcb99.jar
[info] Generating dex, incremental=false, multidex=false
[info] dex method count: 4260
[info] Packaged: hello-world-debug-unaligned.apk (150.65KB)
[info] Debug package does not need signing: hello-world-debug-unaligned.apk
[info] zipaligned: hello-world-debug.apk
[info] Installing to Android SDK built for x86_64 (emulator-5554)...
[info] [hello-world-debug.apk] Install finished: 150.65KB in 1.02s. 148.42KB/s
[info] Testing on Android SDK built for x86_64 (emulator-5554)...
[success] Total time: 10 s, completed Aug 7, 2016 9:47:03 PM
> android:run
[warn] [UnusedAttribute] src/main/AndroidManifest.xml:13:Attribute installLocation is only used in API level 8 and higher (current min is 7)
[warn]                  android:installLocation="auto">
[warn]                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[warn] lint found 1 warning
[info] [debug] cache hit, skipping proguard!
[info] Generating dex, incremental=false, multidex=false
[info] dex method count: 4515
[info] Packaged: hello-world-debug-unaligned.apk (169.32KB)
[info] Debug package does not need signing: hello-world-debug-unaligned.apk
[info] zipaligned: hello-world-debug.apk
[info] Installing to Android SDK built for x86_64 (emulator-5554)...
[info] [hello-world-debug.apk] Install finished: 169.32KB in 1.10s. 153.37KB/s
[error] No activity found with action 'android.intent.action.MAIN'
[error] (android:run) No activity found with action 'android.intent.action.MAIN'
[error] Total time: 4 s, completed Aug 7, 2016 9:48:05 PM
> pwd
[error] Not a valid command: pwd (similar: pidcat, append)
[error] Not a valid project ID: pwd
[error] Expected ':' (if selecting a configuration)
[error] Not a valid key: pwd (similar: dex, doc, update)
[error] pwd
[error]    ^
> exit
bash-3.2$ pwd
/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout
bash-3.2$ sbt
[info] Loading global plugins from /Users/joco/.sbt/0.13/plugins
[info] Set current project to hello-world (in build file:/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/)
> android:package-rel
{invalid input}
> android:package-relea
{invalid input}
> android:package-release
[info] Compiling 3 Scala sources and 2 Java sources to /Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/classes...
[warn] [UnusedAttribute] src/main/AndroidManifest.xml:13:Attribute installLocation is only used in API level 8 and higher (current min is 7)
[warn]                  android:installLocation="auto">
[warn]                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[warn] lint found 1 warning
[info] Packaging resources: resources-release.ap_
[info] Packaging /Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/classes.jar ...
[info] Done packaging.
ProGuard, version 5.0
ProGuard is released under the GNU General Public License. You therefore
must ensure that programs that link to it (android, ...)
carry the GNU General Public License as well. Alternatively, you can
apply for an exception with the author of ProGuard.
Reading input...
Reading program jar [/Users/joco/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.2.jar] (filtered)
Reading program jar [/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/classes.jar] (filtered)
Reading library jar [/Users/joco/Library/Android/sdk/platforms/android-17/android.jar]
Initializing...
Ignoring unused library classes...
  Original number of library classes: 3259
  Final number of library classes:    429
Shrinking...
Removing unused program classes and class elements...
  Original number of program classes: 3896
  Final number of program classes:    589
Writing output...
Preparing output jar [/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/proguard/classes.proguard.jar]
  Copying resources from program jar [/Users/joco/.ivy2/cache/org.scala-lang/scala-library/jars/scala-library-2.11.2.jar] (filtered)
  Copying resources from program jar [/Users/joco/dev/android/scala/sbt-android/sbt-android/sbt-test/android-sdk-plugin/hello-world-scala-gradle-layout/target/android/intermediates/classes.jar] (filtered)
[info] Generating dex, incremental=false, multidex=false
[info] dex method count: 4260
[info] Packaged: hello-world-release-unsigned.apk (149.21KB)
[warn] Package needs signing: hello-world-release-unsigned.apk
[warn] Package needs signing and zipaligning: hello-world-release-unsigned.apk
[success] Total time: 14 s, completed Aug 7, 2016 9:51:46 PM
> android:run
[warn] [UnusedAttribute] src/main/AndroidManifest.xml:13:Attribute installLocation is only used in API level 8 and higher (current min is 7)
[warn]                  android:installLocation="auto">
[warn]                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[warn] lint found 1 warning
[info] classes.proguard.jar is up-to-date
[info] Packaged: hello-world-release-unsigned.apk (149.21KB)
[warn] Package needs signing: hello-world-release-unsigned.apk
[warn] Package needs signing and zipaligning: hello-world-release-unsigned.apk
[info] Installing to Android SDK built for x86_64 (emulator-5554)...
[error] Install failed: INSTALL_PARSE_FAILED_NO_CERTIFICATES
[error] (android:install) Install failed: INSTALL_PARSE_FAILED_NO_CERTIFICATES
[error] Total time: 2 s, completed Aug 7, 2016 9:51:58 PM

1.6.10版本:http://lpaste.net/174900

编辑:

向local.properties添加了关键信息(如第8点here所示),现在我得到了:

> android:run
[warn] [UnusedAttribute] src/main/AndroidManifest.xml:13:Attribute installLocation is only used in API level 8 and higher (current min is 7)
[warn]                  android:installLocation="auto">
[warn]                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[warn] lint found 1 warning
[info] [debug] cache hit, skipping proguard!
[info] Packaged: hello-world-debug-unaligned.apk (27.52KB)
[info] Debug package does not need signing: hello-world-debug-unaligned.apk
[info] zipaligned: hello-world-debug.apk
[info] Installing to Android SDK built for x86_64 (emulator-5554)...
[info] [hello-world-debug.apk] Install finished: 27.52KB in 0.89s. 30.99KB/s
[error] No activity found with action 'android.intent.action.MAIN'
[error] (android:run) No activity found with action 'android.intent.action.MAIN'
[error] Total time: 1 s, completed Aug 7, 2016 10:22:11 PM

可能是什么问题?

0 个答案:

没有答案