Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android

Running App on my Android device.

I am trying to get my app to run on my Galaxy s5, I originally had an error in my Android Manifest, it would appear that i fixed that issue with help, however, when i ran the program, the 'edit configuration' window opened and i selected the following:

Module--> App

Package--> Deploy Default APK

Activity--> Launch default Activity

Target Device--> USB Device

It then (upon running the app) said that my configurations were still not correct. Should that window have even popped up and if so what should i have put?

3 Answers

George Pirchalaishvili
George Pirchalaishvili
3,747 Points

Have you configured your phone to work in debugger mode? Once you do so, it should be listed in devices tab.

http://www.androidcentral.com/how-enable-samsung-galaxy-s5-developer-options

Hope this helps :)

yes i enabled the developer options and it shows my device in the device tab but when i click run that 'edit configuration window pops up:/

George Pirchalaishvili
George Pirchalaishvili
3,747 Points

it should not hmmm. Are you sure you enabled both - Debugged mode and Allow mock location?

if yes, try removing drivers for your phone, install new ones and restart PC.

im not sure i allowed mock locations let me check that

When i run the app and skip that page that pops up i receive this:

Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Users\Terence\Downloads\android-studio-bundle-windows\android-studio\sdk\build-tools\android-4.4W\dx.bat --dex --num-threads=4 --output C:\Users\Terence\Dropbox\FunFacts\app\build\intermediates\dex\debug C:\Users\Terence\Dropbox\FunFacts\app\build\intermediates\classes\debug C:\Users\Terence\Dropbox\FunFacts\app\build\intermediates\dependency-cache\debug Error Code: 1 Output: Exception in thread "pool-1-thread-2" Exception in thread "pool-1-thread-5" Exception in thread "pool-1-thread-8" Exception in thread "pool-1-thread-7" Exception in thread "pool-1-thread-3" Exception in thread "pool-1-thread-4" Exception in thread "pool-1-thread-1" Exception in thread "pool-1-thread-10" com.android.dx.cf.iface.ParseException: class name (gage_tillery/funfacts/R$drawable) does not match path (Gage_Tillery/funfacts/R$drawable.class) at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:520) at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406) at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388) at com.android.dx.cf.direct.DirectClassFile.getMagic(DirectClassFile.java:251) at com.android.dx.command.dexer.Main.processClass(Main.java:665) at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634) at com.android.dx.command.dexer.Main.access$600(Main.java:78) at com.android.dx.command.dexer.Main$ParallelProcessor.run(Main.java:1546) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) ...while parsing Gage_Tillery/funfacts/R$drawable.class no classfiles specified Exception in thread "pool-1-thread-6" com.android.dx.cf.iface.ParseException: class name (gage_tillery/funfacts/R$string) does not match path (Gage_Tillery/funfacts/R$string.class) at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:520) at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406) at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)

I dont know if you could help with that because im way too inexperienced to know what to do with that