I'm not sure what's happening here, but a few questions/comments:
What Android version are you using?
srcs: [
> "*.java",
> "*.kt",
> "**/*.java",
> "**/*.kt",
> ],
This will duplicate the list of java and kotlin files in the current
directory, since ** will match both the current directory and all
subdirectories. I can't see how that would cause this problem, but it's a
good thing to clean up.
- Dan
On Mon, Mar 11, 2019 at 10:07 PM Ted Jiang <[email protected]> wrote:
> this is my build.bp:
>
> java_library_static {
> name: "mylib",
>
> srcs: [
> "*.java",
> "*.kt",
> "**/*.java",
> "**/*.kt",
> ],
>
>
> optimize: {
> enabled: false,
> },
>
> }
>
>
> but it yields very strange errors when building, like:
>
> SysProperty.kt:9:16: error: type mismatch: inferred type is
> java.lang.String! but kotlin.String was expected
> return SystemProperties.get(key)
> ^
> SysProperty.kt:9:33: error: cannot access class 'java.lang.String'. Check
> your module classpath for missing or conflicting dependencies
> return SystemProperties.get(key)
> ^
> SysProperty.kt:9:37: error: type mismatch: inferred type is kotlin.String
> but java.lang.String! was expected
> return SystemProperties.get(key)
> ^
> SysProperty.kt:14:16: error: type mismatch: inferred type is
> java.lang.String! but kotlin.String was expected
> return SystemProperties.get(key, def)
> ^
> SysProperty.kt:14:33: error: cannot access class 'java.lang.String'. Check
> your module classpath for missing or conflicting dependencies
> return SystemProperties.get(key, def)
> ^
> SysProperty.kt:14:37: error: type mismatch: inferred type is kotlin.String
> but java.lang.String! was expected
> return SystemProperties.get(key, def)
> ^
> SysProperty.kt:14:42: error: type mismatch: inferred type is kotlin.String
> but java.lang.String! was expected
> return SystemProperties.get(key, def)
> ^
> SysProperty.kt:19:33: error: cannot access class 'java.lang.String'. Check
> your module classpath for missing or conflicting dependencies
> return SystemProperties.set(key, value)
> ^
>
> TelephonyMgr.kt:11:48: error: cannot access class 'java.lang.Object'.
> Check your module classpath for missing or conflicting dependencies
> getContext().getSystemService(Context.TELEPHONY_SERVICE) as
> TelephonyManager
> ^
> TelephonyMgr.kt:11:48: error: cannot access class 'java.lang.String'.
> Check your module classpath for missing or conflicting dependencies
>
> CoreApi.getInstance().getContext().getSystemService(Context.TELEPHONY_SERVICE)
> as TelephonyManager
>
>
> It looks like some standard java classes are missing, such as
> java.lang.String, java.lang.Object, but why?
>
>
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
--
You received this message because you are subscribed to the "Android Building"
mailing list.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.