Android help.

Hello.
I have error when compiling my android app.




Waiting for device.
Target device: emulator-5554 (MyAvd1)
Launching application: com.example/com.example.MyActivity2.
DEVICE SHELL COMMAND: am start -n "com.example/com.example.MyActivity2"
Starting: Intent { cmp=com.example/.MyActivity2 }
Error type 3
Error: Activity class {com.example/com.example.MyActivity2} does not exist.



I have MyActivity2 Class and it is located in com.example
myActivity.png
Also it is defined in androidManifest

<activity android:name="MyActivity2" android:label="@string/app_name">             <intent-filter>                 <action android:name="android.intent.action.MAIN" />                 <category android:name="android.intent.category.LAUNCHER" />             </intent-filter>         </activity>



This project should work, i got it from my friend and he made it in eclipse, it compiles there.
Have i missed some intellij related config for android?
Thank you for any help.
6 comments
Comment actions Permalink

You should use <activity android:name=".MyActivity2" ...> (notice the dot before the class name).

0
Comment actions Permalink

Hello.
Thank you for your help, but now i get the same error


Launching application: com.example/com.example.MyActivity2.
DEVICE SHELL COMMAND: am start -n "com.example/com.example.MyActivity2"
Starting: Intent { cmp=com.example/.MyActivity2 }
Error type 3
Error: Activity class {com.example/com.example.MyActivity2} does not exist.

0
Comment actions Permalink

Can you verify that the APK is being built correctly? It should be in your "bin" folder, named after your application (e.g., MyApp.apk). If not, something is preventing the apk from being generated. Check your run configuration and make sure the "Make" checkbox in the "Before Launch" section is set. The "Deploy application" checkbox must be marked as well, or the apk won't be copied to your device.

0
Comment actions Permalink

Hi.
My bin folder was empty.
"Make" checkbox was ok.
But "Deploy application" was not marked, i marked it and now it runs.
I thought thtat "Deploy application" was option to deploy to your "real" android device.
Anyway it works now BUT bin folder is still empty there is no *.apk file anywhere in project.

0
Comment actions Permalink

The apk is probably being generated in a temporary folder then, I couldn't remember if this was the case. Anyway, I'm glad it's working for you now!

0
Comment actions Permalink

The APK file is created under the directory you specified as your Project compiler output. If you imported an Eclipse project it probably won't be bin. Open the Project Structure dialog then select Project under Project Settings. You will find the setting there.

Grant

0

Please sign in to leave a comment.