Android Studio local path doesn't exist

前端 未结 9 1966
离开以前
离开以前 2020-12-06 07:33

I imported my Eclipse project into Android using Gradle. At first I had problems with R.java but I resolved them by adding \'gen\' folder as sources in Project Settings.

相关标签:
9条回答
  • 2020-12-06 07:52

    You should try this little button in the toolbar: Sync with Graddle files icon

    It should fix your problem.

    if not, make sure your settings in build.gradle are set to 0.6.+

    buildscript {
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:0.6.+'
        }
    }
    

    And then click on the button again.

    0 讨论(0)
  • 2020-12-06 07:53

    If you are on windows, to run gradlew:

    1. Open a command prompt and navigate to your project folder

    2. Run gradlew batch using the following command:

      start gradlew clean packageDebug

    Hope that help.

    0 讨论(0)
  • 2020-12-06 07:56

    follow these steps. This worked for me...

    1. Go to your project directory.In that directory search for .apk file....
    2. You will find a apk with name of your project+debug-unalighned.apk.
    3. Open .iml file insideyour project folder that contain project source directory.
    4. Open it.add

      write <option name="APK_PATH" value="/build/apk/(apk file name that was found earlier with apk extension)" /> inside <configration> <configration/> tags.

      Now go and run your project...

    PROBLEMO SOLVED....:)

    0 讨论(0)
  • 2020-12-06 07:57

    Try: Android Studio menu "File", "Invalidate Caches / Restarts..." For me "gradle clean packageDebug" don't works...

    (I develop on two Pc and paths of src/build are different)

    0 讨论(0)
  • 2020-12-06 08:02

    I just ran into this problem, even without transferring from Eclipse, and was frustrated because I kept showing no compile or packageDebug errors. Somehow it all fixes itself if you clean and THEN run packageDebug. Don't worry about the deprecated method statement - it seems to be a generic notice to developers.

    Open up a commandline, and in your project's root directory, run:

    ./gradlew clean packageDebug
    

    Obviously, if either of these steps shows errors, you should fix those...But when they both succeed you should now be able to find the apk when you navigate the local path -- and even better, your program should install/run on the device/emulator!

    0 讨论(0)
  • 2020-12-06 08:06

    This is because you have "spaces" in your folder name!!!

    Please remove the "spaces" and try again!!!

    0 讨论(0)
提交回复
热议问题