Skip to content

Commit

Permalink
Merge pull request #48 from DevCrew-io/upgrade-sdk
Browse files Browse the repository at this point in the history
Upgrade Snapchat SDK & Example Project
  • Loading branch information
AliRehan-DevCrew authored Feb 21, 2025
2 parents 1cab55d + 9924ae8 commit 3fbc3cb
Show file tree
Hide file tree
Showing 39 changed files with 410 additions and 611 deletions.
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
## 1.0.4
### Updated
* Update CameraKit SDK to 1.38.0
* Update Example project.

## 1.0.3
### Updated
* Update Camera kit SDK to 1.37.0
* Update CameraKit SDK to 1.37.0

## 1.0.2
### Updated
* Update Camera kit SDK to 1.36.0
* Update CameraKit SDK to 1.36.0
* Configuration setup is updated as per new snapchat version.

## 1.0.1
* Update Camera kit SDK to 1.31.0
* Update CameraKit SDK to 1.31.0

## 1.0.0
* Fix dart formatting warnings for pub points.
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ android {
dependencies {
testImplementation 'org.jetbrains.kotlin:kotlin-test'
testImplementation 'org.mockito:mockito-core:5.0.0'
implementation "com.snap.camerakit:support-camera-activity:1.37.0"
implementation "com.snap.camerakit:support-camera-activity:1.38.0"
implementation 'com.google.code.gson:gson:2.8.8' // Use the latest version available
}

Expand Down
2 changes: 2 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
*.swp
.DS_Store
.atom/
.build/
.buildlog/
.history
.svn/
.swiftpm/
migrate_working_dir/

# IntelliJ related
Expand Down
3 changes: 1 addition & 2 deletions example/analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
# and their documentation is published at https://dart.dev/lints.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
Expand Down
3 changes: 2 additions & 1 deletion example/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ gradle-wrapper.jar
/gradlew.bat
/local.properties
GeneratedPluginRegistrant.java
.cxx/

# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
# See https://flutter.dev/to/reference-keystore
key.properties
**/*.keystore
**/*.jks
67 changes: 0 additions & 67 deletions example/android/app/build.gradle

This file was deleted.

45 changes: 45 additions & 0 deletions example/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
plugins {
id("com.android.application")
id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
}

android {
namespace = "com.camerakit.camerakit_flutter_example.camerakit_flutter_example"
compileSdk = flutter.compileSdkVersion
// ndkVersion = flutter.ndkVersion
ndkVersion = "27.0.12077973"

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.camerakit.camerakit_flutter_example.camerakit_flutter_example"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.getByName("debug")
}
}
}

flutter {
source = "../.."
}
38 changes: 27 additions & 11 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="camerakit_flutter_example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppCompat"
android:icon="@mipmap/ic_launcher">
android:label="camerakit_flutter_example">

<meta-data android:name="com.snap.camerakit.app.id" android:value="" />
<meta-data android:name="com.snap.camerakit.api.token" android:value="" />
<meta-data
android:name="com.snap.camerakit.app.id"
android:value="" />
<meta-data
android:name="com.snap.camerakit.api.token"
android:value="" />

<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:exported="true"
android:hardwareAccelerated="true"
android:launchMode="singleTop"
android:taskAffinity=""
android:theme="@style/LaunchTheme"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
Expand All @@ -34,4 +39,15 @@
android:name="flutterEmbedding"
android:value="2" />
</application>
<!-- Required to query activities that can process text, see:
https://developer.android.com/training/package-visibility and
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
<queries>
<intent>
<action android:name="android.intent.action.PROCESS_TEXT" />
<data android:mimeType="text/plain" />
</intent>
</queries>
</manifest>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.camerakit.camerakit_flutter_example.camerakit_flutter_example

import io.flutter.embedding.android.FlutterActivity

class MainActivity : FlutterActivity()
1 change: 0 additions & 1 deletion example/android/app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>

<style name="AppCompat" parent="Theme.AppCompat.NoActionBar">
</style>
</resources>
31 changes: 0 additions & 31 deletions example/android/build.gradle

This file was deleted.

21 changes: 21 additions & 0 deletions example/android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
allprojects {
repositories {
google()
mavenCentral()
}
}

val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
rootProject.layout.buildDirectory.value(newBuildDir)

subprojects {
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
project.layout.buildDirectory.value(newSubprojectBuildDir)
}
subprojects {
project.evaluationDependsOn(":app")
}

tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}
5 changes: 1 addition & 4 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
4 changes: 1 addition & 3 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
20 changes: 0 additions & 20 deletions example/android/settings.gradle

This file was deleted.

25 changes: 25 additions & 0 deletions example/android/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
pluginManagement {
val flutterSdkPath = run {
val properties = java.util.Properties()
file("local.properties").inputStream().use { properties.load(it) }
val flutterSdkPath = properties.getProperty("flutter.sdk")
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
flutterSdkPath
}

includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "8.7.2" apply false
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
}

include(":app")
Loading

0 comments on commit 3fbc3cb

Please sign in to comment.