问题
I just started trying to develop a simple hello world android app. Since I am using an AMD processor the default emulator that comes with Android Studio isn't working so I have setup genymotion emulator.
I did a new project with just hello world written in it. But when I try to deploy it in the emulator I am getting the following error
Unexpected error: package manager reports that package in.techbreeze.android.hello has not been installed: Expected string 'Package [in.techbreeze.android.hello]' not found in output: Can't find service: package
Detail error message reads:
Unexpected error: package manager reports that package in.techbreeze.android.hello has not been installed: Expected string 'Package [in.techbreeze.android.hello]' not found in output: Can't find service: package
java.lang.Throwable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:113)
at com.android.tools.idea.run.InstalledApks.setInstalled(InstalledApks.java:86)
at org.jetbrains.android.run.AndroidRunningState.uploadAndInstallApk(AndroidRunningState.java:1205)
at org.jetbrains.android.run.AndroidRunningState.doPrepareAndStart(AndroidRunningState.java:920)
at org.jetbrains.android.run.AndroidRunningState.prepareAndStartApp(AndroidRunningState.java:874)
at org.jetbrains.android.run.AndroidRunningState.prepareAndStartAppWhenDeviceIsOnline(AndroidRunningState.java:842)
at org.jetbrains.android.run.AndroidRunningState.doStart(AndroidRunningState.java:676)
at org.jetbrains.android.run.AndroidRunningState.start(AndroidRunningState.java:652)
at org.jetbrains.android.run.AndroidRunningState$1.run(AndroidRunningState.java:298)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:419)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:149)
What is the probable cause of this error? Is some configuration missing from my end?
回答1:
You may :
Update your IDE to latest one (such as Android studio 1.0.1)
Change your build.gradle
to something like this:
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.example.hellomap"
minSdkVersion 14
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:21.0.0'
compile 'com.google.android.gms:play-services:6.5.+'
compile 'com.jakewharton:butterknife:6.0.0'
}
Make sure you have latest buildToolsVersion
such that 21.1.1
来源:https://stackoverflow.com/questions/27535188/unable-to-deploy-basic-android-app