Skip to content

Commit

Permalink
* Fix build because of recent changes
Browse files Browse the repository at this point in the history
* Others
  • Loading branch information
Andr3Carvalh0 committed Aug 9, 2018
1 parent 9841e64 commit 272c962
Show file tree
Hide file tree
Showing 30 changed files with 313 additions and 292 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
9 changes: 4 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,10 @@ dependencies {
implementation 'androidx.legacy:legacy-preference-v14:1.0.0-rc01'
implementation 'androidx.room:room-runtime:2.0.0-rc01'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.10'
implementation('com.github.florent37:glidepalette:2.1.1', {
exclude group: 'com.android.support', 'module': 'palette-v7'
})
implementation('com.github.florent37:glidepalette:2.1.1', { exclude group: 'com.android.support', 'module': 'palette-v7' })
implementation 'com.github.bumptech.glide:glide:4.8.0-SNAPSHOT'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.dagger:dagger:2.17'
Expand All @@ -88,7 +87,7 @@ dependencies {
implementation 'com.github.apl-devs:appintro:v4.2.3'
implementation 'com.annimon:stream:1.2.0'
implementation 'com.trello.rxlifecycle2:rxlifecycle-components:2.2.1'
implementation 'com.github.hotchemi:permissionsdispatcher:3.0.1'
implementation 'com.github.hotchemi:permissionsdispatcher:4.0.0-alpha1'
implementation('com.mikepenz:aboutlibraries:6.0.6@aar') { transitive = true }
implementation fileTree(include: ['*.jar'], dir: 'libs')

Expand All @@ -107,7 +106,7 @@ dependencies {
kapt 'com.google.dagger:dagger-compiler:2.17'
kapt 'com.github.bumptech.glide:compiler:4.8.0-SNAPSHOT'
kapt 'com.google.dagger:dagger-android-processor:2.17'
kapt 'com.github.hotchemi:permissionsdispatcher-processor:3.0.1'
kapt 'com.github.hotchemi:permissionsdispatcher-processor:4.0.0-alpha1'

//Others
implementation project(':filepicker')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package io.mgba.data.database.converters;

import java.io.File;

import androidx.room.TypeConverter;

public class GameConverter {
@TypeConverter
public static File fromStringToFile(String value) {
return value == null ? null : new File(value);
}

@TypeConverter
public static String fromFileToString(File value) {
return value == null ? null : value.getAbsolutePath();
}

}

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/java/io/mgba/presenter/SettingsPresenter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import io.mgba.utilities.IResourcesManager
import io.reactivex.annotations.NonNull

class SettingsPresenter(@param:NonNull private val view: ISettingsView, @NonNull resourcesManager: IResourcesManager) : ISettingsPresenter {
lateinit var settings: LinkedList<Settings>
var settings: LinkedList<Settings> = LinkedList()

override fun onClick(settings: Settings): Any {
val extras = HashMap<String, String>()
Expand Down
113 changes: 113 additions & 0 deletions app/src/main/java/io/mgba/ui/activities/IntroActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
package io.mgba.ui.activities;

import android.Manifest;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.NonNull;
import com.github.paolorotolo.appintro.AppIntro2;
import com.github.paolorotolo.appintro.AppIntroFragment;
import java.util.List;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import io.mgba.model.system.PermissionManager;
import io.mgba.presenter.interfaces.IIntroPresenter;
import io.mgba.presenter.IntroPresenter;
import io.mgba.ui.activities.interfaces.IIntroView;
import io.mgba.utilities.IDependencyInjector;
import io.mgba.mgba;
import permissions.dispatcher.NeedsPermission;
import permissions.dispatcher.OnNeverAskAgain;
import permissions.dispatcher.OnPermissionDenied;
import permissions.dispatcher.OnShowRationale;
import permissions.dispatcher.PermissionRequest;
import permissions.dispatcher.RuntimePermissions;

@RuntimePermissions
public class IntroActivity extends AppIntro2 implements IIntroView{

private IIntroPresenter controller;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

controller = new IntroPresenter(new PermissionManager(this),
(IDependencyInjector) getApplication(), this);
}

@NeedsPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE)
void showFilePicker() {
controller.showFilePicker();
}

@OnShowRationale(Manifest.permission.WRITE_EXTERNAL_STORAGE)
void showRationaleForStorage(final PermissionRequest request) {
controller.showRationaleForStorage(request);
}

@OnNeverAskAgain(Manifest.permission.WRITE_EXTERNAL_STORAGE)
@OnPermissionDenied(Manifest.permission.WRITE_EXTERNAL_STORAGE)
void onDeniedForStorage(){
controller.onDeniedForStorage();
}

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
IntroActivityPermissionsDispatcher.onRequestPermissionsResult(this, requestCode, grantResults);
}

protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
controller.onActivityResult(requestCode, resultCode, intent);
}

@Override
public void onDonePressed(Fragment currentFragment) {
super.onDonePressed(currentFragment);
IntroActivityPermissionsDispatcher.showFilePickerWithPermissionCheck(this);
}

@Override
protected void onPause() {
super.onPause();
controller.onPause();
}

@Override
protected void onResume() {
super.onResume();
controller.onResume();
}

@Override
public void addSlides(List<AppIntroFragment> slides) {
for (AppIntroFragment frag : slides)
this.addSlide(frag);

this.setProgressButtonEnabled(true);
this.setFadeAnimation();
this.showSkipButton(false);
}

@Override
public void savePreference(String key, String value) {
((mgba)getApplication()).savePreference(key, value);
}

@Override
public void savePreference(String key, boolean value) {
((mgba)getApplication()).savePreference(key, value);
}

@Override
public void showProgressDialog() {
((mgba)getApplication()).showProgressDialog(this);
}

@Override
public void startActivity(Class<? extends AppCompatActivity> activity) {
Intent it = new Intent(this, activity);
startActivity(it);
finish();
}
}
101 changes: 0 additions & 101 deletions app/src/main/java/io/mgba/ui/activities/IntroActivity.kt

This file was deleted.

3 changes: 2 additions & 1 deletion app/src/main/java/io/mgba/ui/activities/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class MainActivity : AppCompatActivity(), TabLayout.OnTabSelectedListener, io.mg
}

override fun onActivityResult(requestCode: Int, resultCode: Int, intent: Intent?) {
controller!!.onActivityResult(requestCode, resultCode, intent!!)
if(intent != null)
controller!!.onActivityResult(requestCode, resultCode, intent)
}

override fun onStop() {
Expand Down
Loading

3 comments on commit 272c962

@mshowsary
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi bro
i tried your code
i import it to android studio latest version. everything is great till you try to debug or build the apk i get the following errors.
Im kinda interested in your project and want to support it as i can.
looking forward to hear from you regarding this erros

Build command failed.
Error while executing process /Users/mshow/android-sdks/cmake/3.6.4111459/bin/cmake with arguments {--build /Users/mshow/Downloads/mGBA-master4/app/.externalNativeBuild/cmake/debug/arm64-v8a --target mgba}
[1/1] Re-running CMake...
CMake Warning at /Users/mshow/android-sdks/ndk-bundle/build/cmake/android.toolchain.cmake:63 (message):
Using custom NDK path (ANDROID_NDK is set):
/Users/mshow/android-sdks/ndk-bundle
Call Stack (most recent call first):
/Users/mshow/Downloads/mGBA-master4/app/.externalNativeBuild/cmake/debug/arm64-v8a/CMakeFiles/3.6.0-rc2/CMakeSystem.cmake:6 (include)
CMakeLists.txt:2 (project)

-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
-- Checking for one of the modules 'libedit'
CMake Warning at CMakeLists.txt:135 (message):
Requested module libedit missing for feature USE_EDITLINE. Feature
disabled.
Call Stack (most recent call first):
CMakeLists.txt:395 (find_feature)

-- Checking for one of the modules 'libavcodec'
CMake Warning at CMakeLists.txt:135 (message):
Requested module libavcodec missing for feature USE_FFMPEG. Feature
disabled.
Call Stack (most recent call first):
CMakeLists.txt:422 (find_feature)

-- Checking for one of the modules 'minizip'
CMake Warning at CMakeLists.txt:135 (message):
Requested module minizip missing for feature USE_MINIZIP. Feature
disabled.
Call Stack (most recent call first):
CMakeLists.txt:424 (find_feature)

-- Checking for one of the modules 'PNG'
CMake Warning at CMakeLists.txt:135 (message):
Requested module PNG missing for feature USE_PNG. Feature disabled.
Call Stack (most recent call first):
CMakeLists.txt:425 (find_feature)

-- Checking for one of the modules 'MagickWand'
CMake Warning at CMakeLists.txt:135 (message):
Requested module MagickWand missing for feature USE_MAGICK. Feature
disabled.
Call Stack (most recent call first):
CMakeLists.txt:427 (find_feature)

-- Checking for one of the modules 'epoxy'
CMake Warning at CMakeLists.txt:135 (message):
Requested module epoxy missing for feature USE_EPOXY. Feature disabled.
Call Stack (most recent call first):
CMakeLists.txt:428 (find_feature)

-- Checking for one of the modules 'libelf'
CMake Warning at CMakeLists.txt:135 (message):
Requested module libelf missing for feature USE_ELF. Feature disabled.
Call Stack (most recent call first):
CMakeLists.txt:431 (find_feature)

-- Build type: Debug
-- Platforms:
-- Game Boy Advance: ON
-- Game Boy: ON
-- Features:
-- Debuggers: ON
-- CLI debugger: OFF
-- GDB stub: ON
-- Video recording: OFF
-- GIF recording: OFF
-- Screenshot/advanced savestate support: OFF
-- ZIP support: OFF
-- 7-Zip support: 0
-- SQLite3 game database: 0
-- ELF loading support: OFF
-- OpenGL support: OpenGL|ES 2
-- Frontends:
-- Qt: OFF
-- SDL (): OFF
-- Profiling: OFF
-- Test harness: OFF
-- Test suite: OFF
-- Python bindings: OFF
-- Examples: OFF
-- Cores:
-- Libretro core: OFF
-- Libraries:
-- Static: OFF
-- Shared: ON
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/mshow/Downloads/mGBA-master4/app/.externalNativeBuild/cmake/debug/arm64-v8a
[1/2] cd /Users/mshow/Downloads/mGBA-master4/app/.externalNativeBuild/cmake/debug/arm64-v8a && /Users/mshow/android-sdks/cmake/3.6.4111459/bin/cmake -DBINARY_NAME=mgba -DCONFIG_FILE=/Users/mshow/Downloads/mGBA-master4/mgba/src/core/version.c.in -DOUT_FILE=/Users/mshow/Downloads/mGBA-master4/app/.externalNativeBuild/cmake/debug/arm64-v8a/version.c -P /Users/mshow/Downloads/mGBA-master4/mgba/version.cmake
[2/2] Linking C shared library /Users/mshow/Downloads/mGBA-master4/app/build/intermediates/cmake/debug/obj/arm64-v8a/libmgba.so
FAILED: : && /Users/mshow/android-sdks/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang --target=aarch64-none-linux-android --gcc-toolchain=/Users/mshow/android-sdks/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64 --sysroot=/Users/mshow/android-sdks/ndk-bundle/sysroot -fPIC -isystem /Users/mshow/android-sdks/ndk-bundle/sysroot/usr/include/aarch64-linux-android -D__ANDROID_API__=21 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -Wa,--noexecstack -Wformat -Werror=format-security -Wall -Wextra -Wno-missing-field-initializers -std=c99 -pthread -O0 -fno-limit-debug-info -Wl,--exclude-libs,libgcc.a -Wl,--exclude-libs,libatomic.a --sysroot /Users/mshow/android-sdks/ndk-bundle/platforms/android-21/arch-arm64 -Wl,--build-id -Wl,--warn-shared-textrel -Wl,--fatal-warnings -Wl,--no-undefined -Wl,-z,noexecstack -Qunused-arguments -Wl,-z,relro -Wl,-z,now -shared -Wl,-soname,libmgba.so -o /Users/mshow/Downloads/mGBA-master4/app/build/intermediates/cmake/debug/obj/arm64-v8a/libmgba.so CMakeFiles/mgba.dir/src/core/cache-set.c.o CMakeFiles/mgba.dir/src/core/cheats.c.o CMakeFiles/mgba.dir/src/core/config.c.o CMakeFiles/mgba.dir/src/core/core.c.o CMakeFiles/mgba.dir/src/core/directories.c.o CMakeFiles/mgba.dir/src/core/input.c.o CMakeFiles/mgba.dir/src/core/interface.c.o CMakeFiles/mgba.dir/src/core/library.c.o CMakeFiles/mgba.dir/src/core/lockstep.c.o CMakeFiles/mgba.dir/src/core/log.c.o CMakeFiles/mgba.dir/src/core/map-cache.c.o CMakeFiles/mgba.dir/src/core/mem-search.c.o CMakeFiles/mgba.dir/src/core/rewind.c.o CMakeFiles/mgba.dir/src/core/scripting.c.o CMakeFiles/mgba.dir/src/core/serialize.c.o CMakeFiles/mgba.dir/src/core/sync.c.o CMakeFiles/mgba.dir/src/core/thread.c.o CMakeFiles/mgba.dir/src/core/tile-cache.c.o CMakeFiles/mgba.dir/src/core/timing.c.o CMakeFiles/mgba.dir/src/lr35902/decoder.c.o CMakeFiles/mgba.dir/src/lr35902/isa-lr35902.c.o CMakeFiles/mgba.dir/src/lr35902/lr35902.c.o CMakeFiles/mgba.dir/src/gb/audio.c.o CMakeFiles/mgba.dir/src/gb/cheats.c.o CMakeFiles/mgba.dir/src/gb/core.c.o CMakeFiles/mgba.dir/src/gb/gb.c.o CMakeFiles/mgba.dir/src/gb/io.c.o CMakeFiles/mgba.dir/src/gb/mbc.c.o CMakeFiles/mgba.dir/src/gb/memory.c.o CMakeFiles/mgba.dir/src/gb/overrides.c.o CMakeFiles/mgba.dir/src/gb/serialize.c.o CMakeFiles/mgba.dir/src/gb/sio.c.o CMakeFiles/mgba.dir/src/gb/timer.c.o CMakeFiles/mgba.dir/src/gb/video.c.o CMakeFiles/mgba.dir/src/gb/renderers/cache-set.c.o CMakeFiles/mgba.dir/src/gb/renderers/software.c.o CMakeFiles/mgba.dir/src/arm/arm.c.o CMakeFiles/mgba.dir/src/arm/decoder-arm.c.o CMakeFiles/mgba.dir/src/arm/decoder-thumb.c.o CMakeFiles/mgba.dir/src/arm/decoder.c.o CMakeFiles/mgba.dir/src/arm/isa-arm.c.o CMakeFiles/mgba.dir/src/arm/isa-thumb.c.o CMakeFiles/mgba.dir/src/gba/audio.c.o CMakeFiles/mgba.dir/src/gba/bios.c.o CMakeFiles/mgba.dir/src/gba/cheats.c.o CMakeFiles/mgba.dir/src/gba/core.c.o CMakeFiles/mgba.dir/src/gba/dma.c.o CMakeFiles/mgba.dir/src/gba/gba.c.o CMakeFiles/mgba.dir/src/gba/hardware.c.o CMakeFiles/mgba.dir/src/gba/hle-bios.c.o CMakeFiles/mgba.dir/src/gba/input.c.o CMakeFiles/mgba.dir/src/gba/io.c.o CMakeFiles/mgba.dir/src/gba/matrix.c.o CMakeFiles/mgba.dir/src/gba/memory.c.o CMakeFiles/mgba.dir/src/gba/overrides.c.o CMakeFiles/mgba.dir/src/gba/savedata.c.o CMakeFiles/mgba.dir/src/gba/serialize.c.o CMakeFiles/mgba.dir/src/gba/sharkport.c.o CMakeFiles/mgba.dir/src/gba/sio.c.o CMakeFiles/mgba.dir/src/gba/timer.c.o CMakeFiles/mgba.dir/src/gba/vfame.c.o CMakeFiles/mgba.dir/src/gba/video.c.o CMakeFiles/mgba.dir/src/gba/cheats/codebreaker.c.o CMakeFiles/mgba.dir/src/gba/cheats/gameshark.c.o CMakeFiles/mgba.dir/src/gba/cheats/parv3.c.o CMakeFiles/mgba.dir/src/gba/renderers/cache-set.c.o CMakeFiles/mgba.dir/src/gba/renderers/software-bg.c.o CMakeFiles/mgba.dir/src/gba/renderers/software-mode0.c.o CMakeFiles/mgba.dir/src/gba/renderers/software-obj.c.o CMakeFiles/mgba.dir/src/gba/renderers/video-software.c.o CMakeFiles/mgba.dir/src/util/circle-buffer.c.o CMakeFiles/mgba.dir/src/util/configuration.c.o CMakeFiles/mgba.dir/src/util/crc32.c.o CMakeFiles/mgba.dir/src/util/elf-read.c.o CMakeFiles/mgba.dir/src/util/export.c.o CMakeFiles/mgba.dir/src/util/formatting.c.o CMakeFiles/mgba.dir/src/util/gui.c.o CMakeFiles/mgba.dir/src/util/hash.c.o CMakeFiles/mgba.dir/src/util/patch-fast.c.o CMakeFiles/mgba.dir/src/util/patch-ips.c.o CMakeFiles/mgba.dir/src/util/patch-ups.c.o CMakeFiles/mgba.dir/src/util/patch.c.o CMakeFiles/mgba.dir/src/util/png-io.c.o CMakeFiles/mgba.dir/src/util/ring-fifo.c.o CMakeFiles/mgba.dir/src/util/string.c.o CMakeFiles/mgba.dir/src/util/table.c.o CMakeFiles/mgba.dir/src/util/text-codec.c.o CMakeFiles/mgba.dir/src/util/vfs.c.o CMakeFiles/mgba.dir/version.c.o CMakeFiles/mgba.dir/src/util/vfs/vfs-mem.c.o CMakeFiles/mgba.dir/src/util/vfs/vfs-fifo.c.o CMakeFiles/mgba.dir/src/util/vfs/vfs-fd.c.o CMakeFiles/mgba.dir/src/util/vfs/vfs-dirent.c.o CMakeFiles/mgba.dir/src/platform/posix/memory.c.o CMakeFiles/mgba.dir/src/third-party/inih/ini.c.o CMakeFiles/mgba.dir/src/third-party/blip_buf/blip_buf.c.o CMakeFiles/mgba.dir/src/gba/sio/joybus.c.o CMakeFiles/mgba.dir/src/gba/sio/lockstep.c.o CMakeFiles/mgba.dir/src/gb/sio/lockstep.c.o CMakeFiles/mgba.dir/src/gb/sio/printer.c.o CMakeFiles/mgba.dir/src/debugger/gdb-stub.c.o CMakeFiles/mgba.dir/src/debugger/debugger.c.o CMakeFiles/mgba.dir/src/debugger/parser.c.o CMakeFiles/mgba.dir/src/debugger/symbols.c.o CMakeFiles/mgba.dir/src/debugger/cli-debugger.c.o CMakeFiles/mgba.dir/src/lr35902/debugger/cli-debugger.c.o CMakeFiles/mgba.dir/src/lr35902/debugger/debugger.c.o CMakeFiles/mgba.dir/src/lr35902/debugger/memory-debugger.c.o CMakeFiles/mgba.dir/src/gb/debugger/cli.c.o CMakeFiles/mgba.dir/src/gb/debugger/symbols.c.o CMakeFiles/mgba.dir/src/arm/debugger/cli-debugger.c.o CMakeFiles/mgba.dir/src/arm/debugger/debugger.c.o CMakeFiles/mgba.dir/src/arm/debugger/memory-debugger.c.o CMakeFiles/mgba.dir/src/gba/debugger/cli.c.o CMakeFiles/mgba.dir/src/gba/rr/mgm.c.o CMakeFiles/mgba.dir/src/gba/rr/rr.c.o CMakeFiles/mgba.dir/src/gba/rr/vbm.c.o CMakeFiles/mgba.dir/src/gba/extra/proxy.c.o CMakeFiles/mgba.dir/src/gb/extra/proxy.c.o CMakeFiles/mgba.dir/src/feature/commandline.c.o CMakeFiles/mgba.dir/src/feature/thread-proxy.c.o CMakeFiles/mgba.dir/src/feature/video-logger.c.o -lm -latomic -lm && :
CMakeFiles/mgba.dir/src/util/formatting.c.o: In function strtof_u': /Users/mshow/Downloads/mGBA-master4/mgba/src/util/formatting.c:67: undefined reference to strtof_l'
CMakeFiles/mgba.dir/src/util/vfs/vfs-fd.c.o: In function _vfdSync': /Users/mshow/Downloads/mGBA-master4/mgba/src/util/vfs/vfs-fd.c:172: undefined reference to futimes'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

@Andr3Carvalh0
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Yeah about that... I havent started messing with the native emulator part, I just imported the mgba into the project.
So you could try fixing that or if you just want to mess with the UI part, just disable the native build.

@mshowsary
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the reply Andre .
Well like you said the native part give a lots of error. Im new to dealing with native codes as this. Also i want to ask if you're available to fix the native part, i'll support the project if you don't mind with any means until it finished, Im kinda like your work.
could you provide me with your email or your socials media profiles
thanks for your time.

Please sign in to comment.