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

Import flutter project? #21936

Closed
Mythar opened this issue Sep 17, 2018 · 3 comments
Closed

Import flutter project? #21936

Mythar opened this issue Sep 17, 2018 · 3 comments

Comments

@Mythar
Copy link

Mythar commented Sep 17, 2018

Im trying to import a flutter project into Android Studio on another PC but i keep getting an error.
Other PC has the same "stuff" installed all version "stuff" is the same.

Initializing gradle...
Resolving dependencies...
Running 'gradlew assembleDebug'...
Plugin project :image_picker not found. Please update settings.gradle.
Plugin project :flutter_string_encryption not found. Please update settings.gradle.
Plugin project :path_provider not found. Please update settings.gradle.
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:8: error: package io.flutter.plugin.common does not exist
import io.flutter.plugin.common.MethodCall;
                               ^
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:9: error: package io.flutter.plugin.common does not exist
import io.flutter.plugin.common.MethodChannel;
                               ^
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:10: error: package io.flutter.plugin.common.MethodChannel does not exist
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
                                             ^
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:11: error: package io.flutter.plugin.common.MethodChannel does not exist
import io.flutter.plugin.common.MethodChannel.Result;
                                             ^
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:12: error: package io.flutter.plugin.common.PluginRegistry does not exist
import io.flutter.plugin.common.PluginRegistry.Registrar;
                                              ^
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:13: error: package io.flutter.util does not exist
import io.flutter.util.PathUtils;
                      ^
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:15: error: cannot find symbol
public class PathProviderPlugin implements MethodCallHandler {
                                           ^
  symbol: class MethodCallHandler
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:16: error: cannot find symbol
  private final Registrar mRegistrar;
                ^
  symbol:   class Registrar
  location: class PathProviderPlugin
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:18: error: cannot find symbol
  public static void registerWith(Registrar registrar) {
                                  ^
  symbol:   class Registrar
  location: class PathProviderPlugin
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:25: error: cannot find symbol
  private PathProviderPlugin(Registrar registrar) {
                             ^
  symbol:   class Registrar
  location: class PathProviderPlugin
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:30: error: cannot find symbol
  public void onMethodCall(MethodCall call, Result result) {
                           ^
  symbol:   class MethodCall
  location: class PathProviderPlugin
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:30: error: cannot find symbol
  public void onMethodCall(MethodCall call, Result result) {
                                            ^
  symbol:   class Result
  location: class PathProviderPlugin
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:19: error: cannot find symbol
    MethodChannel channel =
    ^
  symbol:   class MethodChannel
  location: class PathProviderPlugin
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:20: error: cannot find symbol
        new MethodChannel(registrar.messenger(), "plugins.flutter.io/path_provider");
            ^
  symbol:   class MethodChannel
  location: class PathProviderPlugin
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:29: error: method does not override or implement a method from a supertype
  @Override
  ^
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:31: error: illegal start of type
    switch (call.method) {
           ^
E:\Applications\Flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-0.4.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java:51: error: cannot find symbol
    return PathUtils.getDataDirectory(mRegistrar.context());
           ^
  symbol:   variable PathUtils
  location: class PathProviderPlugin
17 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':$name:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Finished with error: Gradle build failed: 1

There must be something missing in the imported project, been through all files and i cant find whats missing.

All other dependencies in pubspec.yaml works just fine.
Maybe the io.flutter.plugin.common "setup" is missing in the import somewere ?

Also when exporting a project from AS and importing it again (even on the same PC) the External Library: "Flutter for Android" is lost - i assume its becuz that the .idea is not exported.

This is probably more an AS issue but was hoping that someone here has experience with moving projects from one PC to another and also from any editor to another :)

@zoechi
Copy link
Contributor

zoechi commented Sep 25, 2018

Try flutter clean in the project directory and pod install in the ios/ subdirectory.
Did you copy the project or commit and checkout using Git?
There are files and directories listed in 3 .gitignore files that should be deleted when you copy the project directory manually.

@zoechi zoechi added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 25, 2018
@Mythar
Copy link
Author

Mythar commented Oct 2, 2018

I tryed flutter clean, copied the files manually and cleaned up the .gitignore files.
Its working now, thx :)

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Oct 2, 2018
@zoechi zoechi closed this as completed Oct 2, 2018
@github-actions
Copy link

github-actions bot commented Sep 1, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants