Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android project data directory is hardcoded #10

Open
chriscoderdr opened this issue Jul 2, 2017 · 2 comments
Open

Android project data directory is hardcoded #10

chriscoderdr opened this issue Jul 2, 2017 · 2 comments

Comments

@chriscoderdr
Copy link

https://github.com/duckbrain/ldss/blob/master/ldssa/ldssa.go#L9
That's a problem cause it does't work in phones that doesn't have sdcard.

07-02 10:22:41.104 29544-29603/com.github.cgomezmendez.ldss.ldssa.build E/GoLog: panic: open /storage/emulated/0/.ldss/languages.json: no such file or directory

there must be a way to have it dinamically in golang.

@duckbrain
Copy link
Owner

I can't even seem to get it to work anymore. I rebuilt the project without changes and it now crashes on start saying that it can't find a class.

07-08 12:27:51.348   873  4161 I ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.github.duckbrain.ldss.ldssa.build/.Main bnds=[276,1293][540,1632] (has extras)} from uid 10032 on display 0
07-08 12:27:51.408   873 10286 I ActivityManager: Start proc 12984:com.github.duckbrain.ldss.ldssa.build/u0a158 for activity com.github.duckbrain.ldss.ldssa.build/.Main
07-08 12:27:51.445 12984 12984 E AndroidRuntime: Process: com.github.duckbrain.ldss.ldssa.build, PID: 12984
07-08 12:27:51.445 12984 12984 E AndroidRuntime: java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.github.duckbrain.ldss.ldssa.build/com.github.duckbrain.ldss.ldssa.build.Main}: java.lang.ClassNotFoundException: Didn't find class "com.github.duckbrain.ldss.ldssa.build.Main" on path: DexPathList[[zip file "/data/app/com.github.duckbrain.ldss.ldssa.build-1/base.apk"],nativeLibraryDirectories=[/data/app/com.github.duckbrain.ldss.ldssa.build-1/lib/arm, /system/fake-libs, /data/app/com.github.duckbrain.ldss.ldssa.build-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
07-08 12:27:51.445 12984 12984 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "com.github.duckbrain.ldss.ldssa.build.Main" on path: DexPathList[[zip file "/data/app/com.github.duckbrain.ldss.ldssa.build-1/base.apk"],nativeLibraryDirectories=[/data/app/com.github.duckbrain.ldss.ldssa.build-1/lib/arm, /system/fake-libs, /data/app/com.github.duckbrain.ldss.ldssa.build-1/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
07-08 12:27:51.448   873  4153 W ActivityManager:   Force finishing activity com.github.duckbrain.ldss.ldssa.build/.Main
07-08 12:27:51.955   873  1607 W ActivityManager: Activity pause timeout for ActivityRecord{9f21ea8 u0 com.github.duckbrain.ldss.ldssa.build/.Main t6790 f}
07-08 12:27:51.971   873  1607 I WindowManager: Failed to capture screenshot of Token{f5e6dc1 ActivityRecord{9f21ea8 u0 com.github.duckbrain.ldss.ldssa.build/.Main t6790 f}} appWin=Window{d0e8f3e u0 Starting com.github.duckbrain.ldss.ldssa.build} drawState=4

I suspect an Arch Linux update overwrote something I installed through Android Studio. I'm trying to things working there.

I'm thinking that I could use user.User.HomeDir to get a directory that does exist, but I am unable to test that until I get the build working again. I wanted to test it with a simple replacement of my init in ldssa/ldss.go with something like this.

func init() {
	http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
		defer web.HandleError(w, r)
		user, _ := user.Current()
		w.Write([]byte(user.HomeDir))
	})
}

@duckbrain
Copy link
Owner

I'm reopening this because it's still an issue, but it's likely I won't get to it soon.

@cgomezmendez I did come up with a workaround that's better than the app was. You can use Termux and install the Go package, then go get this app. Run ldss web and pull up http://localhost:1830 in your browser. I had to exclude cmd/gui.go from the build, but I think I'm going to do that by default anyway.

@duckbrain duckbrain reopened this Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants