yiotro / Antiyoy

A source code of android game called 'antiyoy'.
422 stars 54 forks source link

import android.os #40

Closed lamellama closed 6 years ago

lamellama commented 6 years ago

I am attempting to clone the repo; the core project references Android.os which gives me a package does not exist error:

Information:Gradle tasks [:desktop:assemble, :android:assembleDebug] Warning:[options] bootstrap class path not set in conjunction with -source 1.7 ..\core\src\yio\tro\antiyoy\stuff\LanguagesManager.java Error:(3, 26) error: package android.annotation does not exist Error:(4, 18) error: package android.os does not exist Error:(87, 6) error: cannot find symbol class TargetApi ..\core\src\yio\tro\antiyoy\GetAndroidClipboardContents.java Error:(3, 18) error: package android.os does not exist Error:(4, 18) error: package android.os does not exist Error:(12, 13) error: cannot find symbol class Handler Error:(12, 35) error: cannot find symbol class Handler Error:(12, 43) error: cannot find symbol variable Looper Error:Execution failed for task ':core:compileJava'.

Compilation failed; see the compiler error output for details.

How do you get around this? Is there another dependency to add to the core module?

Regards,

Matt

lamellama commented 6 years ago

My hack was to copy the android.jar from system-tools to the core/lib folder but there must be a better way

yiotro commented 6 years ago

Hmm, do you have android sdk installed?

Are you able to create and launch simple libgdx app (the one that only shows a picture on screen and nothing more) ?

lamellama commented 6 years ago

Yeah, I went through the readme install fine. Tested the libgdx setup which just runs the badlogic sprite, but when cloning antiyoy into the project it gives me those errors. I assumed gradle needed more settings

yiotro commented 6 years ago

Gradle is very strange thing, I tried really hard but I wasn't been able to make him work. It also gave me some very strange errors and google didn't help.

So I just ignore gradle and compile it in usual way (without gradle). Just go to 'DesktopLauncher.java' class and press Ctrl+Shift+F10. It will crash at first, but when you change 'working directory' in run configuration it should work fine.

lamellama commented 6 years ago

Thanks, I'm glad I'm not the only one having trouble with gradle but both ways are compiling now.

VolodymyrBiryuk commented 6 years ago

You can also include this into your core's build.gradle (with newest Gradle version 3.x): dependencies { implementation 'com.android.support:support-annotations:27.0.2' implementation 'com.google.android:android:4.1.1.4' }