Skip to content

Commit 553aab9

Browse files
committed
解决kotlin demo编译问题
1 parent bb5563a commit 553aab9

File tree

4 files changed

+28
-3
lines changed

4 files changed

+28
-3
lines changed

android/f2native/build.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,18 @@ android {
6464

6565
dependencies {
6666
compileOnly rootProject.extensions.dependencies.fastjson
67+
}
68+
69+
publishing {
70+
publications {
71+
release(MavenPublication) {
72+
groupId = 'com.github.antvis'
73+
artifactId = 'F2Native'
74+
version = '2.1.18'
75+
76+
afterEvaluate {
77+
artifact bundleReleaseAar
78+
}
79+
}
80+
}
6781
}

demos/android/demos-kotlin/build.gradle

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,12 @@ plugins {
55

66
android {
77
compileSdk rootProject.extensions.sdks.CompileSDK
8-
ndkVersion rootProject.extensions.sdks.ndkVersion
98
defaultConfig {
109
namespace "com.antgroup.antv.f2.kotlinsamples"
1110
minSdkVersion rootProject.extensions.sdks.MinSDK
1211
targetSdkVersion rootProject.extensions.sdks.TargetSDK
1312
versionCode 1
1413
versionName "1.0"
15-
multiDexEnabled false
1614
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1715
}
1816
buildTypes {
@@ -21,6 +19,15 @@ android {
2119
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
2220
}
2321
}
22+
23+
compileOptions {
24+
sourceCompatibility JavaVersion.VERSION_1_8
25+
targetCompatibility JavaVersion.VERSION_1_8
26+
}
27+
28+
kotlinOptions {
29+
jvmTarget = "1.8"
30+
}
2431
}
2532

2633
dependencies {

demos/android/demos-kotlin/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
android:label="@string/title_activity_bridge"
2727
android:theme="@style/AppTheme" />
2828

29-
<activity android:name="com.antgroup.antv.f2.kotlinsamples.MainActivity">
29+
<activity android:name="com.antgroup.antv.f2.kotlinsamples.MainActivity"
30+
android:exported="true">
3031
<intent-filter>
3132
<action android:name="android.intent.action.MAIN" />
3233

demos/android/demos-kotlin/src/main/java/com/antgroup/antv/f2/kotlinsamples/Utils.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ object Utils {
1212
@JvmStatic
1313
fun loadAssetFile(context: Context, assetFile: String?): String? {
1414
try {
15+
if (assetFile == null){
16+
return null
17+
}
1518
val `is` = context.assets.open(assetFile)
1619
val buf = ByteArray(1024 * 500)
1720
val output = ByteArrayOutputStream()

0 commit comments

Comments
 (0)