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

添加依赖后编译报错 #1

Closed
AiHMin opened this issue Oct 23, 2019 · 16 comments
Closed

添加依赖后编译报错 #1

AiHMin opened this issue Oct 23, 2019 · 16 comments

Comments

@AiHMin
Copy link

AiHMin commented Oct 23, 2019

我引入的依赖:
amap_location_fluttify: ^0.2.1+e0ef7a2

编译时出现的错误:

* Where:
Build file '/Users/am/dev/env/flutter/.pub-cache/hosted/pub.flutter-io.cn/amap_core_fluttify-0.0.6/android/build.gradle' line: 46
* What went wrong:
A problem occurred evaluating root project 'amap_core_fluttify'.
> Cannot convert a null value to an object of type Dependency.
  The following types/formats are supported:
    - Instances of Dependency.
    - String or CharSequence values, for example 'org.gradle:gradle-core:1.0'.
    - Maps, for example [group: 'org.gradle', name: 'gradle-core', version: '1.0'].
    - FileCollections, for example files('some.jar', 'someOther.jar').
    - Projects, for example project(':some:project:path').
    - ClassPathNotation, for example gradleApi().

  Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type.

flutter doctor:

Flutter (Channel dev, v1.10.14, on Mac OS X 10.15 19A602, locale zh-Hans-CN)
@yohom
Copy link
Member

yohom commented Oct 24, 2019

我看了下代码,是我疏忽了,你去报错的gradle文件里,依赖amap_core_fluttify的那个地方, 加个冒号

provided rootProject.findProject("amap_core_fluttify")

改为

provided rootProject.findProject(":amap_core_fluttify")

我明天发个新版本 @AiHMin

@Spicely
Copy link

Spicely commented Oct 24, 2019

编译报错

  • What went wrong:
    Execution failed for task ':app:processDebugManifest'.

Manifest merger failed : Attribute meta-data#com.amap.api.v2.apikey@value value=(70a270e6a28431a0052e6ffe8cac28a0) from AndroidManifest.xml:15:13-61
is also present at [:amap_location_fluttify] AndroidManifest.xml:33:13-61 value=(20fc807ea4f290d75eae1a7e990588c3).
Suggestion: add 'tools:replace="android:value"' to element at AndroidManifest.xml to override.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

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

BUILD FAILED in 1m 17s
Gradle task assembleDebug failed with exit code 1
Exited (sigterm)

@yohom
Copy link
Member

yohom commented Oct 24, 2019

0.2.3版本试一下,把高德的key放到example工程里去了 @Spicely

@jiudianban
Copy link

我的包名与key都对,但是SHA1与我的不一样,请问这是为什么呢。
I/authErrLog(10286): ================================================================================ I/authErrLog(10286): 鉴权错误信息 I/authErrLog(10286): ================================================================================ I/authErrLog(10286): |SHA1Package:8F:13:C9:E3:CE:12:B4:AA:55:CB:BD:AD:43:2D:54:54:99:F8:15:59:com.qk| I/authErrLog(10286): |.ginkgo.cm | I/authErrLog(10286): |key:80af05d12574f0eacc3cbbd79955a619 | I/authErrLog(10286): |csid:dfdca859f8414fcdaad1d4af2f86d2c7 | I/authErrLog(10286): |gsid:011130218006157196811157400019800487329 | I/authErrLog(10286): |json:{"info":"INVALID_USER_SCODE","infocode":"10008","status":"0","sec_code_de| I/authErrLog(10286): |bug":"d41d8cd98f00b204e9800998ecf8427e","key":"80af05d12574f0eacc3cbbd79955a61| I/authErrLog(10286): |9","sec_code":"dd4db3515ef27bbc4ecf5232a3482132"} | I/authErrLog(10286): I/authErrLog(10286): 请在高德开放平台官网中搜索"INVALID_USER_SCODE"相关内容进行解决

@Spicely
Copy link

Spicely commented Oct 25, 2019

0.2.3版本试一下,把高德的键放到example工程里去了@Spicely

新版本解决了这个问题

@Spicely
Copy link

Spicely commented Oct 25, 2019

0.2.3版本试一下,把高德的键放到example工程里去了@Spicely

新的版本第一次使用是正确的 但我关闭这个页面后再打开
出现
PlatformException (PlatformException(error, null cannot be cast to non-null type com.amap.api.location.AMapLocationClient, null))

@yohom
Copy link
Member

yohom commented Oct 25, 2019

0.2.3版本试一下,把高德的键放到example工程里去了@Spicely

新的版本第一次使用是正确的 但我关闭这个页面后再打开
出现
PlatformException (PlatformException(error, null cannot be cast to non-null type com.amap.api.location.AMapLocationClient, null))

flutter package upgrade试一下,最近版本有对这个做过处理。

@yohom
Copy link
Member

yohom commented Oct 25, 2019

0.2.3版本试一下,把高德的键放到example工程里去了@Spicely

新的版本第一次使用是正确的 但我关闭这个页面后再打开
出现
PlatformException (PlatformException(error, null cannot be cast to non-null type com.amap.api.location.AMapLocationClient, null))

你是不是在页面mixin了AmapLocationDisposeMixin? @Spicely

@Spicely
Copy link

Spicely commented Oct 25, 2019

0.2.3版本试一下,把高德的键放到example工程里去了@Spicely

新的版本第一次使用是正确的但我我关闭这个页面后再打开
出现
PlatformException(PlatformException(错误,无法将NULL强制转换为非null类型com.amap.api.location.AMapLocationClient,NULL))

你是不是在页面mixin了AmapLocationDisposeMixin吗?@Spicely

没有我只做了
image

@Spicely
Copy link

Spicely commented Oct 25, 2019

0.2.3版本试一下,把高德的键放到example工程里去了@Spicely

新的版本第一次使用是正确的但我我关闭这个页面后再打开
出现
PlatformException(PlatformException(错误,无法将NULL强制转换为非null类型com.amap.api.location.AMapLocationClient,NULL))

flutter package upgrade试一下,最近版本有对这个做过处理。
更新解决了这个问题

@AiHMin
Copy link
Author

AiHMin commented Oct 25, 2019

@yohom ok 问题解决啦,不过还有个问题:

AmapLocation.startLocation(
    // ...
    mode: LocationAccuracy.High,
);

这个mode,也就是LocationAccuracy访问不到,好像没有在amap_location_fluttify.dart文件里暴露出来

@AiHMin
Copy link
Author

AiHMin commented Oct 25, 2019

0.2.3版本试一下,把高德的键放到example工程里去了@Spicely

新的版本第一次使用是正确的 但我关闭这个页面后再打开
出现
PlatformException (PlatformException(error, null cannot be cast to non-null type com.amap.api.location.AMapLocationClient, null))

我在0.2.3版本也遇到了同样的问题
mixinAmapLocationDisposeMixin,或者单独调用AmapLocation.dispose()都是这样

@yohom
Copy link
Member

yohom commented Oct 26, 2019

@AiHMin flutter packages upgrade强制更新一下

@AiHMin
Copy link
Author

AiHMin commented Oct 26, 2019

@AiHMin flutter packages upgrade强制更新一下

试过了,还是不行😰 @yohom

@zhangruiyu
Copy link

确实还是不行 我也试过了

@baomi4577
Copy link

我约会的依赖:
amap_location_fluttify: ^0.2.1+e0ef7a2

编译时出现的错误:

* Where:
Build file '/Users/am/dev/env/flutter/.pub-cache/hosted/pub.flutter-io.cn/amap_core_fluttify-0.0.6/android/build.gradle' line: 46
* What went wrong:
A problem occurred evaluating root project 'amap_core_fluttify'.
> Cannot convert a null value to an object of type Dependency.
  The following types/formats are supported:
    - Instances of Dependency.
    - String or CharSequence values, for example 'org.gradle:gradle-core:1.0'.
    - Maps, for example [group: 'org.gradle', name: 'gradle-core', version: '1.0'].
    - FileCollections, for example files('some.jar', 'someOther.jar').
    - Projects, for example project(':some:project:path').
    - ClassPathNotation, for example gradleApi().

  Comprehensive documentation on dependency notations is available in DSL reference for DependencyHandler type.

扑医生:

Flutter (Channel dev, v1.10.14, on Mac OS X 10.15 19A602, locale zh-Hans-CN)

正解:https://www.jianshu.com/p/1065a3f8b84b

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

6 participants