在Flutter应用中添加了对Android支持的支持后,Gradle Sync失败了

时间:2019-02-18 11:49:49

标签: android dart flutter

是否可以在Flutter应用中添加Android支持库。尝试将Android Support v13:27.11添加到Flutter应用程序时遇到了此错误。显示的错误为“成绩同步失败”

我尝试添加和删除该库,但是只有在添加该库时构建才会失败。

显示的确切错误是:

Gradle Sync Failed

我使用了支持库来启用Android通知。如果还有其他图书馆可以提供帮助,我也可以免费尝试。

更新: 我在Build.gradle

中添加了以下内容
implementation "com.android.support:support-compat:27.0.0"
implementation "com.android.support:support-media-compat:27.1.1" 

和日志是

2019-02-19 15:00:07,177 [ thread 94]   WARN - ect.sync.idea.ProjectSetUpTask - Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not determine artifacts for com.android.support:support-compat:27.1.1: No cached version available for offline mode 
2019-02-19 15:00:07,178 [ thread 94]   INFO - e.project.sync.GradleSyncState - Gradle sync failed: Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not determine artifacts for com.android.support:support-compat:27.1.1: No cached version available for offline mode

Consult IDE log for more details (Help | Show Log) (2 s 480 ms) 
2019-02-19 15:00:07,186 [e-1136-b06]   INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender deactivation event: SYNC_FINISHED 
2019-02-19 15:00:07,186 [e-1136-b06]   INFO - idea.project.IndexingSuspender - Finishing batch update for project: Project 'D:\Piper\example\android' android 
2019-02-19 15:00:07,325 [ thread 78]   INFO -       #com.jetbrains.cidr.lang - Clearing symbols finished in 0.063 s. 
2019-02-19 15:00:07,325 [ thread 78]   INFO -       #com.jetbrains.cidr.lang - Building symbols in FAST mode, 0 source files from total 0 project files 
2019-02-19 15:00:07,326 [ thread 78]   INFO -       #com.jetbrains.cidr.lang - Loading symbols finished in 0.001 s. 
2019-02-19 15:00:07,326 [ thread 78]   INFO -       #com.jetbrains.cidr.lang - Loading Header Maps finished in 0.000 s. 
2019-02-19 15:00:07,326 [ thread 78]   INFO -       #com.jetbrains.cidr.lang - Loading Module Maps finished in 0.000 s. 
2019-02-19 15:00:07,327 [ thread 78]   INFO -       #com.jetbrains.cidr.lang - Saving Module Maps finished in 0.000 s. 
2019-02-19 15:00:07,327 [ thread 78]   INFO -       #com.jetbrains.cidr.lang - Loaded 0 tables for 0 files (0 project files) 
2019-02-19 15:00:07,327 [ thread 78]   INFO -       #com.jetbrains.cidr.lang - Building symbols for 0 source files 
2019-02-19 15:00:07,327 [ thread 78]   INFO -       #com.jetbrains.cidr.lang - Building symbols for 0 unused headers 
2019-02-19 15:00:07,328 [ thread 78]   INFO -       #com.jetbrains.cidr.lang - Building symbols finished in 0.001 s. 
2019-02-19 15:00:07,328 [ thread 78]   INFO -       #com.jetbrains.cidr.lang - Saving modified symbols for 0 files (0 tables of total 0) 
2019-02-19 15:00:07,328 [ thread 78]   INFO -       #com.jetbrains.cidr.lang - Saving symbols finished in 0.000 s. 
2019-02-19 15:00:07,571 [J pool 3/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:00:07,576 [J pool 2/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:00:09,228 [J pool 3/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:00:09,641 [J pool 2/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:00:35,647 [J pool 1/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:00:35,787 [J pool 1/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:00:36,656 [J pool 0/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:00:37,483 [J pool 2/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:00:39,389 [e-1136-b06]   INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: SYNC_TASK_CREATED 
2019-02-19 15:00:39,483 [e-1136-b06]   INFO - e.project.sync.GradleSyncState - Started sync with Gradle for project 'android'. 
2019-02-19 15:00:39,489 [e-1136-b06]   INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: SYNC_STARTED 
2019-02-19 15:00:39,489 [e-1136-b06]   INFO - idea.project.IndexingSuspender - Starting batch update for project: Project 'D:\Piper\example\android' android 
2019-02-19 15:00:39,517 [ thread 78]   INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre 
2019-02-19 15:00:39,521 [ thread 78]   INFO - s.plugins.gradle.GradleManager - Instructing gradle to use java from C:/Program Files/Android/Android Studio/jre 
2019-02-19 15:00:39,570 [ thread 78]   INFO - xecution.GradleExecutionHelper - Passing command-line args to Gradle Tooling API: -Didea.version=3.2 -Djava.awt.headless=true -Pandroid.injected.build.model.only=true -Pandroid.injected.build.model.only.advanced=true -Pandroid.injected.invoked.from.ide=true -Pandroid.injected.build.model.only.versioned=3 -Pandroid.injected.studio.version=3.2.1.0 -Pandroid.builder.sdkDownload=false --init-script C:\Users\Ike\AppData\Local\Temp\ijinit.gradle --offline 
2019-02-19 15:00:51,464 [ thread 78]   INFO - e.project.sync.GradleSyncState - Started setup of project 'android'. 
2019-02-19 15:00:51,472 [e-1136-b06]   INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender activation event: SETUP_STARTED 
2019-02-19 15:00:51,778 [e-1136-b06]   INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 28 Platform' (C:\Users\Ike\AppData\Local\Android\Sdk) to module 'shared_preferences' 
2019-02-19 15:00:51,846 [e-1136-b06]   INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 28 Platform' (C:\Users\Ike\AppData\Local\Android\Sdk) to module 'path_provider' 
2019-02-19 15:00:51,848 [e-1136-b06]   INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 27 Platform' (C:\Users\Ike\AppData\Local\Android\Sdk) to module 'eightoeight' 
2019-02-19 15:00:51,855 [e-1136-b06]   INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 28 Platform' (C:\Users\Ike\AppData\Local\Android\Sdk) to module 'url_launcher' 
2019-02-19 15:00:51,858 [e-1136-b06]   INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 28 Platform' (C:\Users\Ike\AppData\Local\Android\Sdk) to module 'sqflite' 
2019-02-19 15:00:51,861 [e-1136-b06]   INFO - ule.android.SdkModuleSetupStep - Set Android SDK 'Android API 27 Platform' (C:\Users\Ike\AppData\Local\Android\Sdk) to module 'app' 
2019-02-19 15:00:52,234 [ thread 78]   INFO - e.project.sync.GradleSyncState - Gradle sync failed (12 s 751 ms) 
2019-02-19 15:00:52,260 [e-1136-b06]   INFO - idea.project.IndexingSuspender - Consuming IndexingSuspender deactivation event: SYNC_FINISHED 
2019-02-19 15:00:52,260 [e-1136-b06]   INFO - idea.project.IndexingSuspender - Finishing batch update for project: Project 'D:\Piper\example\android' android 
2019-02-19 15:00:52,388 [e-1136-b06]   INFO - pl.ProjectRootManagerComponent - project roots have changed 
2019-02-19 15:00:52,620 [ thread 89]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 1ms; general responsiveness: ok; EDT responsiveness: ok 
2019-02-19 15:00:52,688 [ thread 89]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 68ms; general responsiveness: ok; EDT responsiveness: ok 
2019-02-19 15:00:52,694 [ thread 89]   INFO -       #com.jetbrains.cidr.lang - Clearing symbols finished in 0.002 s. 
2019-02-19 15:00:52,695 [ thread 89]   INFO -       #com.jetbrains.cidr.lang - Building symbols in FAST mode, 0 source files from total 0 project files 
2019-02-19 15:00:52,695 [ thread 89]   INFO -       #com.jetbrains.cidr.lang - Loading symbols finished in 0.001 s. 
2019-02-19 15:00:52,695 [ thread 89]   INFO -       #com.jetbrains.cidr.lang - Loading Header Maps finished in 0.000 s. 
2019-02-19 15:00:52,695 [ thread 89]   INFO -       #com.jetbrains.cidr.lang - Loading Module Maps finished in 0.000 s. 
2019-02-19 15:00:52,696 [ thread 89]   INFO -       #com.jetbrains.cidr.lang - Saving Module Maps finished in 0.000 s. 
2019-02-19 15:00:52,696 [ thread 89]   INFO -       #com.jetbrains.cidr.lang - Loaded 0 tables for 0 files (0 project files) 
2019-02-19 15:00:52,696 [ thread 89]   INFO -       #com.jetbrains.cidr.lang - Building symbols for 0 source files 
2019-02-19 15:00:52,696 [ thread 89]   INFO -       #com.jetbrains.cidr.lang - Building symbols for 0 unused headers 
2019-02-19 15:00:52,697 [ thread 89]   INFO -       #com.jetbrains.cidr.lang - Building symbols finished in 0.001 s. 
2019-02-19 15:00:52,698 [ thread 89]   INFO -       #com.jetbrains.cidr.lang - Saving modified symbols for 0 files (0 tables of total 0) 
2019-02-19 15:00:52,699 [ thread 89]   INFO -       #com.jetbrains.cidr.lang - Saving symbols finished in 0.001 s. 
2019-02-19 15:00:52,903 [J pool 0/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:00:54,315 [J pool 0/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:00:54,682 [J pool 2/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:00:54,682 [J pool 0/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:01:13,218 [e-1136-b06]   INFO - ide.actions.ShowFilePathAction - 
Exit code 1 
2019-02-19 15:01:19,272 [J pool 1/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:01:19,414 [J pool 0/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 
2019-02-19 15:01:19,414 [J pool 1/3]   INFO - .compiled.ClassFileStubBuilder - No stub built for file MetaClass.class 

0 个答案:

没有答案