clojure-android / neko

The Clojure/Android Toolkit
Other
297 stars 36 forks source link

Splash works, but doesn't display app name after changing minimumsdk. #5

Closed rhg closed 10 years ago

rhg commented 11 years ago

As it says in the title, I changed my app to use API level 10 and my previously fully working splash stopped changin 'Application Name' to the app's name. As an example on my account there is github.com/rhg/sandbox which displays the bug. Thank you for saving me from the horrors of java (well partly).

alexander-yakushev commented 11 years ago

It was related to a bug with bundling resources into Neko. I wasn't able to implement that reliably, so I gave up this idea and moved all the splash stuff into main application.

lein-droid 0.2.0-beta2 and neko 3.0.0-beta5 is a way to go now. You can check lein-droid/sample project to see how splash can be used right now (you will have to copy all resources and SplashActivity.java into your project). This is less elegant, but more solid and editable.

Please write back when you do this.

rhg commented 11 years ago

I keep getting package R not found. I did move SplashActivity.java to my package including the first line. Anything else to change?

alexander-yakushev commented 11 years ago

Compare your project with this sample https://github.com/clojure-android/lein-droid/tree/master/sample

It should SplashActivity.java, resources from res/ folder and slight changes to AndroidManifest.xml.

What is the exact error you are getting?

alexander-yakushev commented 11 years ago

Oh, and by the way, you can replace lein droid build && lein droid apk && lein droid install && lein droid run ... with just lein droid doall.

rhg commented 11 years ago

Thank you for the doall metatask suggestion, i added it.

These are the errors: http://pastebin.com/5vxHSDh7

I pushed my changes to a new branch: https://github.com/rhg/sandbox/tree/issue/neko5

also the splash does not spin before these changes.

alexander-yakushev commented 11 years ago

Agrh, stupid me, I forgot to push the changes to github.

Please copy resources, manifest and SplashActivity.java from here https://github.com/clojure-android/lein-droid/blob/master/sample . Change package name to your one, of course.

rhg commented 11 years ago

hmm, it builds with an import for my R class

EDIT: now it crashes on load with the logcat saying class not found: splashactivty

alexander-yakushev commented 11 years ago

Does your AndroidManifest.xml expects .SplashActivity or neko.splash.SplashActivity? It should be the former.

rhg commented 11 years ago

It is the former. On Aug 24, 2013 2:58 AM, "Alexander Yakushev" notifications@github.com wrote:

Does your AndroidManifest.xml expects .SplashActivity or neko.splash.SplashActivity? It should be the former.

— Reply to this email directly or view it on GitHubhttps://github.com/alexander-yakushev/neko/issues/5#issuecomment-23204849 .

alexander-yakushev commented 11 years ago

Meh... What if you just create a new project with the latest lein-droid 0.2.0-beta1, check if it works that way, and then add your changes?

rhg commented 11 years ago

now i get this: http://pastebin.com/RYcDpfJA. sigh i checked it has no typos in the names.

alexander-yakushev commented 11 years ago

Wait, damn, I let you down again. It is lein-droid '0.2.0-beta2. Try creating new project with it and see what happens. Also, I'm not sure, but can you omit numbers in package name?

Man, I'm so sorry that I wasted so much of your time.

rhg commented 11 years ago

It was already beta2, and also I did change the package name, nope same error. and no problem otherwise my repo would have no commits right now.

alexander-yakushev commented 11 years ago

OK, let's investigate step by step.

Do you have a file src/java/com/androidarea51/rhg135/sandbox/SplashActivity.java? What are its contents?

rhg commented 11 years ago

Not anymore, src/java/com/rhg/sandgbox/SplashActivity.java tho, https://github.com/rhg/sandbox/blob/issue/neko5/src/java/com/rhg/sandbox/SplashActivity.java

alexander-yakushev commented 11 years ago

Your SplashActivity.java still tries to call com.androidarea51.rhg135.sandbox.MAIN intent. In your AndroidManifest.xml file you have filter for test.leindroid.sample.MAIN. Bring them to the common value and try again.

rhg commented 11 years ago

Still no-go, but i did find lein droi complained about a class named com.rhg.sandbox, but on a clean compile it went fine. also i did fix that but the issue seems to be SplashActivity is not in the apk

EDIT: even on a new new project it fails with the same exception

alexander-yakushev commented 11 years ago

In your main.clj there is a line

(defactivity com.rhg.sandbox

How about putting an activity name there? :-) Just to be sure, here's what it should look like:

(defactivity com.rhg.sandbox.RadioControllerActivity
rhg commented 11 years ago

Still no, but interestingly a brand new app from lein-droid beta2 also crashes, which means either my device is acting weird or the template is broken. On Aug 27, 2013 1:16 PM, "Alexander Yakushev" notifications@github.com wrote:

In your main.clj there is a line

(defactivity com.rhg.sandbox

How about putting an activity name there? :-) Just to be sure, here's what it should look like:

(defactivity com.rhg.sandbox.RadioControllerActivity

— Reply to this email directly or view it on GitHubhttps://github.com/alexander-yakushev/neko/issues/5#issuecomment-23358382 .

alexander-yakushev commented 11 years ago

A brand new app created with beta2 works on both my devices. Can you try it on emulator? Also, what is the exact error right now?

rhg commented 11 years ago

Still no, i tried on 4.1 to be sure and still same classnotfound exception, https://www.refheap.com/18165

At this point i may just skip the splash or code it myself in java. :(

On Thu, Aug 29, 2013 at 7:15 PM, Alexander Yakushev < notifications@github.com> wrote:

A brand new app created with beta2 works on both my devices. Can you try it on emulator? Also, what is the exact error right now?

— Reply to this email directly or view it on GitHubhttps://github.com/alexander-yakushev/neko/issues/5#issuecomment-23532917 .

alexander-yakushev commented 11 years ago

This is really sick right now. What version of SDK Build Tools do you use?

rhg commented 11 years ago

18.0.1 On Aug 29, 2013 7:56 PM, "Alexander Yakushev" notifications@github.com wrote:

This is really sick right now. What version of SDK Build Tools do you use?

— Reply to this email directly or view it on GitHubhttps://github.com/alexander-yakushev/neko/issues/5#issuecomment-23534296 .

alexander-yakushev commented 11 years ago

Do you have a file com/aa51/sandbox/SplashActivity.class in your target folder?

rhg commented 11 years ago

yes

On Fri, Aug 30, 2013 at 9:15 AM, Alexander Yakushev < notifications@github.com> wrote:

Do you have a file com/aa51/sandbox/SplashActivity.class in your target folder?

— Reply to this email directly or view it on GitHubhttps://github.com/alexander-yakushev/neko/issues/5#issuecomment-23563836 .

alexander-yakushev commented 11 years ago

OK, now we should figure out if the class is present in the APK. Can you download this tool https://code.google.com/p/android-apktool/ and look for SplashActivity.smali in the contents of the application? The command goes like this:

java -jar apktool.jar d someapk-debug.apk
alexander-yakushev commented 10 years ago

@rhg, I wonder if you were able to solve this strange problem. Can you comment, please?

rhg commented 10 years ago

I wasn't but in the end I figured while clj is great, the startup time, size, and the fact I'm not good at making apps nor at clj makes it a bad idea. Haven't made any app since. On Jan 19, 2014 2:55 PM, "Alexander Yakushev" notifications@github.com wrote:

@rhg https://github.com/rhg, I wonder if you were able to solve this strange problem. Can you comment, please?

— Reply to this email directly or view it on GitHubhttps://github.com/alexander-yakushev/neko/issues/5#issuecomment-32719617 .

alexander-yakushev commented 10 years ago

I see. Well, maybe someday when we'll are able to improve the startup time I will welcome you back! Sorry for the time you had to waste.

Meanwhile I close the issue as "can't reproduce".